summaryrefslogtreecommitdiff
path: root/include/linux/filelock.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2025-06-02 07:58:54 -0400
committerChristian Brauner <brauner@kernel.org>2025-06-10 13:16:19 +0200
commitd209f6e122950d9b6f329f3538b785dd709001e5 (patch)
tree61a1b742cd6ca4513d6e4fbc33b9c2e5dda6160d /include/linux/filelock.h
parentdd765ba8723958514eab2fc742bef69019a21069 (diff)
downloadlinux-next-d209f6e122950d9b6f329f3538b785dd709001e5.tar.gz
linux-next-d209f6e122950d9b6f329f3538b785dd709001e5.zip
filelock: add new locks_wake_up_waiter() helper
Currently the function that does this takes a struct file_lock, but __locks_wake_up_blocks() deals with both locks and leases. Currently this works because both file_lock and file_lease have the file_lock_core at the beginning of the struct, but it's fragile to rely on that. Add a new locks_wake_up_waiter() function and call that from __locks_wake_up_blocks(). Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/20250602-filelock-6-16-v1-1-7da5b2c930fd@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/filelock.h')
-rw-r--r--include/linux/filelock.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/filelock.h b/include/linux/filelock.h
index c412ded9171e..c2ce8ba05d06 100644
--- a/include/linux/filelock.h
+++ b/include/linux/filelock.h
@@ -175,9 +175,14 @@ static inline bool lock_is_write(struct file_lock *fl)
return fl->c.flc_type == F_WRLCK;
}
+static inline void locks_wake_up_waiter(struct file_lock_core *flc)
+{
+ wake_up(&flc->flc_wait);
+}
+
static inline void locks_wake_up(struct file_lock *fl)
{
- wake_up(&fl->c.flc_wait);
+ locks_wake_up_waiter(&fl->c);
}
static inline bool locks_can_async_lock(const struct file_operations *fops)