@@ -52,12 +52,11 @@ enum {
52
52
MEMTYPE_END_MATCH = 1
53
53
};
54
54
55
- static struct memtype * memtype_match (struct rb_root_cached * root ,
56
- u64 start , u64 end , int match_type )
55
+ static struct memtype * memtype_match (u64 start , u64 end , int match_type )
57
56
{
58
57
struct memtype * match ;
59
58
60
- match = memtype_interval_iter_first (root , start , end );
59
+ match = memtype_interval_iter_first (& memtype_rbroot , start , end );
61
60
while (match != NULL && match -> start < end ) {
62
61
if ((match_type == MEMTYPE_EXACT_MATCH ) &&
63
62
(match -> start == start ) && (match -> end == end ))
@@ -73,10 +72,9 @@ static struct memtype *memtype_match(struct rb_root_cached *root,
73
72
return NULL ; /* Returns NULL if there is no match */
74
73
}
75
74
76
- static int memtype_rb_check_conflict (struct rb_root_cached * root ,
77
- u64 start , u64 end ,
78
- enum page_cache_mode reqtype ,
79
- enum page_cache_mode * newtype )
75
+ static int memtype_check_conflict (u64 start , u64 end ,
76
+ enum page_cache_mode reqtype ,
77
+ enum page_cache_mode * newtype )
80
78
{
81
79
struct memtype * match ;
82
80
enum page_cache_mode found_type = reqtype ;
@@ -116,8 +114,7 @@ int rbt_memtype_check_insert(struct memtype *new,
116
114
{
117
115
int err = 0 ;
118
116
119
- err = memtype_rb_check_conflict (& memtype_rbroot , new -> start , new -> end ,
120
- new -> type , ret_type );
117
+ err = memtype_check_conflict (new -> start , new -> end , new -> type , ret_type );
121
118
if (err )
122
119
return err ;
123
120
@@ -139,11 +136,9 @@ struct memtype *rbt_memtype_erase(u64 start, u64 end)
139
136
* it then checks with END_MATCH, i.e. shrink the size of a node
140
137
* from the end for the mremap case.
141
138
*/
142
- data = memtype_match (& memtype_rbroot , start , end ,
143
- MEMTYPE_EXACT_MATCH );
139
+ data = memtype_match (start , end , MEMTYPE_EXACT_MATCH );
144
140
if (!data ) {
145
- data = memtype_match (& memtype_rbroot , start , end ,
146
- MEMTYPE_END_MATCH );
141
+ data = memtype_match (start , end , MEMTYPE_END_MATCH );
147
142
if (!data )
148
143
return ERR_PTR (- EINVAL );
149
144
}
0 commit comments