diff options
| author | Jeff Layton <jlayton@kernel.org> | 2026-01-08 20:13:13 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-01-12 12:55:47 +0300 |
| commit | dfd8676efe436859300f22a6b7a445e7448321b6 (patch) | |
| tree | 635c56dc7144a21daa82e527739183d5d0b5100d | |
| parent | 94a3f60af5dca72fffc041a64d4c3de5a066f98e (diff) | |
| download | linux-dfd8676efe436859300f22a6b7a445e7448321b6.tar.xz | |
squashfs: add setlease file operation
Add the setlease file_operation pointing to generic_setlease to the
squashfs file_operations structures. A future patch will change the
default behavior to reject lease attempts with -EINVAL when there is no
setlease file operation defined. Add generic_setlease to retain the
ability to set leases on this filesystem.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260108-setlease-6-20-v1-18-ea4dec9b67fa@kernel.org
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
| -rw-r--r-- | fs/squashfs/dir.c | 2 | ||||
| -rw-r--r-- | fs/squashfs/file.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/squashfs/dir.c b/fs/squashfs/dir.c index a2ade63eccdf..cd3598bd034f 100644 --- a/fs/squashfs/dir.c +++ b/fs/squashfs/dir.c @@ -15,6 +15,7 @@ */ #include <linux/fs.h> +#include <linux/filelock.h> #include <linux/vfs.h> #include <linux/slab.h> @@ -220,4 +221,5 @@ const struct file_operations squashfs_dir_ops = { .read = generic_read_dir, .iterate_shared = squashfs_readdir, .llseek = generic_file_llseek, + .setlease = generic_setlease, }; diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index 1582e0637a7e..4be92206e755 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -28,6 +28,7 @@ */ #include <linux/fs.h> +#include <linux/filelock.h> #include <linux/vfs.h> #include <linux/kernel.h> #include <linux/slab.h> @@ -775,5 +776,6 @@ const struct file_operations squashfs_file_operations = { .llseek = squashfs_llseek, .read_iter = generic_file_read_iter, .mmap_prepare = generic_file_readonly_mmap_prepare, - .splice_read = filemap_splice_read + .splice_read = filemap_splice_read, + .setlease = generic_setlease, }; |
