Skip to content

Commit 545b414

Browse files
jtlaytonbrauner
authored andcommitted
ufs: add setlease file operation
Add the setlease file_operation pointing to generic_setlease to the ufs 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-21-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 dbe8d57 commit 545b414

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

fs/ufs/dir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include <linux/time.h>
2121
#include <linux/fs.h>
22+
#include <linux/filelock.h>
2223
#include <linux/swap.h>
2324
#include <linux/iversion.h>
2425

@@ -653,4 +654,5 @@ const struct file_operations ufs_dir_operations = {
653654
.iterate_shared = ufs_readdir,
654655
.fsync = generic_file_fsync,
655656
.llseek = ufs_dir_llseek,
657+
.setlease = generic_setlease,
656658
};

fs/ufs/file.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626

2727
#include <linux/fs.h>
28+
#include <linux/filelock.h>
2829

2930
#include "ufs_fs.h"
3031
#include "ufs.h"
@@ -43,4 +44,5 @@ const struct file_operations ufs_file_operations = {
4344
.fsync = generic_file_fsync,
4445
.splice_read = filemap_splice_read,
4546
.splice_write = iter_file_splice_write,
47+
.setlease = generic_setlease,
4648
};

0 commit comments

Comments
 (0)