Skip to content

Commit 3a95a56

Browse files
viktormalikAlexei Starovoitov
authored andcommitted
uaccess: Define pagefault lock guard
Define a pagefault lock guard which allows to simplify functions that need to disable page faults. Signed-off-by: Viktor Malik <[email protected]> Link: https://lore.kernel.org/r/8a01beb0b671923976f08297d81242bb2129881d.1750917800.git.vmalik@redhat.com Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent d83caf7 commit 3a95a56

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/uaccess.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ static inline bool pagefault_disabled(void)
296296
*/
297297
#define faulthandler_disabled() (pagefault_disabled() || in_atomic())
298298

299+
DEFINE_LOCK_GUARD_0(pagefault, pagefault_disable(), pagefault_enable())
300+
299301
#ifndef CONFIG_ARCH_HAS_SUBPAGE_FAULTS
300302

301303
/**

0 commit comments

Comments
 (0)