Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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
...

+117 -42
+9
Documentation/filesystems/porting.rst
··· 1334 1334 1335 1335 kill_litter_super() is gone; convert to DCACHE_PERSISTENT use (as all 1336 1336 in-tree filesystems have done). 1337 + 1338 + --- 1339 + 1340 + **mandatory** 1341 + 1342 + The ->setlease() file_operation must now be explicitly set in order to provide 1343 + support for leases. When set to NULL, the kernel will now return -EINVAL to 1344 + attempts to set a lease. Filesystems that wish to use the kernel-internal lease 1345 + implementation should set it to generic_setlease().
+6 -3
Documentation/filesystems/vfs.rst
··· 1187 1187 method is used by the splice(2) system call 1188 1188 1189 1189 ``setlease`` 1190 - called by the VFS to set or release a file lock lease. setlease 1191 - implementations should call generic_setlease to record or remove 1192 - the lease in the inode after setting it. 1190 + called by the VFS to set or release a file lock lease. Local 1191 + filesystems that wish to use the kernel-internal lease implementation 1192 + should set this to generic_setlease(). Other setlease implementations 1193 + should call generic_setlease() to record or remove the lease in the inode 1194 + after setting it. When set to NULL, attempts to set or remove a lease will 1195 + return -EINVAL. 1193 1196 1194 1197 ``fallocate`` 1195 1198 called by the VFS to preallocate blocks or punch a hole.
-2
fs/9p/vfs_dir.c
··· 242 242 .iterate_shared = v9fs_dir_readdir, 243 243 .open = v9fs_file_open, 244 244 .release = v9fs_dir_release, 245 - .setlease = simple_nosetlease, 246 245 }; 247 246 248 247 const struct file_operations v9fs_dir_operations_dotl = { ··· 251 252 .open = v9fs_file_open, 252 253 .release = v9fs_dir_release, 253 254 .fsync = v9fs_file_fsync_dotl, 254 - .setlease = simple_nosetlease, 255 255 };
-2
fs/9p/vfs_file.c
··· 517 517 .splice_read = v9fs_file_splice_read, 518 518 .splice_write = iter_file_splice_write, 519 519 .fsync = v9fs_file_fsync, 520 - .setlease = simple_nosetlease, 521 520 }; 522 521 523 522 const struct file_operations v9fs_file_operations_dotl = { ··· 531 532 .splice_read = v9fs_file_splice_read, 532 533 .splice_write = iter_file_splice_write, 533 534 .fsync = v9fs_file_fsync_dotl, 534 - .setlease = simple_nosetlease, 535 535 };
+2
fs/affs/dir.c
··· 15 15 */ 16 16 17 17 #include <linux/iversion.h> 18 + #include <linux/filelock.h> 18 19 #include "affs.h" 19 20 20 21 struct affs_dir_data { ··· 56 55 .iterate_shared = affs_readdir, 57 56 .fsync = affs_file_fsync, 58 57 .release = affs_dir_release, 58 + .setlease = generic_setlease, 59 59 }; 60 60 61 61 /*
+2
fs/affs/file.c
··· 15 15 16 16 #include <linux/uio.h> 17 17 #include <linux/blkdev.h> 18 + #include <linux/filelock.h> 18 19 #include <linux/mpage.h> 19 20 #include "affs.h" 20 21 ··· 1009 1008 .release = affs_file_release, 1010 1009 .fsync = affs_file_fsync, 1011 1010 .splice_read = filemap_splice_read, 1011 + .setlease = generic_setlease, 1012 1012 }; 1013 1013 1014 1014 const struct inode_operations affs_file_inode_operations = {
+2
fs/befs/linuxvfs.c
··· 14 14 #include <linux/fs_context.h> 15 15 #include <linux/fs_parser.h> 16 16 #include <linux/errno.h> 17 + #include <linux/filelock.h> 17 18 #include <linux/stat.h> 18 19 #include <linux/nls.h> 19 20 #include <linux/buffer_head.h> ··· 80 79 .read = generic_read_dir, 81 80 .iterate_shared = befs_readdir, 82 81 .llseek = generic_file_llseek, 82 + .setlease = generic_setlease, 83 83 }; 84 84 85 85 static const struct inode_operations befs_dir_inode_operations = {
+2
fs/btrfs/file.c
··· 10 10 #include <linux/string.h> 11 11 #include <linux/backing-dev.h> 12 12 #include <linux/falloc.h> 13 + #include <linux/filelock.h> 13 14 #include <linux/writeback.h> 14 15 #include <linux/compat.h> 15 16 #include <linux/slab.h> ··· 3868 3867 .remap_file_range = btrfs_remap_file_range, 3869 3868 .uring_cmd = btrfs_uring_cmd, 3870 3869 .fop_flags = FOP_BUFFER_RASYNC | FOP_BUFFER_WASYNC, 3870 + .setlease = generic_setlease, 3871 3871 }; 3872 3872 3873 3873 int btrfs_fdatawrite_range(struct btrfs_inode *inode, loff_t start, loff_t end)
+2
fs/btrfs/inode.c
··· 8 8 #include <linux/bio.h> 9 9 #include <linux/blk-cgroup.h> 10 10 #include <linux/file.h> 11 + #include <linux/filelock.h> 11 12 #include <linux/fs.h> 12 13 #include <linux/fs_struct.h> 13 14 #include <linux/pagemap.h> ··· 10611 10610 #endif 10612 10611 .release = btrfs_release_file, 10613 10612 .fsync = btrfs_sync_file, 10613 + .setlease = generic_setlease, 10614 10614 }; 10615 10615 10616 10616 /*
-2
fs/ceph/dir.c
··· 2214 2214 .fsync = ceph_fsync, 2215 2215 .lock = ceph_lock, 2216 2216 .flock = ceph_flock, 2217 - .setlease = simple_nosetlease, 2218 2217 }; 2219 2218 2220 2219 const struct file_operations ceph_snapdir_fops = { ··· 2221 2222 .llseek = ceph_dir_llseek, 2222 2223 .open = ceph_open, 2223 2224 .release = ceph_release, 2224 - .setlease = simple_nosetlease, 2225 2225 }; 2226 2226 2227 2227 const struct inode_operations ceph_dir_iops = {
-1
fs/ceph/file.c
··· 3169 3169 .mmap_prepare = ceph_mmap_prepare, 3170 3170 .fsync = ceph_fsync, 3171 3171 .lock = ceph_lock, 3172 - .setlease = simple_nosetlease, 3173 3172 .flock = ceph_flock, 3174 3173 .splice_read = ceph_splice_read, 3175 3174 .splice_write = iter_file_splice_write,
+2
fs/cramfs/inode.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/fs.h> 18 18 #include <linux/file.h> 19 + #include <linux/filelock.h> 19 20 #include <linux/pagemap.h> 20 21 #include <linux/ramfs.h> 21 22 #include <linux/init.h> ··· 939 938 .llseek = generic_file_llseek, 940 939 .read = generic_read_dir, 941 940 .iterate_shared = cramfs_readdir, 941 + .setlease = generic_setlease, 942 942 }; 943 943 944 944 static const struct inode_operations cramfs_dir_inode_operations = {
+2
fs/efs/dir.c
··· 6 6 */ 7 7 8 8 #include <linux/buffer_head.h> 9 + #include <linux/filelock.h> 9 10 #include "efs.h" 10 11 11 12 static int efs_readdir(struct file *, struct dir_context *); ··· 15 14 .llseek = generic_file_llseek, 16 15 .read = generic_read_dir, 17 16 .iterate_shared = efs_readdir, 17 + .setlease = generic_setlease, 18 18 }; 19 19 20 20 const struct inode_operations efs_dir_inode_operations = {
+2
fs/erofs/data.c
··· 5 5 * Copyright (C) 2021, Alibaba Cloud 6 6 */ 7 7 #include "internal.h" 8 + #include <linux/filelock.h> 8 9 #include <linux/sched/mm.h> 9 10 #include <trace/events/erofs.h> 10 11 ··· 484 483 .mmap_prepare = erofs_file_mmap_prepare, 485 484 .get_unmapped_area = thp_get_unmapped_area, 486 485 .splice_read = filemap_splice_read, 486 + .setlease = generic_setlease, 487 487 };
+2
fs/erofs/dir.c
··· 5 5 * Copyright (C) 2022, Alibaba Cloud 6 6 */ 7 7 #include "internal.h" 8 + #include <linux/filelock.h> 8 9 9 10 static int erofs_fill_dentries(struct inode *dir, struct dir_context *ctx, 10 11 void *dentry_blk, struct erofs_dirent *de, ··· 128 127 #ifdef CONFIG_COMPAT 129 128 .compat_ioctl = erofs_compat_ioctl, 130 129 #endif 130 + .setlease = generic_setlease, 131 131 };
+2
fs/exfat/dir.c
··· 7 7 #include <linux/compat.h> 8 8 #include <linux/bio.h> 9 9 #include <linux/buffer_head.h> 10 + #include <linux/filelock.h> 10 11 11 12 #include "exfat_raw.h" 12 13 #include "exfat_fs.h" ··· 299 298 .compat_ioctl = exfat_compat_ioctl, 300 299 #endif 301 300 .fsync = exfat_file_fsync, 301 + .setlease = generic_setlease, 302 302 }; 303 303 304 304 int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu)
+2
fs/exfat/file.c
··· 12 12 #include <linux/security.h> 13 13 #include <linux/msdos_fs.h> 14 14 #include <linux/writeback.h> 15 + #include <linux/filelock.h> 15 16 16 17 #include "exfat_raw.h" 17 18 #include "exfat_fs.h" ··· 773 772 .fsync = exfat_file_fsync, 774 773 .splice_read = exfat_splice_read, 775 774 .splice_write = iter_file_splice_write, 775 + .setlease = generic_setlease, 776 776 }; 777 777 778 778 const struct inode_operations exfat_file_inode_operations = {
+2
fs/ext2/dir.c
··· 24 24 25 25 #include "ext2.h" 26 26 #include <linux/buffer_head.h> 27 + #include <linux/filelock.h> 27 28 #include <linux/pagemap.h> 28 29 #include <linux/swap.h> 29 30 #include <linux/iversion.h> ··· 735 734 .compat_ioctl = ext2_compat_ioctl, 736 735 #endif 737 736 .fsync = ext2_fsync, 737 + .setlease = generic_setlease, 738 738 };
+2
fs/ext2/file.c
··· 22 22 #include <linux/time.h> 23 23 #include <linux/pagemap.h> 24 24 #include <linux/dax.h> 25 + #include <linux/filelock.h> 25 26 #include <linux/quotaops.h> 26 27 #include <linux/iomap.h> 27 28 #include <linux/uio.h> ··· 326 325 .get_unmapped_area = thp_get_unmapped_area, 327 326 .splice_read = filemap_splice_read, 328 327 .splice_write = iter_file_splice_write, 328 + .setlease = generic_setlease, 329 329 }; 330 330 331 331 const struct inode_operations ext2_file_inode_operations = {
+2
fs/ext4/dir.c
··· 24 24 25 25 #include <linux/fs.h> 26 26 #include <linux/buffer_head.h> 27 + #include <linux/filelock.h> 27 28 #include <linux/slab.h> 28 29 #include <linux/iversion.h> 29 30 #include <linux/unicode.h> ··· 691 690 #endif 692 691 .fsync = ext4_sync_file, 693 692 .release = ext4_release_dir, 693 + .setlease = generic_setlease, 694 694 };
+2
fs/ext4/file.c
··· 25 25 #include <linux/mount.h> 26 26 #include <linux/path.h> 27 27 #include <linux/dax.h> 28 + #include <linux/filelock.h> 28 29 #include <linux/quotaops.h> 29 30 #include <linux/pagevec.h> 30 31 #include <linux/uio.h> ··· 981 980 .fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC | 982 981 FOP_DIO_PARALLEL_WRITE | 983 982 FOP_DONTCACHE, 983 + .setlease = generic_setlease, 984 984 }; 985 985 986 986 const struct inode_operations ext4_file_inode_operations = {
+2
fs/f2fs/dir.c
··· 8 8 #include <linux/unaligned.h> 9 9 #include <linux/fs.h> 10 10 #include <linux/f2fs_fs.h> 11 + #include <linux/filelock.h> 11 12 #include <linux/sched/signal.h> 12 13 #include <linux/unicode.h> 13 14 #include "f2fs.h" ··· 1137 1136 #ifdef CONFIG_COMPAT 1138 1137 .compat_ioctl = f2fs_compat_ioctl, 1139 1138 #endif 1139 + .setlease = generic_setlease, 1140 1140 };
+2
fs/f2fs/file.c
··· 11 11 #include <linux/writeback.h> 12 12 #include <linux/blkdev.h> 13 13 #include <linux/falloc.h> 14 + #include <linux/filelock.h> 14 15 #include <linux/types.h> 15 16 #include <linux/compat.h> 16 17 #include <linux/uaccess.h> ··· 5458 5457 .splice_write = iter_file_splice_write, 5459 5458 .fadvise = f2fs_file_fadvise, 5460 5459 .fop_flags = FOP_BUFFER_RASYNC, 5460 + .setlease = generic_setlease, 5461 5461 };
+2
fs/fat/dir.c
··· 16 16 17 17 #include <linux/slab.h> 18 18 #include <linux/compat.h> 19 + #include <linux/filelock.h> 19 20 #include <linux/uaccess.h> 20 21 #include <linux/iversion.h> 21 22 #include "fat.h" ··· 877 876 .compat_ioctl = fat_compat_dir_ioctl, 878 877 #endif 879 878 .fsync = fat_file_fsync, 879 + .setlease = generic_setlease, 880 880 }; 881 881 882 882 static int fat_get_short_entry(struct inode *dir, loff_t *pos,
+2
fs/fat/file.c
··· 13 13 #include <linux/mount.h> 14 14 #include <linux/blkdev.h> 15 15 #include <linux/backing-dev.h> 16 + #include <linux/filelock.h> 16 17 #include <linux/fsnotify.h> 17 18 #include <linux/security.h> 18 19 #include <linux/falloc.h> ··· 213 212 .splice_read = filemap_splice_read, 214 213 .splice_write = iter_file_splice_write, 215 214 .fallocate = fat_fallocate, 215 + .setlease = generic_setlease, 216 216 }; 217 217 218 218 static int fat_cont_expand(struct inode *inode, loff_t size)
+2
fs/freevxfs/vxfs_lookup.c
··· 8 8 * Veritas filesystem driver - lookup and other directory related code. 9 9 */ 10 10 #include <linux/fs.h> 11 + #include <linux/filelock.h> 11 12 #include <linux/time.h> 12 13 #include <linux/mm.h> 13 14 #include <linux/highmem.h> ··· 37 36 .llseek = generic_file_llseek, 38 37 .read = generic_read_dir, 39 38 .iterate_shared = vxfs_readdir, 39 + .setlease = generic_setlease, 40 40 }; 41 41 42 42
-1
fs/fuse/dir.c
··· 2429 2429 .fsync = fuse_dir_fsync, 2430 2430 .unlocked_ioctl = fuse_dir_ioctl, 2431 2431 .compat_ioctl = fuse_dir_compat_ioctl, 2432 - .setlease = simple_nosetlease, 2433 2432 }; 2434 2433 2435 2434 static const struct inode_operations fuse_common_inode_operations = {
+1
fs/fuse/file.c
··· 3177 3177 .poll = fuse_file_poll, 3178 3178 .fallocate = fuse_file_fallocate, 3179 3179 .copy_file_range = fuse_copy_file_range, 3180 + .setlease = generic_setlease, 3180 3181 }; 3181 3182 3182 3183 static const struct address_space_operations fuse_file_aops = {
+1 -2
fs/gfs2/file.c
··· 1593 1593 .flock = gfs2_flock, 1594 1594 .splice_read = copy_splice_read, 1595 1595 .splice_write = gfs2_file_splice_write, 1596 - .setlease = simple_nosetlease, 1597 1596 .fallocate = gfs2_fallocate, 1598 1597 .fop_flags = FOP_ASYNC_LOCK, 1599 1598 }; ··· 1607 1608 .lock = gfs2_lock, 1608 1609 .flock = gfs2_flock, 1609 1610 .llseek = default_llseek, 1610 - .setlease = simple_nosetlease, 1611 1611 .fop_flags = FOP_ASYNC_LOCK, 1612 1612 }; 1613 1613 ··· 1637 1639 .release = gfs2_release, 1638 1640 .fsync = gfs2_fsync, 1639 1641 .llseek = default_llseek, 1642 + .setlease = generic_setlease, 1640 1643 }; 1641 1644
+2
fs/isofs/dir.c
··· 12 12 * isofs directory handling functions 13 13 */ 14 14 #include <linux/gfp.h> 15 + #include <linux/filelock.h> 15 16 #include "isofs.h" 16 17 17 18 int isofs_name_translate(struct iso_directory_record *de, char *new, struct inode *inode) ··· 272 271 .llseek = generic_file_llseek, 273 272 .read = generic_read_dir, 274 273 .iterate_shared = isofs_readdir, 274 + .setlease = generic_setlease, 275 275 }; 276 276 277 277 /*
+2
fs/jffs2/dir.c
··· 15 15 #include <linux/kernel.h> 16 16 #include <linux/slab.h> 17 17 #include <linux/fs.h> 18 + #include <linux/filelock.h> 18 19 #include <linux/crc32.h> 19 20 #include <linux/jffs2.h> 20 21 #include "jffs2_fs_i.h" ··· 49 48 .unlocked_ioctl=jffs2_ioctl, 50 49 .fsync = jffs2_fsync, 51 50 .llseek = generic_file_llseek, 51 + .setlease = generic_setlease, 52 52 }; 53 53 54 54
+2
fs/jffs2/file.c
··· 14 14 15 15 #include <linux/kernel.h> 16 16 #include <linux/fs.h> 17 + #include <linux/filelock.h> 17 18 #include <linux/time.h> 18 19 #include <linux/pagemap.h> 19 20 #include <linux/highmem.h> ··· 61 60 .fsync = jffs2_fsync, 62 61 .splice_read = filemap_splice_read, 63 62 .splice_write = iter_file_splice_write, 63 + .setlease = generic_setlease, 64 64 }; 65 65 66 66 /* jffs2_file_inode_operations */
+2
fs/jfs/file.c
··· 6 6 7 7 #include <linux/mm.h> 8 8 #include <linux/fs.h> 9 + #include <linux/filelock.h> 9 10 #include <linux/posix_acl.h> 10 11 #include <linux/quotaops.h> 11 12 #include "jfs_incore.h" ··· 154 153 .release = jfs_release, 155 154 .unlocked_ioctl = jfs_ioctl, 156 155 .compat_ioctl = compat_ptr_ioctl, 156 + .setlease = generic_setlease, 157 157 };
+2
fs/jfs/namei.c
··· 5 5 */ 6 6 7 7 #include <linux/fs.h> 8 + #include <linux/filelock.h> 8 9 #include <linux/namei.h> 9 10 #include <linux/ctype.h> 10 11 #include <linux/quotaops.h> ··· 1546 1545 .unlocked_ioctl = jfs_ioctl, 1547 1546 .compat_ioctl = compat_ptr_ioctl, 1548 1547 .llseek = generic_file_llseek, 1548 + .setlease = generic_setlease, 1549 1549 }; 1550 1550 1551 1551 static int jfs_ci_hash(const struct dentry *dir, struct qstr *this)
+2 -18
fs/libfs.c
··· 6 6 7 7 #include <linux/blkdev.h> 8 8 #include <linux/export.h> 9 + #include <linux/filelock.h> 9 10 #include <linux/pagemap.h> 10 11 #include <linux/slab.h> 11 12 #include <linux/cred.h> ··· 571 570 .iterate_shared = offset_readdir, 572 571 .read = generic_read_dir, 573 572 .fsync = noop_fsync, 573 + .setlease = generic_setlease, 574 574 }; 575 575 576 576 struct dentry *find_next_child(struct dentry *parent, struct dentry *prev) ··· 1698 1696 return inode; 1699 1697 } 1700 1698 EXPORT_SYMBOL(alloc_anon_inode); 1701 - 1702 - /** 1703 - * simple_nosetlease - generic helper for prohibiting leases 1704 - * @filp: file pointer 1705 - * @arg: type of lease to obtain 1706 - * @flp: new lease supplied for insertion 1707 - * @priv: private data for lm_setup operation 1708 - * 1709 - * Generic helper for filesystems that do not wish to allow leases to be set. 1710 - * All arguments are ignored and it just returns -EINVAL. 1711 - */ 1712 - int 1713 - simple_nosetlease(struct file *filp, int arg, struct file_lease **flp, 1714 - void **priv) 1715 - { 1716 - return -EINVAL; 1717 - } 1718 - EXPORT_SYMBOL(simple_nosetlease); 1719 1699 1720 1700 /** 1721 1701 * simple_get_link - generic helper to get the target of "fast" symlinks
+1 -2
fs/locks.c
··· 2019 2019 setlease_notifier(arg, *lease); 2020 2020 if (filp->f_op->setlease) 2021 2021 return filp->f_op->setlease(filp, arg, lease, priv); 2022 - else 2023 - return generic_setlease(filp, arg, lease, priv); 2022 + return -EINVAL; 2024 2023 } 2025 2024 EXPORT_SYMBOL_GPL(kernel_setlease); 2026 2025
-1
fs/nfs/dir.c
··· 66 66 .open = nfs_opendir, 67 67 .release = nfs_closedir, 68 68 .fsync = nfs_fsync_dir, 69 - .setlease = simple_nosetlease, 70 69 }; 71 70 72 71 const struct address_space_operations nfs_dir_aops = {
-1
fs/nfs/file.c
··· 963 963 .splice_read = nfs_file_splice_read, 964 964 .splice_write = iter_file_splice_write, 965 965 .check_flags = nfs_check_flags, 966 - .setlease = simple_nosetlease, 967 966 .fop_flags = FOP_DONTCACHE, 968 967 }; 969 968 EXPORT_SYMBOL_GPL(nfs_file_operations);
+2 -1
fs/nilfs2/dir.c
··· 30 30 */ 31 31 32 32 #include <linux/pagemap.h> 33 + #include <linux/filelock.h> 33 34 #include "nilfs.h" 34 35 #include "page.h" 35 36 ··· 662 661 .compat_ioctl = nilfs_compat_ioctl, 663 662 #endif /* CONFIG_COMPAT */ 664 663 .fsync = nilfs_sync_file, 665 - 664 + .setlease = generic_setlease, 666 665 };
+2
fs/nilfs2/file.c
··· 8 8 */ 9 9 10 10 #include <linux/fs.h> 11 + #include <linux/filelock.h> 11 12 #include <linux/mm.h> 12 13 #include <linux/writeback.h> 13 14 #include "nilfs.h" ··· 151 150 .fsync = nilfs_sync_file, 152 151 .splice_read = filemap_splice_read, 153 152 .splice_write = iter_file_splice_write, 153 + .setlease = generic_setlease, 154 154 }; 155 155 156 156 const struct inode_operations nilfs_file_inode_operations = {
+3
fs/ntfs3/dir.c
··· 8 8 */ 9 9 10 10 #include <linux/fs.h> 11 + #include <linux/filelock.h> 11 12 #include <linux/nls.h> 12 13 13 14 #include "debug.h" ··· 631 630 #ifdef CONFIG_COMPAT 632 631 .compat_ioctl = ntfs_compat_ioctl, 633 632 #endif 633 + .setlease = generic_setlease, 634 634 }; 635 635 636 636 #if IS_ENABLED(CONFIG_NTFS_FS) ··· 640 638 .read = generic_read_dir, 641 639 .iterate_shared = ntfs_readdir, 642 640 .open = ntfs_file_open, 641 + .setlease = generic_setlease, 643 642 }; 644 643 #endif 645 644 // clang-format on
+3
fs/ntfs3/file.c
··· 14 14 #include <linux/falloc.h> 15 15 #include <linux/fiemap.h> 16 16 #include <linux/fileattr.h> 17 + #include <linux/filelock.h> 17 18 18 19 #include "debug.h" 19 20 #include "ntfs.h" ··· 1478 1477 .fsync = ntfs_file_fsync, 1479 1478 .fallocate = ntfs_fallocate, 1480 1479 .release = ntfs_file_release, 1480 + .setlease = generic_setlease, 1481 1481 }; 1482 1482 1483 1483 #if IS_ENABLED(CONFIG_NTFS_FS) ··· 1488 1486 .splice_read = ntfs_file_splice_read, 1489 1487 .open = ntfs_file_open, 1490 1488 .release = ntfs_file_release, 1489 + .setlease = generic_setlease, 1491 1490 }; 1492 1491 #endif 1493 1492 // clang-format on
+5
fs/ocfs2/file.c
··· 19 19 #include <linux/mount.h> 20 20 #include <linux/writeback.h> 21 21 #include <linux/falloc.h> 22 + #include <linux/filelock.h> 22 23 #include <linux/quotaops.h> 23 24 #include <linux/blkdev.h> 24 25 #include <linux/backing-dev.h> ··· 2824 2823 .fallocate = ocfs2_fallocate, 2825 2824 .remap_file_range = ocfs2_remap_file_range, 2826 2825 .fop_flags = FOP_ASYNC_LOCK, 2826 + .setlease = generic_setlease, 2827 2827 }; 2828 2828 2829 2829 WRAP_DIR_ITER(ocfs2_readdir) // FIXME! ··· 2842 2840 .lock = ocfs2_lock, 2843 2841 .flock = ocfs2_flock, 2844 2842 .fop_flags = FOP_ASYNC_LOCK, 2843 + .setlease = generic_setlease, 2845 2844 }; 2846 2845 2847 2846 /* ··· 2874 2871 .splice_write = iter_file_splice_write, 2875 2872 .fallocate = ocfs2_fallocate, 2876 2873 .remap_file_range = ocfs2_remap_file_range, 2874 + .setlease = generic_setlease, 2877 2875 }; 2878 2876 2879 2877 const struct file_operations ocfs2_dops_no_plocks = { ··· 2889 2885 .compat_ioctl = ocfs2_compat_ioctl, 2890 2886 #endif 2891 2887 .flock = ocfs2_flock, 2888 + .setlease = generic_setlease, 2892 2889 };
+3 -1
fs/orangefs/dir.c
··· 3 3 * Copyright 2017 Omnibond Systems, L.L.C. 4 4 */ 5 5 6 + #include <linux/filelock.h> 6 7 #include "protocol.h" 7 8 #include "orangefs-kernel.h" 8 9 #include "orangefs-bufmap.h" ··· 393 392 .read = generic_read_dir, 394 393 .iterate_shared = orangefs_dir_iterate, 395 394 .open = orangefs_dir_open, 396 - .release = orangefs_dir_release 395 + .release = orangefs_dir_release, 396 + .setlease = generic_setlease, 397 397 };
+1
fs/orangefs/file.c
··· 583 583 .flush = orangefs_flush, 584 584 .release = orangefs_file_release, 585 585 .fsync = orangefs_fsync, 586 + .setlease = generic_setlease, 586 587 };
+2
fs/overlayfs/file.c
··· 5 5 6 6 #include <linux/cred.h> 7 7 #include <linux/file.h> 8 + #include <linux/filelock.h> 8 9 #include <linux/mount.h> 9 10 #include <linux/xattr.h> 10 11 #include <linux/uio.h> ··· 648 647 649 648 .copy_file_range = ovl_copy_file_range, 650 649 .remap_file_range = ovl_remap_file_range, 650 + .setlease = generic_setlease, 651 651 };
+2
fs/overlayfs/readdir.c
··· 8 8 #include <linux/slab.h> 9 9 #include <linux/namei.h> 10 10 #include <linux/file.h> 11 + #include <linux/filelock.h> 11 12 #include <linux/xattr.h> 12 13 #include <linux/rbtree.h> 13 14 #include <linux/security.h> ··· 1071 1070 .llseek = ovl_dir_llseek, 1072 1071 .fsync = ovl_dir_fsync, 1073 1072 .release = ovl_dir_release, 1073 + .setlease = generic_setlease, 1074 1074 }; 1075 1075 1076 1076 int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list)
+2
fs/qnx4/dir.c
··· 13 13 */ 14 14 15 15 #include <linux/buffer_head.h> 16 + #include <linux/filelock.h> 16 17 #include "qnx4.h" 17 18 18 19 static int qnx4_readdir(struct file *file, struct dir_context *ctx) ··· 72 71 .read = generic_read_dir, 73 72 .iterate_shared = qnx4_readdir, 74 73 .fsync = generic_file_fsync, 74 + .setlease = generic_setlease, 75 75 }; 76 76 77 77 const struct inode_operations qnx4_dir_inode_operations =
+2
fs/qnx6/dir.c
··· 11 11 * 12 12 */ 13 13 14 + #include <linux/filelock.h> 14 15 #include "qnx6.h" 15 16 16 17 static unsigned qnx6_lfile_checksum(char *name, unsigned size) ··· 276 275 .read = generic_read_dir, 277 276 .iterate_shared = qnx6_readdir, 278 277 .fsync = generic_file_fsync, 278 + .setlease = generic_setlease, 279 279 }; 280 280 281 281 const struct inode_operations qnx6_dir_inode_operations = {
+2
fs/read_write.c
··· 20 20 #include <linux/compat.h> 21 21 #include <linux/mount.h> 22 22 #include <linux/fs.h> 23 + #include <linux/filelock.h> 23 24 #include "internal.h" 24 25 25 26 #include <linux/uaccess.h> ··· 31 30 .read_iter = generic_file_read_iter, 32 31 .mmap_prepare = generic_file_readonly_mmap_prepare, 33 32 .splice_read = filemap_splice_read, 33 + .setlease = generic_setlease, 34 34 }; 35 35 36 36 EXPORT_SYMBOL(generic_ro_fops);
-1
fs/smb/client/cifsfs.c
··· 1709 1709 .remap_file_range = cifs_remap_file_range, 1710 1710 .llseek = generic_file_llseek, 1711 1711 .fsync = cifs_dir_fsync, 1712 - .setlease = simple_nosetlease, 1713 1712 }; 1714 1713 1715 1714 static void
+2
fs/squashfs/dir.c
··· 15 15 */ 16 16 17 17 #include <linux/fs.h> 18 + #include <linux/filelock.h> 18 19 #include <linux/vfs.h> 19 20 #include <linux/slab.h> 20 21 ··· 221 220 .read = generic_read_dir, 222 221 .iterate_shared = squashfs_readdir, 223 222 .llseek = generic_file_llseek, 223 + .setlease = generic_setlease, 224 224 };
+3 -1
fs/squashfs/file.c
··· 28 28 */ 29 29 30 30 #include <linux/fs.h> 31 + #include <linux/filelock.h> 31 32 #include <linux/vfs.h> 32 33 #include <linux/kernel.h> 33 34 #include <linux/slab.h> ··· 776 775 .llseek = squashfs_llseek, 777 776 .read_iter = generic_file_read_iter, 778 777 .mmap_prepare = generic_file_readonly_mmap_prepare, 779 - .splice_read = filemap_splice_read 778 + .splice_read = filemap_splice_read, 779 + .setlease = generic_setlease, 780 780 };
+2
fs/udf/dir.c
··· 24 24 25 25 #include <linux/string.h> 26 26 #include <linux/errno.h> 27 + #include <linux/filelock.h> 27 28 #include <linux/mm.h> 28 29 #include <linux/slab.h> 29 30 #include <linux/bio.h> ··· 158 157 .iterate_shared = udf_readdir, 159 158 .unlocked_ioctl = udf_ioctl, 160 159 .fsync = generic_file_fsync, 160 + .setlease = generic_setlease, 161 161 };
+2
fs/udf/file.c
··· 28 28 #include <linux/string.h> /* memset */ 29 29 #include <linux/capability.h> 30 30 #include <linux/errno.h> 31 + #include <linux/filelock.h> 31 32 #include <linux/pagemap.h> 32 33 #include <linux/uio.h> 33 34 ··· 209 208 .splice_read = filemap_splice_read, 210 209 .splice_write = iter_file_splice_write, 211 210 .llseek = generic_file_llseek, 211 + .setlease = generic_setlease, 212 212 }; 213 213 214 214 static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
+2
fs/ufs/dir.c
··· 19 19 20 20 #include <linux/time.h> 21 21 #include <linux/fs.h> 22 + #include <linux/filelock.h> 22 23 #include <linux/swap.h> 23 24 #include <linux/iversion.h> 24 25 ··· 654 653 .iterate_shared = ufs_readdir, 655 654 .fsync = generic_file_fsync, 656 655 .llseek = ufs_dir_llseek, 656 + .setlease = generic_setlease, 657 657 };
+2
fs/ufs/file.c
··· 25 25 */ 26 26 27 27 #include <linux/fs.h> 28 + #include <linux/filelock.h> 28 29 29 30 #include "ufs_fs.h" 30 31 #include "ufs.h" ··· 44 43 .fsync = generic_file_fsync, 45 44 .splice_read = filemap_splice_read, 46 45 .splice_write = iter_file_splice_write, 46 + .setlease = generic_setlease, 47 47 };
-1
fs/vboxsf/dir.c
··· 186 186 .release = vboxsf_dir_release, 187 187 .read = generic_read_dir, 188 188 .llseek = generic_file_llseek, 189 - .setlease = simple_nosetlease, 190 189 }; 191 190 192 191 /*
-1
fs/vboxsf/file.c
··· 218 218 .release = vboxsf_file_release, 219 219 .fsync = noop_fsync, 220 220 .splice_read = filemap_splice_read, 221 - .setlease = simple_nosetlease, 222 221 }; 223 222 224 223 const struct inode_operations vboxsf_reg_iops = {
+3
fs/xfs/xfs_file.c
··· 36 36 #include <linux/mman.h> 37 37 #include <linux/fadvise.h> 38 38 #include <linux/mount.h> 39 + #include <linux/filelock.h> 39 40 40 41 static const struct vm_operations_struct xfs_file_vm_ops; 41 42 ··· 2008 2007 .fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC | 2009 2008 FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE | 2010 2009 FOP_DONTCACHE, 2010 + .setlease = generic_setlease, 2011 2011 }; 2012 2012 2013 2013 const struct file_operations xfs_dir_file_operations = { ··· 2021 2019 .compat_ioctl = xfs_file_compat_ioctl, 2022 2020 #endif 2023 2021 .fsync = xfs_dir_fsync, 2022 + .setlease = generic_setlease, 2024 2023 };
-1
include/linux/fs.h
··· 3227 3227 extern struct inode *alloc_anon_inode(struct super_block *); 3228 3228 struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *name, 3229 3229 const struct inode *context_inode); 3230 - extern int simple_nosetlease(struct file *, int, struct file_lease **, void **); 3231 3230 3232 3231 extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); 3233 3232 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
+2
mm/shmem.c
··· 29 29 #include <linux/pagemap.h> 30 30 #include <linux/file.h> 31 31 #include <linux/fileattr.h> 32 + #include <linux/filelock.h> 32 33 #include <linux/mm.h> 33 34 #include <linux/random.h> 34 35 #include <linux/sched/signal.h> ··· 5248 5247 .splice_read = shmem_file_splice_read, 5249 5248 .splice_write = iter_file_splice_write, 5250 5249 .fallocate = shmem_fallocate, 5250 + .setlease = generic_setlease, 5251 5251 #endif 5252 5252 }; 5253 5253