diff mbox series

[05/12] futex: move FUTEX2_MASK to futex.h

Message ID 20230728164235.1318118-6-axboe@kernel.dk (mailing list archive)
State New
Headers show
Series [01/12] futex: Clarify FUTEX2 flags | expand

Commit Message

Jens Axboe July 28, 2023, 4:42 p.m. UTC
We need this for validating the futex2 flags outside of the normal
futex syscalls.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 kernel/futex/futex.h    | 2 ++
 kernel/futex/syscalls.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/kernel/futex/futex.h b/kernel/futex/futex.h
index d0a43d751e30..2f8deaabc9bc 100644
--- a/kernel/futex/futex.h
+++ b/kernel/futex/futex.h
@@ -51,6 +51,8 @@  static inline unsigned int futex_to_flags(unsigned int op)
 	return flags;
 }
 
+#define FUTEX2_MASK (FUTEX2_64 | FUTEX2_PRIVATE)
+
 /* FUTEX2_ to FLAGS_ */
 static inline unsigned int futex2_to_flags(unsigned int flags2)
 {
diff --git a/kernel/futex/syscalls.c b/kernel/futex/syscalls.c
index d2b2bcf2a665..221c49797de9 100644
--- a/kernel/futex/syscalls.c
+++ b/kernel/futex/syscalls.c
@@ -179,8 +179,6 @@  SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
 	return do_futex(uaddr, op, val, tp, uaddr2, (unsigned long)utime, val3);
 }
 
-#define FUTEX2_MASK (FUTEX2_64 | FUTEX2_PRIVATE)
-
 /**
  * futex_parse_waitv - Parse a waitv array from userspace
  * @futexv:	Kernel side list of waiters to be filled