Skip to content

Commit 6163b5d

Browse files
jtlaytonbrauner
authored andcommitted
xfs: add setlease file operation
Add the setlease file_operation pointing to generic_setlease to the xfs 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-22-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>
1 parent 545b414 commit 6163b5d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

fs/xfs/xfs_file.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <linux/mman.h>
3737
#include <linux/fadvise.h>
3838
#include <linux/mount.h>
39+
#include <linux/filelock.h>
3940

4041
static const struct vm_operations_struct xfs_file_vm_ops;
4142

@@ -2007,6 +2008,7 @@ const struct file_operations xfs_file_operations = {
20072008
.fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
20082009
FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE |
20092010
FOP_DONTCACHE,
2011+
.setlease = generic_setlease,
20102012
};
20112013

20122014
const struct file_operations xfs_dir_file_operations = {
@@ -2019,4 +2021,5 @@ const struct file_operations xfs_dir_file_operations = {
20192021
.compat_ioctl = xfs_file_compat_ioctl,
20202022
#endif
20212023
.fsync = xfs_dir_fsync,
2024+
.setlease = generic_setlease,
20222025
};

0 commit comments

Comments
 (0)