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 <jlayton@kernel.org>
Link: https://patch.msgid.link/20260108-setlease-6-20-v1-14-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>
This commit is contained in:
Jeff Layton 2026-01-08 12:13:09 -05:00 committed by Christian Brauner
parent f46bb13dc5
commit 6aaa1d6337
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2
2 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@
*/
#include <linux/fs.h>
#include <linux/filelock.h>
#include <linux/nls.h>
#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

View File

@ -14,6 +14,7 @@
#include <linux/falloc.h>
#include <linux/fiemap.h>
#include <linux/fileattr.h>
#include <linux/filelock.h>
#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