Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 11 Oct 2016 03:16:43 +0000 (20:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 11 Oct 2016 03:16:43 +0000 (20:16 -0700)
Pull more vfs updates from Al Viro:
 ">rename2() work from Miklos + current_time() from Deepa"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  fs: Replace current_fs_time() with current_time()
  fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
  fs: Replace CURRENT_TIME with current_time() for inode timestamps
  fs: proc: Delete inode time initializations in proc_alloc_inode()
  vfs: Add current_time() api
  vfs: add note about i_op->rename changes to porting
  fs: rename "rename2" i_op to "rename"
  vfs: remove unused i_op->rename
  fs: make remaining filesystems use .rename2
  libfs: support RENAME_NOREPLACE in simple_rename()
  fs: support RENAME_NOREPLACE for local filesystems
  ncpfs: fix unused variable warning

86 files changed:
1  2 
Documentation/filesystems/Locking
Documentation/filesystems/porting
Documentation/filesystems/vfs.txt
drivers/staging/lustre/lustre/llite/namei.c
drivers/usb/gadget/function/f_fs.c
fs/9p/vfs_inode.c
fs/adfs/inode.c
fs/affs/inode.c
fs/attr.c
fs/bad_inode.c
fs/btrfs/file.c
fs/btrfs/inode.c
fs/cachefiles/namei.c
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/inode.c
fs/cifs/cifsfs.c
fs/cifs/file.c
fs/coda/file.c
fs/devpts/inode.c
fs/ecryptfs/inode.c
fs/efivarfs/inode.c
fs/exofs/inode.c
fs/ext2/acl.c
fs/ext2/ialloc.c
fs/ext2/inode.c
fs/ext2/namei.c
fs/ext4/namei.c
fs/f2fs/dir.c
fs/f2fs/file.c
fs/f2fs/inline.c
fs/f2fs/namei.c
fs/f2fs/xattr.c
fs/fat/file.c
fs/fat/namei_vfat.c
fs/fuse/dir.c
fs/gfs2/bmap.c
fs/gfs2/dir.c
fs/gfs2/inode.c
fs/gfs2/quota.c
fs/hfs/inode.c
fs/hfsplus/dir.c
fs/hfsplus/inode.c
fs/hostfs/hostfs_kern.c
fs/hugetlbfs/inode.c
fs/inode.c
fs/jffs2/acl.c
fs/jffs2/dir.c
fs/jffs2/fs.c
fs/jfs/acl.c
fs/jfs/namei.c
fs/kernfs/dir.c
fs/kernfs/inode.c
fs/libfs.c
fs/locks.c
fs/logfs/file.c
fs/namei.c
fs/nfs/internal.h
fs/nilfs2/inode.c
fs/nsfs.c
fs/ntfs/inode.c
fs/ocfs2/acl.c
fs/ocfs2/aops.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/file.c
fs/ocfs2/namei.c
fs/orangefs/file.c
fs/orangefs/inode.c
fs/orangefs/namei.c
fs/overlayfs/dir.c
fs/pipe.c
fs/posix_acl.c
fs/proc/base.c
fs/proc/proc_sysctl.c
fs/reiserfs/inode.c
fs/reiserfs/namei.c
fs/reiserfs/super.c
fs/reiserfs/xattr_acl.c
fs/ubifs/dir.c
fs/ufs/inode.c
fs/xfs/xfs_acl.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_iops.c
include/linux/fs.h
mm/shmem.c
security/inode.c

index f56b39ee2e54f20050f157cb526a506c193c2222,fe15682e8acde0a8a95df89ef81305520a99f474..14cdc101d165d94bb6114763989322ac1958848c
@@@ -94,11 -97,9 +91,10 @@@ update_time:        n
  atomic_open:  yes
  tmpfile:      no
  
 +
        Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
  victim.
-       cross-directory ->rename() and rename2() has (per-superblock)
- ->s_vfs_rename_sem.
+       cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
  
  See Documentation/filesystems/directory-locking for more detailed discussion
  of the locking scheme for directory operations.
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/adfs/inode.c
Simple merge
diff --cc fs/affs/inode.c
Simple merge
diff --cc fs/attr.c
Simple merge
diff --cc fs/bad_inode.c
index 7bb153c334594aeccd20da3dc705e8341de65b61,9fc451e9f9879404d0506bc564b855cecf9be458..8712062275b83fb7f2995106c80b5e7e39292c21
@@@ -153,9 -173,8 +153,9 @@@ void make_bad_inode(struct inode *inode
  
        inode->i_mode = S_IFREG;
        inode->i_atime = inode->i_mtime = inode->i_ctime =
-               current_fs_time(inode->i_sb);
+               current_time(inode);
        inode->i_op = &bad_inode_ops;   
 +      inode->i_opflags &= ~IOP_XATTR;
        inode->i_fop = &bad_file_ops;   
  }
  EXPORT_SYMBOL(make_bad_inode);
diff --cc fs/btrfs/file.c
Simple merge
Simple merge
Simple merge
diff --cc fs/ceph/dir.c
Simple merge
diff --cc fs/ceph/file.c
Simple merge
diff --cc fs/ceph/inode.c
Simple merge
Simple merge
diff --cc fs/cifs/file.c
Simple merge
diff --cc fs/coda/file.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/ext2/acl.c
index e725aa0890e00ea9e97f8255cf9b4c8e082a0bb2,80c1e579428a4d556aa8d39e59560fd6a33206e7..79dafa71effdd149d2441e1a443261c1f8e2ce3a
@@@ -190,11 -190,15 +190,11 @@@ ext2_set_acl(struct inode *inode, struc
                case ACL_TYPE_ACCESS:
                        name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS;
                        if (acl) {
 -                              error = posix_acl_equiv_mode(acl, &inode->i_mode);
 -                              if (error < 0)
 +                              error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
 +                              if (error)
                                        return error;
-                               inode->i_ctime = CURRENT_TIME_SEC;
 -                              else {
 -                                      inode->i_ctime = current_time(inode);
 -                                      mark_inode_dirty(inode);
 -                                      if (error == 0)
 -                                              acl = NULL;
 -                              }
++                              inode->i_ctime = current_time(inode);
 +                              mark_inode_dirty(inode);
                        }
                        break;
  
Simple merge
diff --cc fs/ext2/inode.c
Simple merge
diff --cc fs/ext2/namei.c
Simple merge
diff --cc fs/ext4/namei.c
index a73a9196b92902072d13d65be17b1502a791e0c4,0464e2c0d3fda77f2e49f7d54a3cded7934a3224..f92f10d4f66ace5dd13c528ac0f2ca005e066667
@@@ -3878,9 -3880,12 +3878,9 @@@ const struct inode_operations ext4_dir_
        .rmdir          = ext4_rmdir,
        .mknod          = ext4_mknod,
        .tmpfile        = ext4_tmpfile,
-       .rename2        = ext4_rename2,
+       .rename         = ext4_rename2,
        .setattr        = ext4_setattr,
 -      .setxattr       = generic_setxattr,
 -      .getxattr       = generic_getxattr,
        .listxattr      = ext4_listxattr,
 -      .removexattr    = generic_removexattr,
        .get_acl        = ext4_get_acl,
        .set_acl        = ext4_set_acl,
        .fiemap         = ext4_fiemap,
diff --cc fs/f2fs/dir.c
Simple merge
diff --cc fs/f2fs/file.c
Simple merge
Simple merge
diff --cc fs/f2fs/namei.c
Simple merge
diff --cc fs/f2fs/xattr.c
Simple merge
diff --cc fs/fat/file.c
Simple merge
index 4afdc3f3647085961e760392b13691d969685d0a,bf46a2d7dc50d3dba408b49360bc2177e7a829f5..6a7152d0c2503944d5e870ca8d3b78eb159b1003
@@@ -832,9 -821,9 +832,9 @@@ static int vfat_rmdir(struct inode *dir
        drop_nlink(dir);
  
        clear_nlink(inode);
-       inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
+       inode->i_mtime = inode->i_atime = current_time(inode);
        fat_detach(inode);
 -      dentry->d_time = dir->i_version;
 +      vfat_d_version_set(dentry, dir->i_version);
  out:
        mutex_unlock(&MSDOS_SB(sb)->s_lock);
  
@@@ -858,9 -847,9 +858,9 @@@ static int vfat_unlink(struct inode *di
        if (err)
                goto out;
        clear_nlink(inode);
-       inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
+       inode->i_mtime = inode->i_atime = current_time(inode);
        fat_detach(inode);
 -      dentry->d_time = dir->i_version;
 +      vfat_d_version_set(dentry, dir->i_version);
  out:
        mutex_unlock(&MSDOS_SB(sb)->s_lock);
  
diff --cc fs/fuse/dir.c
index 572d12410c7c1ad405e753cb0627d77186259406,215b4beea2ef463e641a092d7c26a618e7745f34..6a4d0e5418a179def0e5d4da4d3adbbcf3a82cd0
@@@ -644,10 -634,10 +644,10 @@@ static int fuse_symlink(struct inode *d
        return create_new_entry(fc, &args, dir, entry, S_IFLNK);
  }
  
 -static inline void fuse_update_ctime(struct inode *inode)
 +void fuse_update_ctime(struct inode *inode)
  {
        if (!IS_NOCMTIME(inode)) {
-               inode->i_ctime = current_fs_time(inode->i_sb);
+               inode->i_ctime = current_time(inode);
                mark_inode_dirty_sync(inode);
        }
  }
diff --cc fs/gfs2/bmap.c
Simple merge
diff --cc fs/gfs2/dir.c
Simple merge
diff --cc fs/gfs2/inode.c
Simple merge
diff --cc fs/gfs2/quota.c
Simple merge
diff --cc fs/hfs/inode.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/inode.c
index 7d037591259d6298602dd08f7ce218ee61a7673d,cadf75fb579e4bcd937314060bf90a58442ad580..88110fd0b282e49246dc9cd93a1d6e173d951d7b
@@@ -1686,9 -1636,9 +1686,9 @@@ bool __atime_needs_update(const struct 
        if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
                return false;
  
-       now = current_fs_time(inode->i_sb);
+       now = current_time(inode);
  
 -      if (!relatime_need_update(mnt, inode, now))
 +      if (!relatime_need_update(path, inode, now, rcu))
                return false;
  
        if (timespec_equal(&inode->i_atime, &now))
diff --cc fs/jffs2/acl.c
Simple merge
diff --cc fs/jffs2/dir.c
Simple merge
diff --cc fs/jffs2/fs.c
Simple merge
diff --cc fs/jfs/acl.c
index 3a1e1554a4e3598132bd6665f05c200922345a9a,4c1a6b5670df9e42eb7875ec2a5b410a442ea7cb..7bc186f4ed4de6837b94ab8670cca7043122b28c
@@@ -78,11 -78,13 +78,11 @@@ static int __jfs_set_acl(tid_t tid, str
        case ACL_TYPE_ACCESS:
                ea_name = XATTR_NAME_POSIX_ACL_ACCESS;
                if (acl) {
 -                      rc = posix_acl_equiv_mode(acl, &inode->i_mode);
 -                      if (rc < 0)
 +                      rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
 +                      if (rc)
                                return rc;
-                       inode->i_ctime = CURRENT_TIME;
+                       inode->i_ctime = current_time(inode);
                        mark_inode_dirty(inode);
 -                      if (rc == 0)
 -                              acl = NULL;
                }
                break;
        case ACL_TYPE_DEFAULT:
diff --cc fs/jfs/namei.c
Simple merge
diff --cc fs/kernfs/dir.c
Simple merge
Simple merge
diff --cc fs/libfs.c
Simple merge
diff --cc fs/locks.c
Simple merge
diff --cc fs/logfs/file.c
Simple merge
diff --cc fs/namei.c
Simple merge
Simple merge
Simple merge
diff --cc fs/nsfs.c
Simple merge
diff --cc fs/ntfs/inode.c
Simple merge
diff --cc fs/ocfs2/acl.c
Simple merge
diff --cc fs/ocfs2/aops.c
Simple merge
Simple merge
diff --cc fs/ocfs2/file.c
Simple merge
Simple merge
Simple merge
Simple merge
index 4d5576a21c828f61965fa7fc219aa1de9e363439,0dfa868a6d037a286f8b68d97b0c5883bb2526a4..d15d3d2dba6225ce52bf97127a2de62dae609b8d
@@@ -76,12 -76,12 +76,12 @@@ static int orangefs_create(struct inod
        ORANGEFS_I(inode)->getattr_time = jiffies - 1;
  
        gossip_debug(GOSSIP_NAME_DEBUG,
 -                   "%s: dentry instantiated for %s\n",
 +                   "%s: dentry instantiated for %pd\n",
                     __func__,
 -                   dentry->d_name.name);
 +                   dentry);
  
        SetMtimeFlag(parent);
-       dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb);
+       dir->i_mtime = dir->i_ctime = current_time(dir);
        mark_inode_dirty_sync(dir);
        ret = 0;
  out:
@@@ -326,12 -326,12 +326,12 @@@ static int orangefs_symlink(struct inod
        ORANGEFS_I(inode)->getattr_time = jiffies - 1;
  
        gossip_debug(GOSSIP_NAME_DEBUG,
 -                   "Inode (Symlink) %pU -> %s\n",
 +                   "Inode (Symlink) %pU -> %pd\n",
                     get_khandle_from_ino(inode),
 -                   dentry->d_name.name);
 +                   dentry);
  
        SetMtimeFlag(parent);
-       dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb);
+       dir->i_mtime = dir->i_ctime = current_time(dir);
        mark_inode_dirty_sync(dir);
        ret = 0;
  out:
Simple merge
diff --cc fs/pipe.c
Simple merge
diff --cc fs/posix_acl.c
Simple merge
diff --cc fs/proc/base.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/ubifs/dir.c
index 1d55aeaebf23bc5a9a6e9f9eb0e7aed9abd3bc0c,e10e9a00cfc3021d470099d41285479a579f6adc..64902702b17d5220e92626f786fda9c85a6932de
@@@ -1179,10 -1183,13 +1183,10 @@@ const struct inode_operations ubifs_dir
        .mkdir       = ubifs_mkdir,
        .rmdir       = ubifs_rmdir,
        .mknod       = ubifs_mknod,
-       .rename      = ubifs_rename,
+       .rename     = ubifs_rename,
        .setattr     = ubifs_setattr,
        .getattr     = ubifs_getattr,
 -      .setxattr    = generic_setxattr,
 -      .getxattr    = generic_getxattr,
        .listxattr   = ubifs_listxattr,
 -      .removexattr = generic_removexattr,
  #ifdef CONFIG_UBIFS_ATIME_SUPPORT
        .update_time = ubifs_update_time,
  #endif
diff --cc fs/ufs/inode.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc mm/shmem.c
Simple merge
Simple merge