]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
affs: add setlease file operation
authorJeff Layton <jlayton@kernel.org>
Thu, 8 Jan 2026 17:12:57 +0000 (12:12 -0500)
committerChristian Brauner <brauner@kernel.org>
Mon, 12 Jan 2026 09:55:45 +0000 (10:55 +0100)
Add the setlease file_operation to affs_file_operations and
affs_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-2-ea4dec9b67fa@kernel.org
Acked-by: David Sterba <dsterba@suse.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/affs/dir.c
fs/affs/file.c

index bd40d5f0881042e7e6b15b09a76a1793169a1d50..fe18caaf4d6557c67f5c0542ad86a6fe4c512aaf 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include <linux/iversion.h>
+#include <linux/filelock.h>
 #include "affs.h"
 
 struct affs_dir_data {
@@ -55,6 +56,7 @@ const struct file_operations affs_dir_operations = {
        .iterate_shared = affs_readdir,
        .fsync          = affs_file_fsync,
        .release        = affs_dir_release,
+       .setlease       = generic_setlease,
 };
 
 /*
index 765c3443663e6f542dce2ad5d9e055e14b0574e3..6c9258359ddb9ba344976dd5a9a435f71f3fabc1 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <linux/uio.h>
 #include <linux/blkdev.h>
+#include <linux/filelock.h>
 #include <linux/mpage.h>
 #include "affs.h"
 
@@ -1008,6 +1009,7 @@ const struct file_operations affs_file_operations = {
        .release        = affs_file_release,
        .fsync          = affs_file_fsync,
        .splice_read    = filemap_splice_read,
+       .setlease       = generic_setlease,
 };
 
 const struct inode_operations affs_file_inode_operations = {