]> Git Repo - J-linux.git/commitdiff
Merge tag 'xfs-6.10-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
authorLinus Torvalds <[email protected]>
Mon, 20 May 2024 19:55:12 +0000 (12:55 -0700)
committerLinus Torvalds <[email protected]>
Mon, 20 May 2024 19:55:12 +0000 (12:55 -0700)
Pull xfs updates from Chandan Babu:
 "Online repair feature continues to be expanded. Also, we now support
  delayed allocation for realtime devices which have an extent size that
  is equal to filesystem's block size.

  New code:

   - Introduce Parent Pointer extended attribute for inodes

   - Bring back delalloc support for realtime devices which have an
     extent size that is equal to filesystem's block size

   - Improve performance of log incompat feature handling

  Online Repair:

   - Implement atomic file content exchanges i.e. exchange ranges of
     bytes between two files atomically

   - Create temporary files to repair file-based metadata. This uses
     atomic file content exchange facility to swap file fork mappings
     between the temporary file and the metadata inode

   - Allow callers of directory/xattr code to set an explicit owner
     number to be written into the header fields of any new blocks that
     are created. This is required to avoid walking every block of the
     new structure and modify their ownership during online repair

   - Repair more data structures:
       - Extended attributes
       - Inode unlinked state
       - Directories
       - Symbolic links
       - AGI's unlinked inode list
       - Parent pointers

   - Move Orphan files to lost and found directory

   - Fixes for Inode repair functionality

   - Introduce a new sub-AG FITRIM implementation to reduce the duration
     for which the AGF lock is held

   - Updates for the design documentation

   - Use Parent Pointers to assist in checking directories, parent
     pointers, extended attributes, and link counts

  Fixes:

   - Prevent userspace from reading invalid file data due to incorrect.
     updation of file size when performing a non-atomic clone operation

   - Minor fixes to online repair

   - Fix confusing return values from xfs_bmapi_write()

   - Fix an out of bounds access due to incorrect h_size during log
     recovery

   - Defer upgrading the extent counters in xfs_reflink_end_cow_extent()
     until we know we are going to modify the extent mapping

   - Remove racy access to if_bytes check in
     xfs_reflink_end_cow_extent()

   - Fix sparse warnings

  Cleanups:

   - Hold inode locks on all files involved in a rename until the
     completion of the operation. This is in preparation for the parent
     pointers patchset where parent pointers are applied in a separate
     chained update from the actual directory update

   - Compile out v4 support when disabled

   - Cleanup xfs_extent_busy_clear()

   - Remove unused flags and fields from struct xfs_da_args

   - Remove definitions of unused functions

   - Improve extended attribute validation

   - Add higher level directory operations helpers to remove duplication
     of code

   - Cleanup quota (un)reservation interfaces"

* tag 'xfs-6.10-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (221 commits)
  xfs: simplify iext overflow checking and upgrade
  xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent
  xfs: upgrade the extent counters in xfs_reflink_end_cow_extent later
  xfs: xfs_quota_unreserve_blkres can't fail
  xfs: consolidate the xfs_quota_reserve_blkres definitions
  xfs: clean up buffer allocation in xlog_do_recovery_pass
  xfs: fix log recovery buffer allocation for the legacy h_size fixup
  xfs: widen flags argument to the xfs_iflags_* helpers
  xfs: minor cleanups of xfs_attr3_rmt_blocks
  xfs: create a helper to compute the blockcount of a max sized remote value
  xfs: turn XFS_ATTR3_RMT_BUF_SPACE into a function
  xfs: use unsigned ints for non-negative quantities in xfs_attr_remote.c
  xfs: do not allocate the entire delalloc extent in xfs_bmapi_write
  xfs: fix xfs_bmap_add_extent_delay_real for partial conversions
  xfs: remove the xfs_iext_peek_prev_extent call in xfs_bmapi_allocate
  xfs: pass the actual offset and len to allocate to xfs_bmapi_allocate
  xfs: don't open code XFS_FILBLKS_MIN in xfs_bmapi_write
  xfs: lift a xfs_valid_startblock into xfs_bmapi_allocate
  xfs: remove the unusued tmp_logflags variable in xfs_bmapi_allocate
  xfs: fix error returns from xfs_bmapi_write
  ...

1  2 
fs/read_write.c
fs/xfs/Makefile
fs/xfs/xfs_file.c
include/linux/fs.h

diff --combined fs/read_write.c
index 2115d1f40bd5c6147b0ba4ab910fc61459e07119,85c096f2c0d06e5261f6a023fa259aa4b0ef84a1..0f862c0ee1d4a3cb9fd399662f6c3afd9504f64e
@@@ -1667,6 -1667,7 +1667,7 @@@ int generic_write_check_limits(struct f
  
        return 0;
  }
+ EXPORT_SYMBOL_GPL(generic_write_check_limits);
  
  /* Like generic_write_checks(), but takes size of write instead of iter. */
  int generic_write_checks_count(struct kiocb *iocb, loff_t *count)
  
        if ((iocb->ki_flags & IOCB_NOWAIT) &&
            !((iocb->ki_flags & IOCB_DIRECT) ||
 -            (file->f_mode & FMODE_BUF_WASYNC)))
 +            (file->f_op->fop_flags & FOP_BUFFER_WASYNC)))
                return -EINVAL;
  
        return generic_write_check_limits(iocb->ki_filp, iocb->ki_pos, count);
diff --combined fs/xfs/Makefile
index c5a35e32adf002a5ef977e3028e651a361020bdb,d1ce1213797be49cee6f3d15db2352c5333d1f77..c50447548d6550fb88bb6a25316705419f55ce96
@@@ -4,8 -4,8 +4,8 @@@
  # All Rights Reserved.
  #
  
 -ccflags-y += -I $(srctree)/$(src)             # needed for trace events
 -ccflags-y += -I $(srctree)/$(src)/libxfs
 +ccflags-y += -I $(src)                # needed for trace events
 +ccflags-y += -I $(src)/libxfs
  
  obj-$(CONFIG_XFS_FS)          += xfs.o
  
@@@ -34,6 -34,7 +34,7 @@@ xfs-y                         += $(addprefix libxfs/, 
                                   xfs_dir2_node.o \
                                   xfs_dir2_sf.o \
                                   xfs_dquot_buf.o \
+                                  xfs_exchmaps.o \
                                   xfs_ialloc.o \
                                   xfs_ialloc_btree.o \
                                   xfs_iext_tree.o \
@@@ -41,6 -42,7 +42,7 @@@
                                   xfs_inode_buf.o \
                                   xfs_log_rlimit.o \
                                   xfs_ag_resv.o \
+                                  xfs_parent.o \
                                   xfs_rmap.o \
                                   xfs_rmap_btree.o \
                                   xfs_refcount.o \
@@@ -49,6 -51,7 +51,7 @@@
                                   xfs_symlink_remote.o \
                                   xfs_trans_inode.o \
                                   xfs_trans_resv.o \
+                                  xfs_trans_space.o \
                                   xfs_types.o \
                                   )
  # xfs_rtbitmap is shared with libxfs
@@@ -67,6 -70,7 +70,7 @@@ xfs-y                         += xfs_aops.o 
                                   xfs_dir2_readdir.o \
                                   xfs_discard.o \
                                   xfs_error.o \
+                                  xfs_exchrange.o \
                                   xfs_export.o \
                                   xfs_extent_busy.o \
                                   xfs_file.o \
@@@ -74,6 -78,7 +78,7 @@@
                                   xfs_fsmap.o \
                                   xfs_fsops.o \
                                   xfs_globals.o \
+                                  xfs_handle.o \
                                   xfs_health.o \
                                   xfs_icache.o \
                                   xfs_ioctl.o \
@@@ -101,6 -106,7 +106,7 @@@ xfs-y                              += xfs_log.o 
                                   xfs_buf_item.o \
                                   xfs_buf_item_recover.o \
                                   xfs_dquot_item_recover.o \
+                                  xfs_exchmaps_item.o \
                                   xfs_extfree_item.o \
                                   xfs_attr_item.o \
                                   xfs_icreate_item.o \
@@@ -157,11 -163,13 +163,13 @@@ xfs-y                           += $(addprefix scrub/, 
                                   common.o \
                                   dabtree.o \
                                   dir.o \
+                                  dirtree.o \
                                   fscounters.o \
                                   health.o \
                                   ialloc.o \
                                   inode.o \
                                   iscan.o \
+                                  listxattr.o \
                                   nlinks.o \
                                   parent.o \
                                   readdir.o \
                                   scrub.o \
                                   symlink.o \
                                   xfarray.o \
+                                  xfblob.o \
                                   xfile.o \
                                   )
  
@@@ -191,23 -200,32 +200,32 @@@ ifeq ($(CONFIG_XFS_ONLINE_REPAIR),y
  xfs-y                         += $(addprefix scrub/, \
                                   agheader_repair.o \
                                   alloc_repair.o \
+                                  attr_repair.o \
                                   bmap_repair.o \
                                   cow_repair.o \
+                                  dir_repair.o \
+                                  dirtree_repair.o \
+                                  findparent.o \
                                   fscounters_repair.o \
                                   ialloc_repair.o \
                                   inode_repair.o \
                                   newbt.o \
                                   nlinks_repair.o \
+                                  orphanage.o \
+                                  parent_repair.o \
                                   rcbag_btree.o \
                                   rcbag.o \
                                   reap.o \
                                   refcount_repair.o \
                                   repair.o \
                                   rmap_repair.o \
+                                  symlink_repair.o \
+                                  tempfile.o \
                                   )
  
  xfs-$(CONFIG_XFS_RT)          += $(addprefix scrub/, \
                                   rtbitmap_repair.o \
+                                  rtsummary_repair.o \
                                   )
  
  xfs-$(CONFIG_XFS_QUOTA)               += $(addprefix scrub/, \
diff --combined fs/xfs/xfs_file.c
index 2ce302b4885f53b9e69d21a63f8897e4c7e4b022,d1d4158441bd96f2326b9e302253a8b288696066..b240ea5241dc9d3e9782d181c965078771362592
@@@ -24,6 -24,7 +24,7 @@@
  #include "xfs_pnfs.h"
  #include "xfs_iomap.h"
  #include "xfs_reflink.h"
+ #include "xfs_file.h"
  
  #include <linux/dax.h>
  #include <linux/falloc.h>
@@@ -38,33 -39,19 +39,19 @@@ static const struct vm_operations_struc
   * Decide if the given file range is aligned to the size of the fundamental
   * allocation unit for the file.
   */
static bool
+ bool
  xfs_is_falloc_aligned(
        struct xfs_inode        *ip,
        loff_t                  pos,
        long long int           len)
  {
-       struct xfs_mount        *mp = ip->i_mount;
-       uint64_t                mask;
-       if (XFS_IS_REALTIME_INODE(ip)) {
-               if (!is_power_of_2(mp->m_sb.sb_rextsize)) {
-                       u64     rextbytes;
-                       u32     mod;
-                       rextbytes = XFS_FSB_TO_B(mp, mp->m_sb.sb_rextsize);
-                       div_u64_rem(pos, rextbytes, &mod);
-                       if (mod)
-                               return false;
-                       div_u64_rem(len, rextbytes, &mod);
-                       return mod == 0;
-               }
-               mask = XFS_FSB_TO_B(mp, mp->m_sb.sb_rextsize) - 1;
-       } else {
-               mask = mp->m_sb.sb_blocksize - 1;
-       }
+       unsigned int            alloc_unit = xfs_inode_alloc_unitsize(ip);
+       if (!is_power_of_2(alloc_unit))
+               return isaligned_64(pos, alloc_unit) &&
+                      isaligned_64(len, alloc_unit);
  
-       return !((pos | len) & mask);
+       return !((pos | len) & (alloc_unit - 1));
  }
  
  /*
@@@ -861,67 -848,6 +848,6 @@@ xfs_file_write_iter
        return xfs_file_buffered_write(iocb, from);
  }
  
- static void
- xfs_wait_dax_page(
-       struct inode            *inode)
- {
-       struct xfs_inode        *ip = XFS_I(inode);
-       xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
-       schedule();
-       xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
- }
- int
- xfs_break_dax_layouts(
-       struct inode            *inode,
-       bool                    *retry)
- {
-       struct page             *page;
-       xfs_assert_ilocked(XFS_I(inode), XFS_MMAPLOCK_EXCL);
-       page = dax_layout_busy_page(inode->i_mapping);
-       if (!page)
-               return 0;
-       *retry = true;
-       return ___wait_var_event(&page->_refcount,
-                       atomic_read(&page->_refcount) == 1, TASK_INTERRUPTIBLE,
-                       0, 0, xfs_wait_dax_page(inode));
- }
- int
- xfs_break_layouts(
-       struct inode            *inode,
-       uint                    *iolock,
-       enum layout_break_reason reason)
- {
-       bool                    retry;
-       int                     error;
-       xfs_assert_ilocked(XFS_I(inode), XFS_IOLOCK_SHARED | XFS_IOLOCK_EXCL);
-       do {
-               retry = false;
-               switch (reason) {
-               case BREAK_UNMAP:
-                       error = xfs_break_dax_layouts(inode, &retry);
-                       if (error || retry)
-                               break;
-                       fallthrough;
-               case BREAK_WRITE:
-                       error = xfs_break_leased_layouts(inode, iolock, &retry);
-                       break;
-               default:
-                       WARN_ON_ONCE(1);
-                       error = -EINVAL;
-               }
-       } while (error == 0 && retry);
-       return error;
- }
  /* Does this file, inode, or mount want synchronous writes? */
  static inline bool xfs_file_sync_writes(struct file *filp)
  {
@@@ -1230,7 -1156,8 +1156,7 @@@ xfs_file_open
  {
        if (xfs_is_shutdown(XFS_M(inode->i_sb)))
                return -EIO;
 -      file->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC | FMODE_BUF_WASYNC |
 -                      FMODE_DIO_PARALLEL_WRITE | FMODE_CAN_ODIRECT;
 +      file->f_mode |= FMODE_NOWAIT | FMODE_CAN_ODIRECT;
        return generic_file_open(inode, file);
  }
  
@@@ -1243,9 -1170,7 +1169,9 @@@ xfs_dir_open
        unsigned int    mode;
        int             error;
  
 -      error = xfs_file_open(inode, file);
 +      if (xfs_is_shutdown(ip->i_mount))
 +              return -EIO;
 +      error = generic_file_open(inode, file);
        if (error)
                return error;
  
@@@ -1491,6 -1416,7 +1417,6 @@@ const struct file_operations xfs_file_o
        .compat_ioctl   = xfs_file_compat_ioctl,
  #endif
        .mmap           = xfs_file_mmap,
 -      .mmap_supported_flags = MAP_SYNC,
        .open           = xfs_file_open,
        .release        = xfs_file_release,
        .fsync          = xfs_file_fsync,
        .fallocate      = xfs_file_fallocate,
        .fadvise        = xfs_file_fadvise,
        .remap_file_range = xfs_file_remap_range,
 +      .fop_flags      = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
 +                        FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE,
  };
  
  const struct file_operations xfs_dir_file_operations = {
diff --combined include/linux/fs.h
index f1cc6d39b61fe606959eed000a54e1d1bd6131ba,0835faeebe7b3853a2e4125f35e269b3b48c1141..3899a7da32f86f61b0a321b8050142ed9b4ab9e8
@@@ -73,8 -73,6 +73,8 @@@ struct fscrypt_inode_info
  struct fscrypt_operations;
  struct fsverity_info;
  struct fsverity_operations;
 +struct fsnotify_mark_connector;
 +struct fsnotify_sb_info;
  struct fs_context;
  struct fs_parameter_spec;
  struct fileattr;
@@@ -112,26 -110,23 +112,26 @@@ typedef int (dio_iodone_t)(struct kioc
   */
  
  /* file is open for reading */
 -#define FMODE_READ            ((__force fmode_t)0x1)
 +#define FMODE_READ            ((__force fmode_t)(1 << 0))
  /* file is open for writing */
 -#define FMODE_WRITE           ((__force fmode_t)0x2)
 +#define FMODE_WRITE           ((__force fmode_t)(1 << 1))
  /* file is seekable */
 -#define FMODE_LSEEK           ((__force fmode_t)0x4)
 +#define FMODE_LSEEK           ((__force fmode_t)(1 << 2))
  /* file can be accessed using pread */
 -#define FMODE_PREAD           ((__force fmode_t)0x8)
 +#define FMODE_PREAD           ((__force fmode_t)(1 << 3))
  /* file can be accessed using pwrite */
 -#define FMODE_PWRITE          ((__force fmode_t)0x10)
 +#define FMODE_PWRITE          ((__force fmode_t)(1 << 4))
  /* File is opened for execution with sys_execve / sys_uselib */
 -#define FMODE_EXEC            ((__force fmode_t)0x20)
 +#define FMODE_EXEC            ((__force fmode_t)(1 << 5))
  /* File writes are restricted (block device specific) */
 -#define FMODE_WRITE_RESTRICTED  ((__force fmode_t)0x40)
 +#define FMODE_WRITE_RESTRICTED        ((__force fmode_t)(1 << 6))
 +
 +/* FMODE_* bits 7 to 8 */
 +
  /* 32bit hashes as llseek() offset (for directories) */
 -#define FMODE_32BITHASH         ((__force fmode_t)0x200)
 +#define FMODE_32BITHASH         ((__force fmode_t)(1 << 9))
  /* 64bit hashes as llseek() offset (for directories) */
 -#define FMODE_64BITHASH         ((__force fmode_t)0x400)
 +#define FMODE_64BITHASH         ((__force fmode_t)(1 << 10))
  
  /*
   * Don't update ctime and mtime.
   * Currently a special hack for the XFS open_by_handle ioctl, but we'll
   * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
   */
 -#define FMODE_NOCMTIME                ((__force fmode_t)0x800)
 +#define FMODE_NOCMTIME                ((__force fmode_t)(1 << 11))
  
  /* Expect random access pattern */
 -#define FMODE_RANDOM          ((__force fmode_t)0x1000)
 +#define FMODE_RANDOM          ((__force fmode_t)(1 << 12))
  
  /* File is huge (eg. /dev/mem): treat loff_t as unsigned */
 -#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
 +#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)(1 << 13))
  
  /* File is opened with O_PATH; almost nothing can be done with it */
 -#define FMODE_PATH            ((__force fmode_t)0x4000)
 +#define FMODE_PATH            ((__force fmode_t)(1 << 14))
  
  /* File needs atomic accesses to f_pos */
 -#define FMODE_ATOMIC_POS      ((__force fmode_t)0x8000)
 +#define FMODE_ATOMIC_POS      ((__force fmode_t)(1 << 15))
  /* Write access to underlying fs */
 -#define FMODE_WRITER          ((__force fmode_t)0x10000)
 +#define FMODE_WRITER          ((__force fmode_t)(1 << 16))
  /* Has read method(s) */
 -#define FMODE_CAN_READ          ((__force fmode_t)0x20000)
 +#define FMODE_CAN_READ          ((__force fmode_t)(1 << 17))
  /* Has write method(s) */
 -#define FMODE_CAN_WRITE         ((__force fmode_t)0x40000)
 +#define FMODE_CAN_WRITE         ((__force fmode_t)(1 << 18))
  
 -#define FMODE_OPENED          ((__force fmode_t)0x80000)
 -#define FMODE_CREATED         ((__force fmode_t)0x100000)
 +#define FMODE_OPENED          ((__force fmode_t)(1 << 19))
 +#define FMODE_CREATED         ((__force fmode_t)(1 << 20))
  
  /* File is stream-like */
 -#define FMODE_STREAM          ((__force fmode_t)0x200000)
 +#define FMODE_STREAM          ((__force fmode_t)(1 << 21))
  
  /* File supports DIRECT IO */
 -#define       FMODE_CAN_ODIRECT       ((__force fmode_t)0x400000)
 +#define       FMODE_CAN_ODIRECT       ((__force fmode_t)(1 << 22))
  
 -#define       FMODE_NOREUSE           ((__force fmode_t)0x800000)
 +#define       FMODE_NOREUSE           ((__force fmode_t)(1 << 23))
  
 -/* File supports non-exclusive O_DIRECT writes from multiple threads */
 -#define FMODE_DIO_PARALLEL_WRITE      ((__force fmode_t)0x1000000)
 +/* FMODE_* bit 24 */
  
  /* File is embedded in backing_file object */
 -#define FMODE_BACKING         ((__force fmode_t)0x2000000)
 +#define FMODE_BACKING         ((__force fmode_t)(1 << 25))
  
  /* File was opened by fanotify and shouldn't generate fanotify events */
 -#define FMODE_NONOTIFY                ((__force fmode_t)0x4000000)
 +#define FMODE_NONOTIFY                ((__force fmode_t)(1 << 26))
  
  /* File is capable of returning -EAGAIN if I/O will block */
 -#define FMODE_NOWAIT          ((__force fmode_t)0x8000000)
 +#define FMODE_NOWAIT          ((__force fmode_t)(1 << 27))
  
  /* File represents mount that needs unmounting */
 -#define FMODE_NEED_UNMOUNT    ((__force fmode_t)0x10000000)
 +#define FMODE_NEED_UNMOUNT    ((__force fmode_t)(1 << 28))
  
  /* File does not contribute to nr_files count */
 -#define FMODE_NOACCOUNT               ((__force fmode_t)0x20000000)
 -
 -/* File supports async buffered reads */
 -#define FMODE_BUF_RASYNC      ((__force fmode_t)0x40000000)
 -
 -/* File supports async nowait buffered writes */
 -#define FMODE_BUF_WASYNC      ((__force fmode_t)0x80000000)
 +#define FMODE_NOACCOUNT               ((__force fmode_t)(1 << 29))
  
  /*
   * Attribute flags.  These should be or-ed together to figure out what
@@@ -620,6 -622,8 +620,6 @@@ is_uncached_acl(struct posix_acl *acl
  #define IOP_XATTR     0x0008
  #define IOP_DEFAULT_READLINK  0x0010
  
 -struct fsnotify_mark_connector;
 -
  /*
   * Keep mostly read-only and often accessed (especially for
   * the RCU path lookup and 'stat' data) fields at the beginning
@@@ -1031,13 -1035,12 +1031,13 @@@ struct file_handle 
        __u32 handle_bytes;
        int handle_type;
        /* file identifier */
 -      unsigned char f_handle[];
 +      unsigned char f_handle[] __counted_by(handle_bytes);
  };
  
  static inline struct file *get_file(struct file *f)
  {
 -      atomic_long_inc(&f->f_count);
 +      long prior = atomic_long_fetch_inc_relaxed(&f->f_count);
 +      WARN_ONCE(!prior, "struct file::f_count incremented from zero; use-after-free condition present!\n");
        return f;
  }
  
@@@ -1174,7 -1177,7 +1174,7 @@@ extern int send_sigurg(struct fown_stru
  #define SB_I_USERNS_VISIBLE           0x00000010 /* fstype already mounted */
  #define SB_I_IMA_UNVERIFIABLE_SIGNATURE       0x00000020
  #define SB_I_UNTRUSTED_MOUNTER                0x00000040
 -#define SB_I_EVM_UNSUPPORTED          0x00000080
 +#define SB_I_EVM_HMAC_UNSUPPORTED     0x00000080
  
  #define SB_I_SKIP_SYNC        0x00000100      /* Skip superblock at global sync */
  #define SB_I_PERSB_BDI        0x00000200      /* has a per-sb bdi */
@@@ -1248,7 -1251,7 +1248,7 @@@ struct super_block 
  
        /*
         * Keep s_fs_info, s_time_gran, s_fsnotify_mask, and
 -       * s_fsnotify_marks together for cache efficiency. They are frequently
 +       * s_fsnotify_info together for cache efficiency. They are frequently
         * accessed and rarely modified.
         */
        void                    *s_fs_info;     /* Filesystem private info */
        time64_t                   s_time_max;
  #ifdef CONFIG_FSNOTIFY
        __u32                   s_fsnotify_mask;
 -      struct fsnotify_mark_connector __rcu    *s_fsnotify_marks;
 +      struct fsnotify_sb_info *s_fsnotify_info;
  #endif
  
        /*
        /* Number of inodes with nlink == 0 but still referenced */
        atomic_long_t s_remove_count;
  
 -      /*
 -       * Number of inode/mount/sb objects that are being watched, note that
 -       * inodes objects are currently double-accounted.
 -       */
 -      atomic_long_t s_fsnotify_connectors;
 -
        /* Read-only state of the superblock is being changed */
        int s_readonly_remount;
  
@@@ -1994,11 -2003,8 +1994,11 @@@ struct iov_iter
  struct io_uring_cmd;
  struct offset_ctx;
  
 +typedef unsigned int __bitwise fop_flags_t;
 +
  struct file_operations {
        struct module *owner;
 +      fop_flags_t fop_flags;
        loff_t (*llseek) (struct file *, loff_t, int);
        ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
        ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
        long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
        long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
        int (*mmap) (struct file *, struct vm_area_struct *);
 -      unsigned long mmap_supported_flags;
        int (*open) (struct inode *, struct file *);
        int (*flush) (struct file *, fl_owner_t id);
        int (*release) (struct inode *, struct file *);
                                unsigned int poll_flags);
  } __randomize_layout;
  
 +/* Supports async buffered reads */
 +#define FOP_BUFFER_RASYNC     ((__force fop_flags_t)(1 << 0))
 +/* Supports async buffered writes */
 +#define FOP_BUFFER_WASYNC     ((__force fop_flags_t)(1 << 1))
 +/* Supports synchronous page faults for mappings */
 +#define FOP_MMAP_SYNC         ((__force fop_flags_t)(1 << 2))
 +/* Supports non-exclusive O_DIRECT writes from multiple threads */
 +#define FOP_DIO_PARALLEL_WRITE        ((__force fop_flags_t)(1 << 3))
 +/* Contains huge pages */
 +#define FOP_HUGE_PAGES                ((__force fop_flags_t)(1 << 4))
 +
  /* Wrap a directory iterator that needs exclusive inode access */
  int wrap_directory_iterator(struct file *, struct dir_context *,
                            int (*) (struct file *, struct dir_context *));
@@@ -2123,6 -2119,7 +2123,7 @@@ extern ssize_t vfs_read(struct file *, 
  extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
  extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
                                   loff_t, size_t, unsigned int);
+ int remap_verify_area(struct file *file, loff_t pos, loff_t len, bool write);
  int __generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
                                    struct file *file_out, loff_t pos_out,
                                    loff_t *len, unsigned int remap_flags,
@@@ -2257,13 -2254,7 +2258,13 @@@ static inline bool sb_rdonly(const stru
  
  #define IS_DEADDIR(inode)     ((inode)->i_flags & S_DEAD)
  #define IS_NOCMTIME(inode)    ((inode)->i_flags & S_NOCMTIME)
 +
 +#ifdef CONFIG_SWAP
  #define IS_SWAPFILE(inode)    ((inode)->i_flags & S_SWAPFILE)
 +#else
 +#define IS_SWAPFILE(inode)    ((void)(inode), 0U)
 +#endif
 +
  #define IS_PRIVATE(inode)     ((inode)->i_flags & S_PRIVATE)
  #define IS_IMA(inode)         ((inode)->i_flags & S_IMA)
  #define IS_AUTOMOUNT(inode)   ((inode)->i_flags & S_AUTOMOUNT)
@@@ -3095,7 -3086,11 +3096,7 @@@ int setattr_should_drop_sgid(struct mnt
   * This must be used for allocating filesystems specific inodes to set
   * up the inode reclaim context correctly.
   */
 -static inline void *
 -alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, gfp_t gfp)
 -{
 -      return kmem_cache_alloc_lru(cache, &sb->s_inode_lru, gfp);
 -}
 +#define alloc_inode_sb(_sb, _cache, _gfp) kmem_cache_alloc_lru(_cache, &_sb->s_inode_lru, _gfp)
  
  extern void __insert_inode_hash(struct inode *, unsigned long hashval);
  static inline void insert_inode_hash(struct inode *inode)
@@@ -3346,8 -3341,6 +3347,8 @@@ void simple_offset_init(struct offset_c
  int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry);
  void simple_offset_remove(struct offset_ctx *octx, struct dentry *dentry);
  int simple_offset_empty(struct dentry *dentry);
 +int simple_offset_rename(struct inode *old_dir, struct dentry *old_dentry,
 +                       struct inode *new_dir, struct dentry *new_dentry);
  int simple_offset_rename_exchange(struct inode *old_dir,
                                  struct dentry *old_dentry,
                                  struct inode *new_dir,
This page took 0.093885 seconds and 4 git commands to generate.