Add the setlease file_operation to ovl_file_operations and
ovl_dir_operations, 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-17-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>
#include <linux/cred.h>
#include <linux/file.h>
+#include <linux/filelock.h>
#include <linux/mount.h>
#include <linux/xattr.h>
#include <linux/uio.h>
.copy_file_range = ovl_copy_file_range,
.remap_file_range = ovl_remap_file_range,
+ .setlease = generic_setlease,
};
#include <linux/slab.h>
#include <linux/namei.h>
#include <linux/file.h>
+#include <linux/filelock.h>
#include <linux/xattr.h>
#include <linux/rbtree.h>
#include <linux/security.h>
.llseek = ovl_dir_llseek,
.fsync = ovl_dir_fsync,
.release = ovl_dir_release,
+ .setlease = generic_setlease,
};
int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list)