[PATCH] filelock: move LEASE_BREAK_* flags out of #ifdef CONFIG_FILE_LOCKING
From: Jeff Layton
Date: Sat May 16 2026 - 07:11:34 EST
This was causing a build break when CONFIG_FILE_LOCKING was disabled.
Move the LEASE_BREAK_* flags into the non-#ifdef'ed part of the file.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202605161232.1lY6pZoM-lkp@xxxxxxxxx/
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
The kernel test robot caught this one. Christian, feel free to fold this
into the patch that introduces the constants.
---
include/linux/filelock.h | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/include/linux/filelock.h b/include/linux/filelock.h
index 6e125902c58a..7a7a6e8a9a08 100644
--- a/include/linux/filelock.h
+++ b/include/linux/filelock.h
@@ -29,6 +29,15 @@
*/
#define FILE_LOCK_DEFERRED 1
+#define LEASE_BREAK_LEASE BIT(0) // break leases and delegations
+#define LEASE_BREAK_DELEG BIT(1) // break delegations only
+#define LEASE_BREAK_LAYOUT BIT(2) // break layouts only
+#define LEASE_BREAK_NONBLOCK BIT(3) // non-blocking break
+#define LEASE_BREAK_OPEN_RDONLY BIT(4) // readonly open event
+#define LEASE_BREAK_DIR_CREATE BIT(5) // dir deleg create event
+#define LEASE_BREAK_DIR_DELETE BIT(6) // dir deleg delete event
+#define LEASE_BREAK_DIR_RENAME BIT(7) // dir deleg rename event
+
struct file_lock;
struct file_lease;
@@ -219,17 +228,6 @@ int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);
void locks_init_lease(struct file_lease *);
void locks_free_lease(struct file_lease *fl);
struct file_lease *locks_alloc_lease(void);
-
-#define LEASE_BREAK_LEASE BIT(0) // break leases and delegations
-#define LEASE_BREAK_DELEG BIT(1) // break delegations only
-#define LEASE_BREAK_LAYOUT BIT(2) // break layouts only
-#define LEASE_BREAK_NONBLOCK BIT(3) // non-blocking break
-#define LEASE_BREAK_OPEN_RDONLY BIT(4) // readonly open event
-#define LEASE_BREAK_DIR_CREATE BIT(5) // dir deleg create event
-#define LEASE_BREAK_DIR_DELETE BIT(6) // dir deleg delete event
-#define LEASE_BREAK_DIR_RENAME BIT(7) // dir deleg rename event
-
-
int __break_lease(struct inode *inode, unsigned int flags);
void lease_get_mtime(struct inode *, struct timespec64 *time);
int generic_setlease(struct file *, int, struct file_lease **, void **priv);
---
base-commit: ee4cc056e39316155b8dc186845922d5731a3a7a
change-id: 20260516-dir-deleg-fix-5f272bbafff2
Best regards,
--
Jeff Layton <jlayton@xxxxxxxxxx>