Skip to content

Commit 511aaca

Browse files
Davidlohr BuesoIngo Molnar
authored andcommitted
x86/mm/pat: Drop the rbt_ prefix from external memtype calls
Drop the rbt_memtype_*() call rbt_ prefix, as we no longer use an rbtree directly. Signed-off-by: Davidlohr Bueso <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 6a9930b commit 511aaca

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

arch/x86/mm/pat.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ int reserve_memtype(u64 start, u64 end, enum page_cache_mode req_type,
603603

604604
spin_lock(&memtype_lock);
605605

606-
err = rbt_memtype_check_insert(new, new_type);
606+
err = memtype_check_insert(new, new_type);
607607
if (err) {
608608
pr_info("x86/PAT: reserve_memtype failed [mem %#010Lx-%#010Lx], track %s, req %s\n",
609609
start, end - 1,
@@ -650,7 +650,7 @@ int free_memtype(u64 start, u64 end)
650650
}
651651

652652
spin_lock(&memtype_lock);
653-
entry = rbt_memtype_erase(start, end);
653+
entry = memtype_erase(start, end);
654654
spin_unlock(&memtype_lock);
655655

656656
if (IS_ERR(entry)) {
@@ -693,7 +693,7 @@ static enum page_cache_mode lookup_memtype(u64 paddr)
693693

694694
spin_lock(&memtype_lock);
695695

696-
entry = rbt_memtype_lookup(paddr);
696+
entry = memtype_lookup(paddr);
697697
if (entry != NULL)
698698
rettype = entry->type;
699699
else
@@ -1109,7 +1109,7 @@ static struct memtype *memtype_get_idx(loff_t pos)
11091109
return NULL;
11101110

11111111
spin_lock(&memtype_lock);
1112-
ret = rbt_memtype_copy_nth_element(print_entry, pos);
1112+
ret = memtype_copy_nth_element(print_entry, pos);
11131113
spin_unlock(&memtype_lock);
11141114

11151115
if (!ret) {

arch/x86/mm/pat_internal.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ static inline char *cattr_name(enum page_cache_mode pcm)
2929
}
3030

3131
#ifdef CONFIG_X86_PAT
32-
extern int rbt_memtype_check_insert(struct memtype *new,
33-
enum page_cache_mode *new_type);
34-
extern struct memtype *rbt_memtype_erase(u64 start, u64 end);
35-
extern struct memtype *rbt_memtype_lookup(u64 addr);
36-
extern int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos);
32+
extern int memtype_check_insert(struct memtype *new,
33+
enum page_cache_mode *new_type);
34+
extern struct memtype *memtype_erase(u64 start, u64 end);
35+
extern struct memtype *memtype_lookup(u64 addr);
36+
extern int memtype_copy_nth_element(struct memtype *out, loff_t pos);
3737
#else
38-
static inline int rbt_memtype_check_insert(struct memtype *new,
39-
enum page_cache_mode *new_type)
38+
static inline int memtype_check_insert(struct memtype *new,
39+
enum page_cache_mode *new_type)
4040
{ return 0; }
41-
static inline struct memtype *rbt_memtype_erase(u64 start, u64 end)
41+
static inline struct memtype *memtype_erase(u64 start, u64 end)
4242
{ return NULL; }
43-
static inline struct memtype *rbt_memtype_lookup(u64 addr)
43+
static inline struct memtype *memtype_lookup(u64 addr)
4444
{ return NULL; }
45-
static inline int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos)
45+
static inline int memtype_copy_nth_element(struct memtype *out, loff_t pos)
4646
{ return 0; }
4747
#endif
4848

arch/x86/mm/pat_rbtree.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ static int memtype_check_conflict(u64 start, u64 end,
109109
return -EBUSY;
110110
}
111111

112-
int rbt_memtype_check_insert(struct memtype *new,
113-
enum page_cache_mode *ret_type)
112+
int memtype_check_insert(struct memtype *new,
113+
enum page_cache_mode *ret_type)
114114
{
115115
int err = 0;
116116

@@ -125,13 +125,13 @@ int rbt_memtype_check_insert(struct memtype *new,
125125
return 0;
126126
}
127127

128-
struct memtype *rbt_memtype_erase(u64 start, u64 end)
128+
struct memtype *memtype_erase(u64 start, u64 end)
129129
{
130130
struct memtype *data;
131131

132132
/*
133133
* Since the memtype_rbroot tree allows overlapping ranges,
134-
* rbt_memtype_erase() checks with EXACT_MATCH first, i.e. free
134+
* memtype_erase() checks with EXACT_MATCH first, i.e. free
135135
* a whole node for the munmap case. If no such entry is found,
136136
* it then checks with END_MATCH, i.e. shrink the size of a node
137137
* from the end for the mremap case.
@@ -157,14 +157,14 @@ struct memtype *rbt_memtype_erase(u64 start, u64 end)
157157
return data;
158158
}
159159

160-
struct memtype *rbt_memtype_lookup(u64 addr)
160+
struct memtype *memtype_lookup(u64 addr)
161161
{
162162
return memtype_interval_iter_first(&memtype_rbroot, addr,
163163
addr + PAGE_SIZE);
164164
}
165165

166166
#if defined(CONFIG_DEBUG_FS)
167-
int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos)
167+
int memtype_copy_nth_element(struct memtype *out, loff_t pos)
168168
{
169169
struct memtype *match;
170170
int i = 1;

0 commit comments

Comments
 (0)