From: Jeff Layton Date: Thu, 8 Jan 2026 17:13:09 +0000 (-0500) Subject: ntfs3: add setlease file operation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6aaa1d6337b5721ede04385444e5796392419241;p=thirdparty%2Fkernel%2Flinux.git ntfs3: add setlease file operation Add the setlease file_operation to ntfs_file_operations, ntfs_legacy_file_operations, ntfs_dir_operations, and ntfs_legacy_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 Link: https://patch.msgid.link/20260108-setlease-6-20-v1-14-ea4dec9b67fa@kernel.org Acked-by: Al Viro Acked-by: Christoph Hellwig Signed-off-by: Christian Brauner --- diff --git a/fs/ntfs3/dir.c b/fs/ntfs3/dir.c index b98e95d6b4d99..b66438e34bbb8 100644 --- a/fs/ntfs3/dir.c +++ b/fs/ntfs3/dir.c @@ -8,6 +8,7 @@ */ #include +#include #include #include "debug.h" @@ -630,6 +631,7 @@ const struct file_operations ntfs_dir_operations = { #ifdef CONFIG_COMPAT .compat_ioctl = ntfs_compat_ioctl, #endif + .setlease = generic_setlease, }; #if IS_ENABLED(CONFIG_NTFS_FS) @@ -638,6 +640,7 @@ const struct file_operations ntfs_legacy_dir_operations = { .read = generic_read_dir, .iterate_shared = ntfs_readdir, .open = ntfs_file_open, + .setlease = generic_setlease, }; #endif // clang-format on diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 2e7b2e566ebe1..6cb4479072a66 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "debug.h" #include "ntfs.h" @@ -1477,6 +1478,7 @@ const struct file_operations ntfs_file_operations = { .fsync = ntfs_file_fsync, .fallocate = ntfs_fallocate, .release = ntfs_file_release, + .setlease = generic_setlease, }; #if IS_ENABLED(CONFIG_NTFS_FS) @@ -1486,6 +1488,7 @@ const struct file_operations ntfs_legacy_file_operations = { .splice_read = ntfs_file_splice_read, .open = ntfs_file_open, .release = ntfs_file_release, + .setlease = generic_setlease, }; #endif // clang-format on