@@ -47,7 +47,7 @@ static u64 get_subtree_max_end(struct rb_node *node)
47
47
{
48
48
u64 ret = 0 ;
49
49
if (node ) {
50
- struct memtype * data = container_of (node , struct memtype , rb );
50
+ struct memtype * data = rb_entry (node , struct memtype , rb );
51
51
ret = data -> subtree_max_end ;
52
52
}
53
53
return ret ;
@@ -79,7 +79,7 @@ static struct memtype *memtype_rb_lowest_match(struct rb_root *root,
79
79
struct memtype * last_lower = NULL ;
80
80
81
81
while (node ) {
82
- struct memtype * data = container_of (node , struct memtype , rb );
82
+ struct memtype * data = rb_entry (node , struct memtype , rb );
83
83
84
84
if (get_subtree_max_end (node -> rb_left ) > start ) {
85
85
/* Lowest overlap if any must be on left side */
@@ -121,7 +121,7 @@ static struct memtype *memtype_rb_match(struct rb_root *root,
121
121
122
122
node = rb_next (& match -> rb );
123
123
if (node )
124
- match = container_of (node , struct memtype , rb );
124
+ match = rb_entry (node , struct memtype , rb );
125
125
else
126
126
match = NULL ;
127
127
}
@@ -150,7 +150,7 @@ static int memtype_rb_check_conflict(struct rb_root *root,
150
150
151
151
node = rb_next (& match -> rb );
152
152
while (node ) {
153
- match = container_of (node , struct memtype , rb );
153
+ match = rb_entry (node , struct memtype , rb );
154
154
155
155
if (match -> start >= end ) /* Checked all possible matches */
156
156
goto success ;
@@ -181,7 +181,7 @@ static void memtype_rb_insert(struct rb_root *root, struct memtype *newdata)
181
181
struct rb_node * parent = NULL ;
182
182
183
183
while (* node ) {
184
- struct memtype * data = container_of (* node , struct memtype , rb );
184
+ struct memtype * data = rb_entry (* node , struct memtype , rb );
185
185
186
186
parent = * node ;
187
187
if (data -> subtree_max_end < newdata -> end )
@@ -270,7 +270,7 @@ int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos)
270
270
}
271
271
272
272
if (node ) { /* pos == i */
273
- struct memtype * this = container_of (node , struct memtype , rb );
273
+ struct memtype * this = rb_entry (node , struct memtype , rb );
274
274
* out = * this ;
275
275
return 0 ;
276
276
} else {
0 commit comments