mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
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
This commit is contained in:
committed by
Dave Hansen
parent
414ebf148c
commit
d48567c9a0
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user