summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2026-01-08 12:13:10 -0500
committerChristian Brauner <brauner@kernel.org>2026-01-12 10:55:47 +0100
commitf15d3150279d6c54a97eaac0c8f3c438c525c2f2 (patch)
tree6155624e48ef7c7dcba2f774d85515b49f87265c
parent6aaa1d6337b5721ede04385444e5796392419241 (diff)
ocfs2: add setlease file operation
Add the setlease file_operation to ocfs2_fops, ocfs2_dops, ocfs2_fops_no_plocks, and ocfs2_dops_no_plocks, pointing to generic_setlease. 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-15-ea4dec9b67fa@kernel.org Acked-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/ocfs2/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 732c61599159..ed961a854983 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -19,6 +19,7 @@
#include <linux/mount.h>
#include <linux/writeback.h>
#include <linux/falloc.h>
+#include <linux/filelock.h>
#include <linux/quotaops.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
@@ -2823,6 +2824,7 @@ const struct file_operations ocfs2_fops = {
.fallocate = ocfs2_fallocate,
.remap_file_range = ocfs2_remap_file_range,
.fop_flags = FOP_ASYNC_LOCK,
+ .setlease = generic_setlease,
};
WRAP_DIR_ITER(ocfs2_readdir) // FIXME!
@@ -2840,6 +2842,7 @@ const struct file_operations ocfs2_dops = {
.lock = ocfs2_lock,
.flock = ocfs2_flock,
.fop_flags = FOP_ASYNC_LOCK,
+ .setlease = generic_setlease,
};
/*
@@ -2871,6 +2874,7 @@ const struct file_operations ocfs2_fops_no_plocks = {
.splice_write = iter_file_splice_write,
.fallocate = ocfs2_fallocate,
.remap_file_range = ocfs2_remap_file_range,
+ .setlease = generic_setlease,
};
const struct file_operations ocfs2_dops_no_plocks = {
@@ -2885,4 +2889,5 @@ const struct file_operations ocfs2_dops_no_plocks = {
.compat_ioctl = ocfs2_compat_ioctl,
#endif
.flock = ocfs2_flock,
+ .setlease = generic_setlease,
};