diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-10-26 13:13:03 +0300 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2022-12-15 21:37:26 +0300 |
commit | d48567c9a0d1e605639f8a8705a61bbb55fb4e84 (patch) | |
tree | e21cc2cc51debdb73db0031a21dac0717af1286e /include/linux/set_memory.h | |
parent | 414ebf148cb5c5fa727ec51fdb69c4ab82dccf3b (diff) | |
download | linux-d48567c9a0d1e605639f8a8705a61bbb55fb4e84.tar.xz |
mm: Introduce set_memory_rox()
Because endlessly repeating:
set_memory_ro()
set_memory_x()
is getting tedious.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/Y1jek64pXOsougmz@hirez.programming.kicks-ass.net
Diffstat (limited to 'include/linux/set_memory.h')
-rw-r--r-- | include/linux/set_memory.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/set_memory.h b/include/linux/set_memory.h index 369769ce7399..023ebc67a36c 100644 --- a/include/linux/set_memory.h +++ b/include/linux/set_memory.h @@ -14,6 +14,14 @@ static inline int set_memory_x(unsigned long addr, int numpages) { return 0; } static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; } #endif +static inline int set_memory_rox(unsigned long addr, int numpages) +{ + int ret = set_memory_ro(addr, numpages); + if (ret) + return ret; + return set_memory_x(addr, numpages); +} + #ifndef CONFIG_ARCH_HAS_SET_DIRECT_MAP static inline int set_direct_map_invalid_noflush(struct page *page) { |