mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
vfs-7.0-rc1.leases
Please consider pulling these changes from the signed vfs-7.0-rc1.leases tag. Thanks! Christian -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCaYX49gAKCRCRxhvAZXjc olR/AP40iNOTRn7LosXbRWqGGZqzy9v64QYoLzk3QdsWuGmbRAD/egNQzof8mkAf IscefWTOjY7xyDzmEBEBnfHftgMiEwM= =zre0 -----END PGP SIGNATURE----- Merge tag 'vfs-7.0-rc1.leases' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs lease updates from Christian Brauner: "This contains updates for lease support to require filesystems to explicitly opt-in to lease support Currently kernel_setlease() falls through to generic_setlease() when a a filesystem does not define ->setlease(), silently granting lease support to every filesystem regardless of whether it is prepared for it. This is a poor default: most filesystems never intended to support leases, and the silent fallthrough makes it impossible to distinguish "supports leases" from "never thought about it". This inverts the default. It adds explicit .setlease = generic_setlease; assignments to every in-tree filesystem that should retain lease support, then changes kernel_setlease() to return -EINVAL when ->setlease is NULL. With the new default in place, simple_nosetlease() is redundant and is removed along with all references to it" * tag 'vfs-7.0-rc1.leases' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (25 commits) fuse: add setlease file operation fs: remove simple_nosetlease() filelock: default to returning -EINVAL when ->setlease operation is NULL xfs: add setlease file operation ufs: add setlease file operation udf: add setlease file operation tmpfs: add setlease file operation squashfs: add setlease file operation overlayfs: add setlease file operation orangefs: add setlease file operation ocfs2: add setlease file operation ntfs3: add setlease file operation nilfs2: add setlease file operation jfs: add setlease file operation jffs2: add setlease file operation gfs2: add a setlease file operation fat: add setlease file operation f2fs: add setlease file operation exfat: add setlease file operation ext4: add setlease file operation ...
This commit is contained in:
commit
aa2a0fcd4c
62 changed files with 117 additions and 42 deletions
|
|
@ -1334,3 +1334,12 @@ end_creating() and the parent will be unlocked precisely when necessary.
|
|||
|
||||
kill_litter_super() is gone; convert to DCACHE_PERSISTENT use (as all
|
||||
in-tree filesystems have done).
|
||||
|
||||
---
|
||||
|
||||
**mandatory**
|
||||
|
||||
The ->setlease() file_operation must now be explicitly set in order to provide
|
||||
support for leases. When set to NULL, the kernel will now return -EINVAL to
|
||||
attempts to set a lease. Filesystems that wish to use the kernel-internal lease
|
||||
implementation should set it to generic_setlease().
|
||||
|
|
|
|||
|
|
@ -1187,9 +1187,12 @@ otherwise noted.
|
|||
method is used by the splice(2) system call
|
||||
|
||||
``setlease``
|
||||
called by the VFS to set or release a file lock lease. setlease
|
||||
implementations should call generic_setlease to record or remove
|
||||
the lease in the inode after setting it.
|
||||
called by the VFS to set or release a file lock lease. Local
|
||||
filesystems that wish to use the kernel-internal lease implementation
|
||||
should set this to generic_setlease(). Other setlease implementations
|
||||
should call generic_setlease() to record or remove the lease in the inode
|
||||
after setting it. When set to NULL, attempts to set or remove a lease will
|
||||
return -EINVAL.
|
||||
|
||||
``fallocate``
|
||||
called by the VFS to preallocate blocks or punch a hole.
|
||||
|
|
|
|||
|
|
@ -242,7 +242,6 @@ const struct file_operations v9fs_dir_operations = {
|
|||
.iterate_shared = v9fs_dir_readdir,
|
||||
.open = v9fs_file_open,
|
||||
.release = v9fs_dir_release,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct file_operations v9fs_dir_operations_dotl = {
|
||||
|
|
@ -252,5 +251,4 @@ const struct file_operations v9fs_dir_operations_dotl = {
|
|||
.open = v9fs_file_open,
|
||||
.release = v9fs_dir_release,
|
||||
.fsync = v9fs_file_fsync_dotl,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -517,7 +517,6 @@ const struct file_operations v9fs_file_operations = {
|
|||
.splice_read = v9fs_file_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.fsync = v9fs_file_fsync,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct file_operations v9fs_file_operations_dotl = {
|
||||
|
|
@ -532,5 +531,4 @@ const struct file_operations v9fs_file_operations_dotl = {
|
|||
.splice_read = v9fs_file_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.fsync = v9fs_file_fsync_dotl,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/fs_context.h>
|
||||
#include <linux/fs_parser.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/stat.h>
|
||||
#include <linux/nls.h>
|
||||
#include <linux/buffer_head.h>
|
||||
|
|
@ -79,6 +80,7 @@ static const struct file_operations befs_dir_operations = {
|
|||
.read = generic_read_dir,
|
||||
.iterate_shared = befs_readdir,
|
||||
.llseek = generic_file_llseek,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
static const struct inode_operations befs_dir_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <linux/string.h>
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -3867,6 +3868,7 @@ const struct file_operations btrfs_file_operations = {
|
|||
.remap_file_range = btrfs_remap_file_range,
|
||||
.uring_cmd = btrfs_uring_cmd,
|
||||
.fop_flags = FOP_BUFFER_RASYNC | FOP_BUFFER_WASYNC,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
int btrfs_fdatawrite_range(struct btrfs_inode *inode, loff_t start, loff_t end)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/bio.h>
|
||||
#include <linux/blk-cgroup.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/fs_struct.h>
|
||||
#include <linux/pagemap.h>
|
||||
|
|
@ -10610,6 +10611,7 @@ static const struct file_operations btrfs_dir_file_operations = {
|
|||
#endif
|
||||
.release = btrfs_release_file,
|
||||
.fsync = btrfs_sync_file,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -2214,7 +2214,6 @@ const struct file_operations ceph_dir_fops = {
|
|||
.fsync = ceph_fsync,
|
||||
.lock = ceph_lock,
|
||||
.flock = ceph_flock,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct file_operations ceph_snapdir_fops = {
|
||||
|
|
@ -2222,7 +2221,6 @@ const struct file_operations ceph_snapdir_fops = {
|
|||
.llseek = ceph_dir_llseek,
|
||||
.open = ceph_open,
|
||||
.release = ceph_release,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct inode_operations ceph_dir_iops = {
|
||||
|
|
|
|||
|
|
@ -3169,7 +3169,6 @@ const struct file_operations ceph_file_fops = {
|
|||
.mmap_prepare = ceph_mmap_prepare,
|
||||
.fsync = ceph_fsync,
|
||||
.lock = ceph_lock,
|
||||
.setlease = simple_nosetlease,
|
||||
.flock = ceph_flock,
|
||||
.splice_read = ceph_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/ramfs.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -938,6 +939,7 @@ static const struct file_operations cramfs_directory_operations = {
|
|||
.llseek = generic_file_llseek,
|
||||
.read = generic_read_dir,
|
||||
.iterate_shared = cramfs_readdir,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
static const struct inode_operations cramfs_dir_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/filelock.h>
|
||||
#include "efs.h"
|
||||
|
||||
static int efs_readdir(struct file *, struct dir_context *);
|
||||
|
|
@ -14,6 +15,7 @@ const struct file_operations efs_dir_operations = {
|
|||
.llseek = generic_file_llseek,
|
||||
.read = generic_read_dir,
|
||||
.iterate_shared = efs_readdir,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct inode_operations efs_dir_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2021, Alibaba Cloud
|
||||
*/
|
||||
#include "internal.h"
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/sched/mm.h>
|
||||
#include <trace/events/erofs.h>
|
||||
|
||||
|
|
@ -483,4 +484,5 @@ const struct file_operations erofs_file_fops = {
|
|||
.mmap_prepare = erofs_file_mmap_prepare,
|
||||
.get_unmapped_area = thp_get_unmapped_area,
|
||||
.splice_read = filemap_splice_read,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2022, Alibaba Cloud
|
||||
*/
|
||||
#include "internal.h"
|
||||
#include <linux/filelock.h>
|
||||
|
||||
static int erofs_fill_dentries(struct inode *dir, struct dir_context *ctx,
|
||||
void *dentry_blk, struct erofs_dirent *de,
|
||||
|
|
@ -127,4 +128,5 @@ const struct file_operations erofs_dir_fops = {
|
|||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = erofs_compat_ioctl,
|
||||
#endif
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <linux/compat.h>
|
||||
#include <linux/bio.h>
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/filelock.h>
|
||||
|
||||
#include "exfat_raw.h"
|
||||
#include "exfat_fs.h"
|
||||
|
|
@ -298,6 +299,7 @@ const struct file_operations exfat_dir_operations = {
|
|||
.compat_ioctl = exfat_compat_ioctl,
|
||||
#endif
|
||||
.fsync = exfat_file_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/security.h>
|
||||
#include <linux/msdos_fs.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/filelock.h>
|
||||
|
||||
#include "exfat_raw.h"
|
||||
#include "exfat_fs.h"
|
||||
|
|
@ -772,6 +773,7 @@ const struct file_operations exfat_file_operations = {
|
|||
.fsync = exfat_file_fsync,
|
||||
.splice_read = exfat_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct inode_operations exfat_file_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "ext2.h"
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/swap.h>
|
||||
#include <linux/iversion.h>
|
||||
|
|
@ -734,4 +735,5 @@ const struct file_operations ext2_dir_operations = {
|
|||
.compat_ioctl = ext2_compat_ioctl,
|
||||
#endif
|
||||
.fsync = ext2_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <linux/time.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/dax.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/quotaops.h>
|
||||
#include <linux/iomap.h>
|
||||
#include <linux/uio.h>
|
||||
|
|
@ -325,6 +326,7 @@ const struct file_operations ext2_file_operations = {
|
|||
.get_unmapped_area = thp_get_unmapped_area,
|
||||
.splice_read = filemap_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct inode_operations ext2_file_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/iversion.h>
|
||||
#include <linux/unicode.h>
|
||||
|
|
@ -690,4 +691,5 @@ const struct file_operations ext4_dir_operations = {
|
|||
#endif
|
||||
.fsync = ext4_sync_file,
|
||||
.release = ext4_release_dir,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/mount.h>
|
||||
#include <linux/path.h>
|
||||
#include <linux/dax.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/quotaops.h>
|
||||
#include <linux/pagevec.h>
|
||||
#include <linux/uio.h>
|
||||
|
|
@ -980,6 +981,7 @@ const struct file_operations ext4_file_operations = {
|
|||
.fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
|
||||
FOP_DIO_PARALLEL_WRITE |
|
||||
FOP_DONTCACHE,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct inode_operations ext4_file_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/unaligned.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/f2fs_fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/sched/signal.h>
|
||||
#include <linux/unicode.h>
|
||||
#include "f2fs.h"
|
||||
|
|
@ -1136,4 +1137,5 @@ const struct file_operations f2fs_dir_operations = {
|
|||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = f2fs_compat_ioctl,
|
||||
#endif
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/writeback.h>
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
|
@ -5457,4 +5458,5 @@ const struct file_operations f2fs_file_operations = {
|
|||
.splice_write = iter_file_splice_write,
|
||||
.fadvise = f2fs_file_fadvise,
|
||||
.fop_flags = FOP_BUFFER_RASYNC,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <linux/slab.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/iversion.h>
|
||||
#include "fat.h"
|
||||
|
|
@ -876,6 +877,7 @@ const struct file_operations fat_dir_operations = {
|
|||
.compat_ioctl = fat_compat_dir_ioctl,
|
||||
#endif
|
||||
.fsync = fat_file_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
static int fat_get_short_entry(struct inode *dir, loff_t *pos,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/mount.h>
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/fsnotify.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/falloc.h>
|
||||
|
|
@ -212,6 +213,7 @@ const struct file_operations fat_file_operations = {
|
|||
.splice_read = filemap_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.fallocate = fat_fallocate,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
static int fat_cont_expand(struct inode *inode, loff_t size)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
* Veritas filesystem driver - lookup and other directory related code.
|
||||
*/
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/highmem.h>
|
||||
|
|
@ -36,6 +37,7 @@ const struct file_operations vxfs_dir_operations = {
|
|||
.llseek = generic_file_llseek,
|
||||
.read = generic_read_dir,
|
||||
.iterate_shared = vxfs_readdir,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2429,7 +2429,6 @@ static const struct file_operations fuse_dir_operations = {
|
|||
.fsync = fuse_dir_fsync,
|
||||
.unlocked_ioctl = fuse_dir_ioctl,
|
||||
.compat_ioctl = fuse_dir_compat_ioctl,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
static const struct inode_operations fuse_common_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -3177,6 +3177,7 @@ static const struct file_operations fuse_file_operations = {
|
|||
.poll = fuse_file_poll,
|
||||
.fallocate = fuse_file_fallocate,
|
||||
.copy_file_range = fuse_copy_file_range,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
static const struct address_space_operations fuse_file_aops = {
|
||||
|
|
|
|||
|
|
@ -1593,7 +1593,6 @@ const struct file_operations gfs2_file_fops = {
|
|||
.flock = gfs2_flock,
|
||||
.splice_read = copy_splice_read,
|
||||
.splice_write = gfs2_file_splice_write,
|
||||
.setlease = simple_nosetlease,
|
||||
.fallocate = gfs2_fallocate,
|
||||
.fop_flags = FOP_ASYNC_LOCK,
|
||||
};
|
||||
|
|
@ -1608,7 +1607,6 @@ const struct file_operations gfs2_dir_fops = {
|
|||
.lock = gfs2_lock,
|
||||
.flock = gfs2_flock,
|
||||
.llseek = default_llseek,
|
||||
.setlease = simple_nosetlease,
|
||||
.fop_flags = FOP_ASYNC_LOCK,
|
||||
};
|
||||
|
||||
|
|
@ -1639,5 +1637,6 @@ const struct file_operations gfs2_dir_fops_nolock = {
|
|||
.release = gfs2_release,
|
||||
.fsync = gfs2_fsync,
|
||||
.llseek = default_llseek,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
* isofs directory handling functions
|
||||
*/
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/filelock.h>
|
||||
#include "isofs.h"
|
||||
|
||||
int isofs_name_translate(struct iso_directory_record *de, char *new, struct inode *inode)
|
||||
|
|
@ -271,6 +272,7 @@ const struct file_operations isofs_dir_operations =
|
|||
.llseek = generic_file_llseek,
|
||||
.read = generic_read_dir,
|
||||
.iterate_shared = isofs_readdir,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/jffs2.h>
|
||||
#include "jffs2_fs_i.h"
|
||||
|
|
@ -48,6 +49,7 @@ const struct file_operations jffs2_dir_operations =
|
|||
.unlocked_ioctl=jffs2_ioctl,
|
||||
.fsync = jffs2_fsync,
|
||||
.llseek = generic_file_llseek,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/highmem.h>
|
||||
|
|
@ -60,6 +61,7 @@ const struct file_operations jffs2_file_operations =
|
|||
.fsync = jffs2_fsync,
|
||||
.splice_read = filemap_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
/* jffs2_file_inode_operations */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <linux/mm.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/posix_acl.h>
|
||||
#include <linux/quotaops.h>
|
||||
#include "jfs_incore.h"
|
||||
|
|
@ -153,4 +154,5 @@ const struct file_operations jfs_file_operations = {
|
|||
.release = jfs_release,
|
||||
.unlocked_ioctl = jfs_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/namei.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/quotaops.h>
|
||||
|
|
@ -1545,6 +1546,7 @@ const struct file_operations jfs_dir_operations = {
|
|||
.unlocked_ioctl = jfs_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.llseek = generic_file_llseek,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
static int jfs_ci_hash(const struct dentry *dir, struct qstr *this)
|
||||
|
|
|
|||
20
fs/libfs.c
20
fs/libfs.c
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/cred.h>
|
||||
|
|
@ -570,6 +571,7 @@ const struct file_operations simple_offset_dir_operations = {
|
|||
.iterate_shared = offset_readdir,
|
||||
.read = generic_read_dir,
|
||||
.fsync = noop_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
struct dentry *find_next_child(struct dentry *parent, struct dentry *prev)
|
||||
|
|
@ -1697,24 +1699,6 @@ struct inode *alloc_anon_inode(struct super_block *s)
|
|||
}
|
||||
EXPORT_SYMBOL(alloc_anon_inode);
|
||||
|
||||
/**
|
||||
* simple_nosetlease - generic helper for prohibiting leases
|
||||
* @filp: file pointer
|
||||
* @arg: type of lease to obtain
|
||||
* @flp: new lease supplied for insertion
|
||||
* @priv: private data for lm_setup operation
|
||||
*
|
||||
* Generic helper for filesystems that do not wish to allow leases to be set.
|
||||
* All arguments are ignored and it just returns -EINVAL.
|
||||
*/
|
||||
int
|
||||
simple_nosetlease(struct file *filp, int arg, struct file_lease **flp,
|
||||
void **priv)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL(simple_nosetlease);
|
||||
|
||||
/**
|
||||
* simple_get_link - generic helper to get the target of "fast" symlinks
|
||||
* @dentry: not used here
|
||||
|
|
|
|||
|
|
@ -2019,8 +2019,7 @@ kernel_setlease(struct file *filp, int arg, struct file_lease **lease, void **pr
|
|||
setlease_notifier(arg, *lease);
|
||||
if (filp->f_op->setlease)
|
||||
return filp->f_op->setlease(filp, arg, lease, priv);
|
||||
else
|
||||
return generic_setlease(filp, arg, lease, priv);
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kernel_setlease);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ const struct file_operations nfs_dir_operations = {
|
|||
.open = nfs_opendir,
|
||||
.release = nfs_closedir,
|
||||
.fsync = nfs_fsync_dir,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct address_space_operations nfs_dir_aops = {
|
||||
|
|
|
|||
|
|
@ -963,7 +963,6 @@ const struct file_operations nfs_file_operations = {
|
|||
.splice_read = nfs_file_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.check_flags = nfs_check_flags,
|
||||
.setlease = simple_nosetlease,
|
||||
.fop_flags = FOP_DONTCACHE,
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(nfs_file_operations);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/filelock.h>
|
||||
#include "nilfs.h"
|
||||
#include "page.h"
|
||||
|
||||
|
|
@ -661,5 +662,5 @@ const struct file_operations nilfs_dir_operations = {
|
|||
.compat_ioctl = nilfs_compat_ioctl,
|
||||
#endif /* CONFIG_COMPAT */
|
||||
.fsync = nilfs_sync_file,
|
||||
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/writeback.h>
|
||||
#include "nilfs.h"
|
||||
|
|
@ -150,6 +151,7 @@ const struct file_operations nilfs_file_operations = {
|
|||
.fsync = nilfs_sync_file,
|
||||
.splice_read = filemap_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct inode_operations nilfs_file_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/mount.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/quotaops.h>
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/backing-dev.h>
|
||||
|
|
@ -2823,6 +2824,7 @@ const struct file_operations ocfs2_fops = {
|
|||
.fallocate = ocfs2_fallocate,
|
||||
.remap_file_range = ocfs2_remap_file_range,
|
||||
.fop_flags = FOP_ASYNC_LOCK,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
WRAP_DIR_ITER(ocfs2_readdir) // FIXME!
|
||||
|
|
@ -2840,6 +2842,7 @@ const struct file_operations ocfs2_dops = {
|
|||
.lock = ocfs2_lock,
|
||||
.flock = ocfs2_flock,
|
||||
.fop_flags = FOP_ASYNC_LOCK,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -2871,6 +2874,7 @@ const struct file_operations ocfs2_fops_no_plocks = {
|
|||
.splice_write = iter_file_splice_write,
|
||||
.fallocate = ocfs2_fallocate,
|
||||
.remap_file_range = ocfs2_remap_file_range,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct file_operations ocfs2_dops_no_plocks = {
|
||||
|
|
@ -2885,4 +2889,5 @@ const struct file_operations ocfs2_dops_no_plocks = {
|
|||
.compat_ioctl = ocfs2_compat_ioctl,
|
||||
#endif
|
||||
.flock = ocfs2_flock,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright 2017 Omnibond Systems, L.L.C.
|
||||
*/
|
||||
|
||||
#include <linux/filelock.h>
|
||||
#include "protocol.h"
|
||||
#include "orangefs-kernel.h"
|
||||
#include "orangefs-bufmap.h"
|
||||
|
|
@ -392,5 +393,6 @@ const struct file_operations orangefs_dir_operations = {
|
|||
.read = generic_read_dir,
|
||||
.iterate_shared = orangefs_dir_iterate,
|
||||
.open = orangefs_dir_open,
|
||||
.release = orangefs_dir_release
|
||||
.release = orangefs_dir_release,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -583,4 +583,5 @@ const struct file_operations orangefs_file_operations = {
|
|||
.flush = orangefs_flush,
|
||||
.release = orangefs_file_release,
|
||||
.fsync = orangefs_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <linux/cred.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/xattr.h>
|
||||
#include <linux/uio.h>
|
||||
|
|
@ -647,4 +648,5 @@ const struct file_operations ovl_file_operations = {
|
|||
|
||||
.copy_file_range = ovl_copy_file_range,
|
||||
.remap_file_range = ovl_remap_file_range,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/namei.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/xattr.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/security.h>
|
||||
|
|
@ -1070,6 +1071,7 @@ const struct file_operations ovl_dir_operations = {
|
|||
.llseek = ovl_dir_llseek,
|
||||
.fsync = ovl_dir_fsync,
|
||||
.release = ovl_dir_release,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/filelock.h>
|
||||
#include "qnx4.h"
|
||||
|
||||
static int qnx4_readdir(struct file *file, struct dir_context *ctx)
|
||||
|
|
@ -71,6 +72,7 @@ const struct file_operations qnx4_dir_operations =
|
|||
.read = generic_read_dir,
|
||||
.iterate_shared = qnx4_readdir,
|
||||
.fsync = generic_file_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct inode_operations qnx4_dir_inode_operations =
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <linux/filelock.h>
|
||||
#include "qnx6.h"
|
||||
|
||||
static unsigned qnx6_lfile_checksum(char *name, unsigned size)
|
||||
|
|
@ -275,6 +276,7 @@ const struct file_operations qnx6_dir_operations = {
|
|||
.read = generic_read_dir,
|
||||
.iterate_shared = qnx6_readdir,
|
||||
.fsync = generic_file_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct inode_operations qnx6_dir_inode_operations = {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include <linux/compat.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include "internal.h"
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
|
|
@ -30,6 +31,7 @@ const struct file_operations generic_ro_fops = {
|
|||
.read_iter = generic_file_read_iter,
|
||||
.mmap_prepare = generic_file_readonly_mmap_prepare,
|
||||
.splice_read = filemap_splice_read,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
EXPORT_SYMBOL(generic_ro_fops);
|
||||
|
|
|
|||
|
|
@ -1709,7 +1709,6 @@ const struct file_operations cifs_dir_ops = {
|
|||
.remap_file_range = cifs_remap_file_range,
|
||||
.llseek = generic_file_llseek,
|
||||
.fsync = cifs_dir_fsync,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/vfs.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
|
|
@ -220,4 +221,5 @@ const struct file_operations squashfs_dir_ops = {
|
|||
.read = generic_read_dir,
|
||||
.iterate_shared = squashfs_readdir,
|
||||
.llseek = generic_file_llseek,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/vfs.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -775,5 +776,6 @@ const struct file_operations squashfs_file_operations = {
|
|||
.llseek = squashfs_llseek,
|
||||
.read_iter = generic_file_read_iter,
|
||||
.mmap_prepare = generic_file_readonly_mmap_prepare,
|
||||
.splice_read = filemap_splice_read
|
||||
.splice_read = filemap_splice_read,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <linux/string.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/bio.h>
|
||||
|
|
@ -157,4 +158,5 @@ const struct file_operations udf_dir_operations = {
|
|||
.iterate_shared = udf_readdir,
|
||||
.unlocked_ioctl = udf_ioctl,
|
||||
.fsync = generic_file_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <linux/string.h> /* memset */
|
||||
#include <linux/capability.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/uio.h>
|
||||
|
||||
|
|
@ -208,6 +209,7 @@ const struct file_operations udf_file_operations = {
|
|||
.splice_read = filemap_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.llseek = generic_file_llseek,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <linux/time.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/swap.h>
|
||||
#include <linux/iversion.h>
|
||||
|
||||
|
|
@ -653,4 +654,5 @@ const struct file_operations ufs_dir_operations = {
|
|||
.iterate_shared = ufs_readdir,
|
||||
.fsync = generic_file_fsync,
|
||||
.llseek = ufs_dir_llseek,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
|
||||
#include "ufs_fs.h"
|
||||
#include "ufs.h"
|
||||
|
|
@ -43,4 +44,5 @@ const struct file_operations ufs_file_operations = {
|
|||
.fsync = generic_file_fsync,
|
||||
.splice_read = filemap_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -186,7 +186,6 @@ const struct file_operations vboxsf_dir_fops = {
|
|||
.release = vboxsf_dir_release,
|
||||
.read = generic_read_dir,
|
||||
.llseek = generic_file_llseek,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -218,7 +218,6 @@ const struct file_operations vboxsf_reg_fops = {
|
|||
.release = vboxsf_file_release,
|
||||
.fsync = noop_fsync,
|
||||
.splice_read = filemap_splice_read,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct inode_operations vboxsf_reg_iops = {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include <linux/mman.h>
|
||||
#include <linux/fadvise.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/filelock.h>
|
||||
|
||||
static const struct vm_operations_struct xfs_file_vm_ops;
|
||||
|
||||
|
|
@ -2007,6 +2008,7 @@ const struct file_operations xfs_file_operations = {
|
|||
.fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
|
||||
FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE |
|
||||
FOP_DONTCACHE,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
||||
const struct file_operations xfs_dir_file_operations = {
|
||||
|
|
@ -2019,4 +2021,5 @@ const struct file_operations xfs_dir_file_operations = {
|
|||
.compat_ioctl = xfs_file_compat_ioctl,
|
||||
#endif
|
||||
.fsync = xfs_dir_fsync,
|
||||
.setlease = generic_setlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3227,7 +3227,6 @@ extern int always_delete_dentry(const struct dentry *);
|
|||
extern struct inode *alloc_anon_inode(struct super_block *);
|
||||
struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *name,
|
||||
const struct inode *context_inode);
|
||||
extern int simple_nosetlease(struct file *, int, struct file_lease **, void **);
|
||||
|
||||
extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
|
||||
extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/pagemap.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/fileattr.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/sched/signal.h>
|
||||
|
|
@ -5247,6 +5248,7 @@ static const struct file_operations shmem_file_operations = {
|
|||
.splice_read = shmem_file_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.fallocate = shmem_fallocate,
|
||||
.setlease = generic_setlease,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue