From: Linus Torvalds Date: Tue, 11 Oct 2016 03:16:43 +0000 (-0700) Subject: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs X-Git-Tag: v4.9-rc1~50 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=101105b1717f536ca741f940033996302d4ef191;p=linux-2.6-block.git Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs 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 --- 101105b1717f536ca741f940033996302d4ef191 diff --cc Documentation/filesystems/Locking index f56b39ee2e54,fe15682e8acd..14cdc101d165 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@@ -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. diff --cc fs/bad_inode.c index 7bb153c33459,9fc451e9f987..8712062275b8 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@@ -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/ext2/acl.c index e725aa0890e0,80c1e579428a..79dafa71effd --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c @@@ -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; diff --cc fs/ext4/namei.c index a73a9196b929,0464e2c0d3fd..f92f10d4f66a --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@@ -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/fat/namei_vfat.c index 4afdc3f36470,bf46a2d7dc50..6a7152d0c250 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c @@@ -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 572d12410c7c,215b4beea2ef..6a4d0e5418a1 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@@ -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/inode.c index 7d037591259d,cadf75fb579e..88110fd0b282 --- a/fs/inode.c +++ b/fs/inode.c @@@ -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/jfs/acl.c index 3a1e1554a4e3,4c1a6b5670df..7bc186f4ed4d --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c @@@ -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/orangefs/namei.c index 4d5576a21c82,0dfa868a6d03..d15d3d2dba62 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@@ -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: diff --cc fs/ubifs/dir.c index 1d55aeaebf23,e10e9a00cfc3..64902702b17d --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@@ -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