From f03b8ad8d38634d13e802165cc15917481b47835 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 27 Sep 2016 11:03:57 +0200 Subject: fs: support RENAME_NOREPLACE for local filesystems This is trivial to do: - add flags argument to foo_rename() - check if flags doesn't have any other than RENAME_NOREPLACE - assign foo_rename() to .rename2 instead of .rename Filesystems converted: affs, bfs, exofs, ext2, hfs, hfsplus, jffs2, jfs, logfs, minix, msdos, nilfs2, omfs, reiserfs, sysvfs, ubifs, udf, ufs, vfat. Signed-off-by: Miklos Szeredi Acked-by: Boaz Harrosh Acked-by: Richard Weinberger Acked-by: Bob Copeland Acked-by: Jan Kara Cc: Theodore Ts'o Cc: Jaegeuk Kim Cc: OGAWA Hirofumi Cc: Mikulas Patocka Cc: David Woodhouse Cc: Dave Kleikamp Cc: Ryusuke Konishi Cc: Christoph Hellwig --- fs/jfs/namei.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fs/jfs') diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 814b0c58016c..ee1aa32f7c24 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c @@ -1078,7 +1078,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, * FUNCTION: rename a file or directory */ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry) + struct inode *new_dir, struct dentry *new_dentry, + unsigned int flags) { struct btstack btstack; ino_t ino; @@ -1097,6 +1098,8 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, s64 new_size = 0; int commit_flag; + if (flags & ~RENAME_NOREPLACE) + return -EINVAL; jfs_info("jfs_rename: %pd %pd", old_dentry, new_dentry); @@ -1536,7 +1539,7 @@ const struct inode_operations jfs_dir_inode_operations = { .mkdir = jfs_mkdir, .rmdir = jfs_rmdir, .mknod = jfs_mknod, - .rename = jfs_rename, + .rename2 = jfs_rename, .setxattr = generic_setxattr, .getxattr = generic_getxattr, .listxattr = jfs_listxattr, -- cgit v1.2.3 From 2773bf00aeb9bf39e022463272a61dd0ec9f55f4 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 27 Sep 2016 11:03:58 +0200 Subject: fs: rename "rename2" i_op to "rename" Generated patch: sed -i "s/\.rename2\t/\.rename\t\t/" `git grep -wl rename2` sed -i "s/\brename2\b/rename/g" `git grep -wl rename2` Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 6 +++--- Documentation/filesystems/vfs.txt | 2 +- drivers/staging/lustre/lustre/llite/namei.c | 2 +- fs/9p/vfs_inode.c | 4 ++-- fs/9p/vfs_inode_dotl.c | 2 +- fs/affs/dir.c | 2 +- fs/afs/dir.c | 2 +- fs/bad_inode.c | 2 +- fs/bfs/dir.c | 2 +- fs/btrfs/inode.c | 2 +- fs/cachefiles/namei.c | 2 +- fs/ceph/dir.c | 4 ++-- fs/cifs/cifsfs.c | 2 +- fs/coda/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/exofs/namei.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fat/namei_msdos.c | 2 +- fs/fat/namei_vfat.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 2 +- fs/jfs/namei.c | 2 +- fs/kernfs/dir.c | 2 +- fs/logfs/dir.c | 2 +- fs/minix/namei.c | 2 +- fs/namei.c | 4 ++-- fs/ncpfs/dir.c | 2 +- fs/nfs/nfs3proc.c | 2 +- fs/nfs/nfs4proc.c | 2 +- fs/nfs/proc.c | 2 +- fs/nilfs2/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/omfs/dir.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/overlayfs/overlayfs.h | 4 ++-- fs/ramfs/inode.c | 2 +- fs/reiserfs/namei.c | 2 +- fs/sysv/namei.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/xfs/xfs_iops.c | 4 ++-- include/linux/fs.h | 2 +- kernel/bpf/inode.c | 2 +- mm/shmem.c | 2 +- security/tomoyo/realpath.c | 4 ++-- 55 files changed, 63 insertions(+), 63 deletions(-) (limited to 'fs/jfs') diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index da320bc08b9e..fe15682e8acd 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -50,7 +50,7 @@ prototypes: int (*mkdir) (struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); - int (*rename2) (struct inode *, struct dentry *, + int (*rename) (struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *, void **); @@ -81,7 +81,7 @@ symlink: yes mkdir: yes unlink: yes (both) rmdir: yes (both) (see below) -rename2: yes (all) (see below) +rename: yes (all) (see below) readlink: no get_link: no setattr: yes @@ -99,7 +99,7 @@ tmpfile: no Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on victim. - cross-directory ->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 --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index c641e0c37a07..b6bfa0bc02f8 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt @@ -345,7 +345,7 @@ struct inode_operations { int (*mkdir) (struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); - int (*rename2) (struct inode *, struct dentry *, + int (*rename) (struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *, diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index ec824db2ad33..a603f29349f9 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -1106,7 +1106,7 @@ const struct inode_operations ll_dir_inode_operations = { .rmdir = ll_rmdir, .symlink = ll_symlink, .link = ll_link, - .rename2 = ll_rename, + .rename = ll_rename, .setattr = ll_setattr, .getattr = ll_getattr, .permission = ll_inode_permission, diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 50ab1a615207..0ad3c6c712b8 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -1440,7 +1440,7 @@ static const struct inode_operations v9fs_dir_inode_operations_dotu = { .mkdir = v9fs_vfs_mkdir, .rmdir = v9fs_vfs_rmdir, .mknod = v9fs_vfs_mknod, - .rename2 = v9fs_vfs_rename, + .rename = v9fs_vfs_rename, .getattr = v9fs_vfs_getattr, .setattr = v9fs_vfs_setattr, }; @@ -1453,7 +1453,7 @@ static const struct inode_operations v9fs_dir_inode_operations = { .mkdir = v9fs_vfs_mkdir, .rmdir = v9fs_vfs_rmdir, .mknod = v9fs_vfs_mknod, - .rename2 = v9fs_vfs_rename, + .rename = v9fs_vfs_rename, .getattr = v9fs_vfs_getattr, .setattr = v9fs_vfs_setattr, }; diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 8164be972b5c..eeabcb0bad12 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -964,7 +964,7 @@ const struct inode_operations v9fs_dir_inode_operations_dotl = { .mkdir = v9fs_vfs_mkdir_dotl, .rmdir = v9fs_vfs_rmdir, .mknod = v9fs_vfs_mknod_dotl, - .rename2 = v9fs_vfs_rename, + .rename = v9fs_vfs_rename, .getattr = v9fs_vfs_getattr_dotl, .setattr = v9fs_vfs_setattr_dotl, .setxattr = generic_setxattr, diff --git a/fs/affs/dir.c b/fs/affs/dir.c index 8f127c239472..f1e7294381c5 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c @@ -35,7 +35,7 @@ const struct inode_operations affs_dir_inode_operations = { .symlink = affs_symlink, .mkdir = affs_mkdir, .rmdir = affs_rmdir, - .rename2 = affs_rename, + .rename = affs_rename, .setattr = affs_notify_change, }; diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 381b7d0b6751..51a241e09fbb 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -57,7 +57,7 @@ const struct inode_operations afs_dir_inode_operations = { .symlink = afs_symlink, .mkdir = afs_mkdir, .rmdir = afs_rmdir, - .rename2 = afs_rename, + .rename = afs_rename, .permission = afs_permission, .getattr = afs_getattr, .setattr = afs_setattr, diff --git a/fs/bad_inode.c b/fs/bad_inode.c index 3ba385eaa26e..536d2a387267 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@ -133,7 +133,7 @@ static const struct inode_operations bad_inode_ops = .mkdir = bad_inode_mkdir, .rmdir = bad_inode_rmdir, .mknod = bad_inode_mknod, - .rename2 = bad_inode_rename2, + .rename = bad_inode_rename2, .readlink = bad_inode_readlink, /* follow_link must be no-op, otherwise unmounting this inode won't work */ diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 9d5f875e85d0..5e3369f7cd9d 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c @@ -274,7 +274,7 @@ const struct inode_operations bfs_dir_inops = { .lookup = bfs_lookup, .link = bfs_link, .unlink = bfs_unlink, - .rename2 = bfs_rename, + .rename = bfs_rename, }; static int bfs_add_entry(struct inode *dir, const unsigned char *name, diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e6811c42e41e..c66602091527 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -10566,7 +10566,7 @@ static const struct inode_operations btrfs_dir_inode_operations = { .link = btrfs_link, .mkdir = btrfs_mkdir, .rmdir = btrfs_rmdir, - .rename2 = btrfs_rename2, + .rename = btrfs_rename2, .symlink = btrfs_symlink, .setattr = btrfs_setattr, .mknod = btrfs_mknod, diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index 02e1507812de..9828850d88de 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -804,7 +804,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache, !d_backing_inode(subdir)->i_op->lookup || !d_backing_inode(subdir)->i_op->mkdir || !d_backing_inode(subdir)->i_op->create || - !d_backing_inode(subdir)->i_op->rename2 || + !d_backing_inode(subdir)->i_op->rename || !d_backing_inode(subdir)->i_op->rmdir || !d_backing_inode(subdir)->i_op->unlink) goto check_error; diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index cef8252af38a..291a4d59c5f7 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -1502,7 +1502,7 @@ const struct inode_operations ceph_dir_iops = { .link = ceph_link, .unlink = ceph_unlink, .rmdir = ceph_unlink, - .rename2 = ceph_rename, + .rename = ceph_rename, .create = ceph_create, .atomic_open = ceph_atomic_open, }; @@ -1513,7 +1513,7 @@ const struct inode_operations ceph_snapdir_iops = { .getattr = ceph_getattr, .mkdir = ceph_mkdir, .rmdir = ceph_unlink, - .rename2 = ceph_rename, + .rename = ceph_rename, }; const struct dentry_operations ceph_dentry_ops = { diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 14ae4b8e1a3c..7d0e0f78da51 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -896,7 +896,7 @@ const struct inode_operations cifs_dir_inode_ops = { .link = cifs_hardlink, .mkdir = cifs_mkdir, .rmdir = cifs_rmdir, - .rename2 = cifs_rename2, + .rename = cifs_rename2, .permission = cifs_permission, .setattr = cifs_setattr, .symlink = cifs_symlink, diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 5d79c26b0484..82aceaef8e4e 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -573,7 +573,7 @@ const struct inode_operations coda_dir_inode_operations = { .mkdir = coda_mkdir, .rmdir = coda_rmdir, .mknod = CODA_EIO_ERROR, - .rename2 = coda_rename, + .rename = coda_rename, .permission = coda_permission, .getattr = coda_getattr, .setattr = coda_setattr, diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index f3ff7c4d384c..fe83c1050048 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -1108,7 +1108,7 @@ const struct inode_operations ecryptfs_dir_iops = { .mkdir = ecryptfs_mkdir, .rmdir = ecryptfs_rmdir, .mknod = ecryptfs_mknod, - .rename2 = ecryptfs_rename, + .rename = ecryptfs_rename, .permission = ecryptfs_permission, .setattr = ecryptfs_setattr, .setxattr = ecryptfs_setxattr, diff --git a/fs/exofs/namei.c b/fs/exofs/namei.c index ddf343259f13..53d838200cc9 100644 --- a/fs/exofs/namei.c +++ b/fs/exofs/namei.c @@ -314,7 +314,7 @@ const struct inode_operations exofs_dir_inode_operations = { .mkdir = exofs_mkdir, .rmdir = exofs_rmdir, .mknod = exofs_mknod, - .rename2 = exofs_rename, + .rename = exofs_rename, .setattr = exofs_setattr, }; diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 38fac85ff786..be32e20a2b88 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -430,7 +430,7 @@ const struct inode_operations ext2_dir_inode_operations = { .mkdir = ext2_mkdir, .rmdir = ext2_rmdir, .mknod = ext2_mknod, - .rename2 = ext2_rename, + .rename = ext2_rename, #ifdef CONFIG_EXT2_FS_XATTR .setxattr = generic_setxattr, .getxattr = generic_getxattr, diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 34c0142caf6a..0464e2c0d3fd 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -3880,7 +3880,7 @@ const struct inode_operations ext4_dir_inode_operations = { .rmdir = ext4_rmdir, .mknod = ext4_mknod, .tmpfile = ext4_tmpfile, - .rename2 = ext4_rename2, + .rename = ext4_rename2, .setattr = ext4_setattr, .setxattr = generic_setxattr, .getxattr = generic_getxattr, diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 73fa356f8fbb..08e3d1d7a500 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -1093,7 +1093,7 @@ const struct inode_operations f2fs_dir_inode_operations = { .mkdir = f2fs_mkdir, .rmdir = f2fs_rmdir, .mknod = f2fs_mknod, - .rename2 = f2fs_rename2, + .rename = f2fs_rename2, .tmpfile = f2fs_tmpfile, .getattr = f2fs_getattr, .setattr = f2fs_setattr, diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c index 6c814699d5d5..a8f6aa969948 100644 --- a/fs/fat/namei_msdos.c +++ b/fs/fat/namei_msdos.c @@ -637,7 +637,7 @@ static const struct inode_operations msdos_dir_inode_operations = { .unlink = msdos_unlink, .mkdir = msdos_mkdir, .rmdir = msdos_rmdir, - .rename2 = msdos_rename, + .rename = msdos_rename, .setattr = fat_setattr, .getattr = fat_getattr, }; diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index ce8986f3918a..c5e48b8631cc 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c @@ -1040,7 +1040,7 @@ static const struct inode_operations vfat_dir_inode_operations = { .unlink = vfat_unlink, .mkdir = vfat_mkdir, .rmdir = vfat_rmdir, - .rename2 = vfat_rename, + .rename = vfat_rename, .setattr = fat_setattr, .getattr = fat_getattr, }; diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index c47b7780ce37..4bfeaa70815f 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1876,7 +1876,7 @@ static const struct inode_operations fuse_dir_inode_operations = { .symlink = fuse_symlink, .unlink = fuse_unlink, .rmdir = fuse_rmdir, - .rename2 = fuse_rename2, + .rename = fuse_rename2, .link = fuse_link, .setattr = fuse_setattr, .create = fuse_create, diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e4da0ecd3285..56825cc8ab87 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -2054,7 +2054,7 @@ const struct inode_operations gfs2_dir_iops = { .mkdir = gfs2_mkdir, .rmdir = gfs2_unlink, .mknod = gfs2_mknod, - .rename2 = gfs2_rename2, + .rename = gfs2_rename2, .permission = gfs2_permission, .setattr = gfs2_setattr, .getattr = gfs2_getattr, diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index d5ce9fcad10f..4f7a1b64e251 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -324,6 +324,6 @@ const struct inode_operations hfs_dir_inode_operations = { .unlink = hfs_remove, .mkdir = hfs_mkdir, .rmdir = hfs_remove, - .rename2 = hfs_rename, + .rename = hfs_rename, .setattr = hfs_inode_setattr, }; diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index ca64a75f12b3..063577958126 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -565,7 +565,7 @@ const struct inode_operations hfsplus_dir_inode_operations = { .rmdir = hfsplus_rmdir, .symlink = hfsplus_symlink, .mknod = hfsplus_mknod, - .rename2 = hfsplus_rename, + .rename = hfsplus_rename, .setxattr = generic_setxattr, .getxattr = generic_getxattr, .listxattr = hfsplus_listxattr, diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 90e46cd752fe..530606169e49 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -885,7 +885,7 @@ static const struct inode_operations hostfs_dir_iops = { .mkdir = hostfs_mkdir, .rmdir = hostfs_rmdir, .mknod = hostfs_mknod, - .rename2 = hostfs_rename2, + .rename = hostfs_rename2, .permission = hostfs_permission, .setattr = hostfs_setattr, }; diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 3c5c1a75569d..f30c14414518 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c @@ -622,6 +622,6 @@ const struct inode_operations hpfs_dir_iops = .mkdir = hpfs_mkdir, .rmdir = hpfs_rmdir, .mknod = hpfs_mknod, - .rename2 = hpfs_rename, + .rename = hpfs_rename, .setattr = hpfs_setattr, }; diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 50cd7475a942..4ea71eba40a5 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -988,7 +988,7 @@ static const struct inode_operations hugetlbfs_dir_inode_operations = { .mkdir = hugetlbfs_mkdir, .rmdir = simple_rmdir, .mknod = hugetlbfs_mknod, - .rename2 = simple_rename, + .rename = simple_rename, .setattr = hugetlbfs_setattr, }; diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 11e711b12ccf..d957734a2adb 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c @@ -58,7 +58,7 @@ const struct inode_operations jffs2_dir_inode_operations = .mkdir = jffs2_mkdir, .rmdir = jffs2_rmdir, .mknod = jffs2_mknod, - .rename2 = jffs2_rename, + .rename = jffs2_rename, .get_acl = jffs2_get_acl, .set_acl = jffs2_set_acl, .setattr = jffs2_setattr, diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index ee1aa32f7c24..1d88df6ae81b 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c @@ -1539,7 +1539,7 @@ const struct inode_operations jfs_dir_inode_operations = { .mkdir = jfs_mkdir, .rmdir = jfs_rmdir, .mknod = jfs_mknod, - .rename2 = jfs_rename, + .rename = jfs_rename, .setxattr = generic_setxattr, .getxattr = generic_getxattr, .listxattr = jfs_listxattr, diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index c7e23ca945ab..390390212b43 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -1137,7 +1137,7 @@ const struct inode_operations kernfs_dir_iops = { .mkdir = kernfs_iop_mkdir, .rmdir = kernfs_iop_rmdir, - .rename2 = kernfs_iop_rename, + .rename = kernfs_iop_rename, }; static struct kernfs_node *kernfs_leftmost_descendant(struct kernfs_node *pos) diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c index 57f2da17a905..be37b907e65a 100644 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c @@ -787,7 +787,7 @@ const struct inode_operations logfs_dir_iops = { .lookup = logfs_lookup, .mkdir = logfs_mkdir, .mknod = logfs_mknod, - .rename2 = logfs_rename, + .rename = logfs_rename, .rmdir = logfs_rmdir, .symlink = logfs_symlink, .unlink = logfs_unlink, diff --git a/fs/minix/namei.c b/fs/minix/namei.c index 6dc210c0e3ce..f7811d508104 100644 --- a/fs/minix/namei.c +++ b/fs/minix/namei.c @@ -268,7 +268,7 @@ const struct inode_operations minix_dir_inode_operations = { .mkdir = minix_mkdir, .rmdir = minix_rmdir, .mknod = minix_mknod, - .rename2 = minix_rename, + .rename = minix_rename, .getattr = minix_getattr, .tmpfile = minix_tmpfile, }; diff --git a/fs/namei.c b/fs/namei.c index 02803bd6cbad..cf3fc8db909c 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4369,7 +4369,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, if (error) return error; - if (!old_dir->i_op->rename2) + if (!old_dir->i_op->rename) return -EPERM; /* @@ -4425,7 +4425,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, if (error) goto out; } - error = old_dir->i_op->rename2(old_dir, old_dentry, + error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry, flags); if (error) goto out; diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index a2d3738df4af..6df2a3827574 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c @@ -65,7 +65,7 @@ const struct inode_operations ncp_dir_inode_operations = .mkdir = ncp_mkdir, .rmdir = ncp_rmdir, .mknod = ncp_mknod, - .rename2 = ncp_rename, + .rename = ncp_rename, .setattr = ncp_notify_change, }; diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index a85fdae4a51f..698be9361280 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -893,7 +893,7 @@ static const struct inode_operations nfs3_dir_inode_operations = { .mkdir = nfs_mkdir, .rmdir = nfs_rmdir, .mknod = nfs_mknod, - .rename2 = nfs_rename, + .rename = nfs_rename, .permission = nfs_permission, .getattr = nfs_getattr, .setattr = nfs_setattr, diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 14956da3cf38..a9dec32ba9ba 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -8937,7 +8937,7 @@ static const struct inode_operations nfs4_dir_inode_operations = { .mkdir = nfs_mkdir, .rmdir = nfs_rmdir, .mknod = nfs_mknod, - .rename2 = nfs_rename, + .rename = nfs_rename, .permission = nfs_permission, .getattr = nfs_getattr, .setattr = nfs_setattr, diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 380d0b787983..b7bca8303989 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -685,7 +685,7 @@ static const struct inode_operations nfs_dir_inode_operations = { .mkdir = nfs_mkdir, .rmdir = nfs_rmdir, .mknod = nfs_mknod, - .rename2 = nfs_rename, + .rename = nfs_rename, .permission = nfs_permission, .getattr = nfs_getattr, .setattr = nfs_setattr, diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c index 8540c13ef374..ea94049c3e79 100644 --- a/fs/nilfs2/namei.c +++ b/fs/nilfs2/namei.c @@ -556,7 +556,7 @@ const struct inode_operations nilfs_dir_inode_operations = { .mkdir = nilfs_mkdir, .rmdir = nilfs_rmdir, .mknod = nilfs_mknod, - .rename2 = nilfs_rename, + .rename = nilfs_rename, .setattr = nilfs_setattr, .permission = nilfs_permission, .fiemap = nilfs_fiemap, diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 1040c10a9493..7fb6a7f023e7 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -2913,7 +2913,7 @@ const struct inode_operations ocfs2_dir_iops = { .symlink = ocfs2_symlink, .mkdir = ocfs2_mkdir, .mknod = ocfs2_mknod, - .rename2 = ocfs2_rename, + .rename = ocfs2_rename, .setattr = ocfs2_setattr, .getattr = ocfs2_getattr, .permission = ocfs2_permission, diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index 417511bbe362..e81f06be5e7b 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c @@ -448,7 +448,7 @@ static int omfs_readdir(struct file *file, struct dir_context *ctx) const struct inode_operations omfs_dir_inops = { .lookup = omfs_lookup, .mkdir = omfs_mkdir, - .rename2 = omfs_rename, + .rename = omfs_rename, .create = omfs_create, .unlink = omfs_remove, .rmdir = omfs_remove, diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c index 810d43635dfb..5f015c58bfa2 100644 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -463,7 +463,7 @@ const struct inode_operations orangefs_dir_inode_operations = { .symlink = orangefs_symlink, .mkdir = orangefs_mkdir, .rmdir = orangefs_unlink, - .rename2 = orangefs_rename, + .rename = orangefs_rename, .setattr = orangefs_setattr, .getattr = orangefs_getattr, .setxattr = generic_setxattr, diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 1560fdc09a5f..480fc7868a2f 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -996,7 +996,7 @@ const struct inode_operations ovl_dir_inode_operations = { .symlink = ovl_symlink, .unlink = ovl_unlink, .rmdir = ovl_rmdir, - .rename2 = ovl_rename2, + .rename = ovl_rename2, .link = ovl_link, .setattr = ovl_setattr, .create = ovl_create, diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 5813ccff8cd9..e218e741cb99 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -114,13 +114,13 @@ static inline int ovl_do_rename(struct inode *olddir, struct dentry *olddentry, { int err; - pr_debug("rename2(%pd2, %pd2, 0x%x)\n", + pr_debug("rename(%pd2, %pd2, 0x%x)\n", olddentry, newdentry, flags); err = vfs_rename(olddir, olddentry, newdir, newdentry, NULL, flags); if (err) { - pr_debug("...rename2(%pd2, %pd2, ...) = %i\n", + pr_debug("...rename(%pd2, %pd2, ...) = %i\n", olddentry, newdentry, err); } return err; diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index c2aa068ff974..1ab6e6c2e60e 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -146,7 +146,7 @@ static const struct inode_operations ramfs_dir_inode_operations = { .mkdir = ramfs_mkdir, .rmdir = simple_rmdir, .mknod = ramfs_mknod, - .rename2 = simple_rename, + .rename = simple_rename, }; static const struct super_operations ramfs_ops = { diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 21b4b7138985..586260ed81c9 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -1652,7 +1652,7 @@ const struct inode_operations reiserfs_dir_inode_operations = { .mkdir = reiserfs_mkdir, .rmdir = reiserfs_rmdir, .mknod = reiserfs_mknod, - .rename2 = reiserfs_rename, + .rename = reiserfs_rename, .setattr = reiserfs_setattr, .setxattr = generic_setxattr, .getxattr = generic_getxattr, diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index 765d79de1217..30bf6780985a 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c @@ -289,6 +289,6 @@ const struct inode_operations sysv_dir_inode_operations = { .mkdir = sysv_mkdir, .rmdir = sysv_rmdir, .mknod = sysv_mknod, - .rename2 = sysv_rename, + .rename = sysv_rename, .getattr = sysv_getattr, }; diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 23d1ebabc688..e10e9a00cfc3 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1183,7 +1183,7 @@ const struct inode_operations ubifs_dir_inode_operations = { .mkdir = ubifs_mkdir, .rmdir = ubifs_rmdir, .mknod = ubifs_mknod, - .rename2 = ubifs_rename, + .rename = ubifs_rename, .setattr = ubifs_setattr, .getattr = ubifs_getattr, .setxattr = generic_setxattr, diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ca2ec0061802..17e9d4af3010 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -1357,6 +1357,6 @@ const struct inode_operations udf_dir_inode_operations = { .mkdir = udf_mkdir, .rmdir = udf_rmdir, .mknod = udf_mknod, - .rename2 = udf_rename, + .rename = udf_rename, .tmpfile = udf_tmpfile, }; diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 719c9c9b83d8..f2f11c382b6d 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -337,5 +337,5 @@ const struct inode_operations ufs_dir_inode_operations = { .mkdir = ufs_mkdir, .rmdir = ufs_rmdir, .mknod = ufs_mknod, - .rename2 = ufs_rename, + .rename = ufs_rename, }; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index b24c3102fa93..a66c781e5468 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -1059,7 +1059,7 @@ static const struct inode_operations xfs_dir_inode_operations = { */ .rmdir = xfs_vn_unlink, .mknod = xfs_vn_mknod, - .rename2 = xfs_vn_rename, + .rename = xfs_vn_rename, .get_acl = xfs_get_acl, .set_acl = xfs_set_acl, .getattr = xfs_vn_getattr, @@ -1087,7 +1087,7 @@ static const struct inode_operations xfs_dir_ci_inode_operations = { */ .rmdir = xfs_vn_unlink, .mknod = xfs_vn_mknod, - .rename2 = xfs_vn_rename, + .rename = xfs_vn_rename, .get_acl = xfs_get_acl, .set_acl = xfs_set_acl, .getattr = xfs_vn_getattr, diff --git a/include/linux/fs.h b/include/linux/fs.h index 6b14ceba4f20..cf7e621f7413 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1732,7 +1732,7 @@ struct inode_operations { int (*mkdir) (struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); - int (*rename2) (struct inode *, struct dentry *, + int (*rename) (struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*setattr) (struct dentry *, struct iattr *); int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index c92fd8936d33..5967b870a895 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -189,7 +189,7 @@ static const struct inode_operations bpf_dir_iops = { .mknod = bpf_mkobj, .mkdir = bpf_mkdir, .rmdir = simple_rmdir, - .rename2 = simple_rename, + .rename = simple_rename, .link = simple_link, .unlink = simple_unlink, }; diff --git a/mm/shmem.c b/mm/shmem.c index 971fc83e6402..efbef2336605 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3814,7 +3814,7 @@ static const struct inode_operations shmem_dir_inode_operations = { .mkdir = shmem_mkdir, .rmdir = shmem_rmdir, .mknod = shmem_mknod, - .rename2 = shmem_rename2, + .rename = shmem_rename2, .tmpfile = shmem_tmpfile, #endif #ifdef CONFIG_TMPFS_XATTR diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c index 38bcdbc06bb2..a97b275ca3af 100644 --- a/security/tomoyo/realpath.c +++ b/security/tomoyo/realpath.c @@ -173,7 +173,7 @@ static char *tomoyo_get_local_path(struct dentry *dentry, char * const buffer, * Use filesystem name if filesystem does not support rename() * operation. */ - if (!inode->i_op->rename2) + if (!inode->i_op->rename) goto prepend_filesystem_name; } /* Prepend device name. */ @@ -283,7 +283,7 @@ char *tomoyo_realpath_from_path(const struct path *path) * or dentry without vfsmount. */ if (!path->mnt || - (!inode->i_op->rename2)) + (!inode->i_op->rename)) pos = tomoyo_get_local_path(path->dentry, buf, buf_len - 1); /* Get absolute name for the rest. */ -- cgit v1.2.3 From 078cd8279e659989b103359bb22373cc79445bde Mon Sep 17 00:00:00 2001 From: Deepa Dinamani Date: Wed, 14 Sep 2016 07:48:04 -0700 Subject: fs: Replace CURRENT_TIME with current_time() for inode timestamps CURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_time() instead. CURRENT_TIME is also not y2038 safe. This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. As part of the effort current_time() will be extended to do range checks. Hence, it is necessary for all file system timestamps to use current_time(). Also, current_time() will be transitioned along with vfs to be y2038 safe. Note that whenever a single call to current_time() is used to change timestamps in different inodes, it is because they share the same time granularity. Signed-off-by: Deepa Dinamani Reviewed-by: Arnd Bergmann Acked-by: Felipe Balbi Acked-by: Steven Whitehouse Acked-by: Ryusuke Konishi Acked-by: David Sterba Signed-off-by: Al Viro --- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- arch/s390/hypfs/inode.c | 4 ++-- drivers/infiniband/hw/qib/qib_fs.c | 2 +- drivers/misc/ibmasm/ibmasmfs.c | 2 +- drivers/oprofile/oprofilefs.c | 2 +- drivers/usb/core/devio.c | 18 +++++++++--------- drivers/usb/gadget/function/f_fs.c | 8 ++++---- drivers/usb/gadget/legacy/inode.c | 2 +- fs/9p/vfs_inode.c | 2 +- fs/adfs/inode.c | 2 +- fs/autofs4/inode.c | 2 +- fs/autofs4/root.c | 6 +++--- fs/devpts/inode.c | 6 +++--- fs/efivarfs/inode.c | 2 +- fs/exofs/dir.c | 6 +++--- fs/exofs/inode.c | 4 ++-- fs/exofs/namei.c | 6 +++--- fs/ext2/super.c | 2 +- fs/f2fs/dir.c | 8 ++++---- fs/f2fs/file.c | 8 ++++---- fs/f2fs/inline.c | 2 +- fs/f2fs/namei.c | 12 ++++++------ fs/fuse/control.c | 2 +- fs/gfs2/bmap.c | 8 ++++---- fs/gfs2/dir.c | 12 ++++++------ fs/gfs2/inode.c | 8 ++++---- fs/gfs2/quota.c | 2 +- fs/gfs2/xattr.c | 8 ++++---- fs/hugetlbfs/inode.c | 10 +++++----- fs/jfs/acl.c | 2 +- fs/jfs/inode.c | 2 +- fs/jfs/jfs_inode.c | 2 +- fs/jfs/namei.c | 22 +++++++++++----------- fs/jfs/super.c | 2 +- fs/jfs/xattr.c | 2 +- fs/libfs.c | 14 +++++++------- fs/logfs/dir.c | 6 +++--- fs/logfs/file.c | 2 +- fs/logfs/inode.c | 4 ++-- fs/logfs/readwrite.c | 4 ++-- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 4 ++-- fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/namei.c | 6 +++--- fs/nsfs.c | 2 +- fs/ocfs2/acl.c | 2 +- fs/ocfs2/alloc.c | 2 +- fs/ocfs2/aops.c | 2 +- fs/ocfs2/dir.c | 4 ++-- fs/ocfs2/dlmfs/dlmfs.c | 4 ++-- fs/ocfs2/file.c | 12 ++++++------ fs/ocfs2/move_extents.c | 2 +- fs/ocfs2/namei.c | 10 +++++----- fs/ocfs2/refcounttree.c | 4 ++-- fs/ocfs2/xattr.c | 2 +- fs/omfs/inode.c | 2 +- fs/openpromfs/inode.c | 2 +- fs/orangefs/file.c | 2 +- fs/orangefs/inode.c | 2 +- fs/pipe.c | 2 +- fs/posix_acl.c | 2 +- fs/proc/base.c | 2 +- fs/proc/inode.c | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/proc/self.c | 2 +- fs/proc/thread_self.c | 2 +- fs/pstore/inode.c | 2 +- fs/ramfs/inode.c | 6 +++--- fs/tracefs/inode.c | 2 +- ipc/mqueue.c | 18 +++++++++--------- kernel/bpf/inode.c | 2 +- mm/shmem.c | 20 ++++++++++---------- net/sunrpc/rpc_pipe.c | 2 +- security/apparmor/apparmorfs.c | 2 +- security/inode.c | 2 +- security/selinux/selinuxfs.c | 2 +- 76 files changed, 182 insertions(+), 182 deletions(-) (limited to 'fs/jfs') diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 2975754c65ea..5364d4a54249 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -103,7 +103,7 @@ spufs_new_inode(struct super_block *sb, umode_t mode) inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); out: return inode; } diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 255c7eec4481..09bccb224d03 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -51,7 +51,7 @@ static void hypfs_update_update(struct super_block *sb) struct inode *inode = d_inode(sb_info->update_file); sb_info->last_update = get_seconds(); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); } /* directory tree removal functions */ @@ -99,7 +99,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode) ret->i_mode = mode; ret->i_uid = hypfs_info->uid; ret->i_gid = hypfs_info->gid; - ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; + ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); if (S_ISDIR(mode)) set_nlink(ret, 2); } diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c index c3edc033f7c4..f1e66efea98a 100644 --- a/drivers/infiniband/hw/qib/qib_fs.c +++ b/drivers/infiniband/hw/qib/qib_fs.c @@ -64,7 +64,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry, inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; inode->i_blocks = 0; - inode->i_atime = CURRENT_TIME; + inode->i_atime = current_time(inode); inode->i_mtime = inode->i_atime; inode->i_ctime = inode->i_atime; inode->i_private = data; diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 9c677f3f3c26..520f58439080 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c @@ -144,7 +144,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_ino = get_next_ino(); ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; + ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); } return ret; } diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index a0e5260bd006..134398e0231b 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c @@ -30,7 +30,7 @@ static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode) if (inode) { inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); } return inode; } diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 09c8d9ca61ae..4016dae7433b 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -2409,21 +2409,21 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL\n", __func__); ret = proc_control(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; case USBDEVFS_BULK: snoop(&dev->dev, "%s: BULK\n", __func__); ret = proc_bulk(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; case USBDEVFS_RESETEP: snoop(&dev->dev, "%s: RESETEP\n", __func__); ret = proc_resetep(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; case USBDEVFS_RESET: @@ -2435,7 +2435,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__); ret = proc_clearhalt(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; case USBDEVFS_GETDRIVER: @@ -2462,7 +2462,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB\n", __func__); ret = proc_submiturb(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; #ifdef CONFIG_COMPAT @@ -2470,14 +2470,14 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL32\n", __func__); ret = proc_control_compat(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; case USBDEVFS_BULK32: snoop(&dev->dev, "%s: BULK32\n", __func__); ret = proc_bulk_compat(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; case USBDEVFS_DISCSIGNAL32: @@ -2489,7 +2489,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB32\n", __func__); ret = proc_submiturb_compat(ps, p); if (ret >= 0) - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); break; case USBDEVFS_IOCTL32: @@ -2552,7 +2552,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, done: usb_unlock_device(dev); if (ret >= 0) - inode->i_atime = CURRENT_TIME; + inode->i_atime = current_time(inode); return ret; } diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 5c8429f23a89..2f3fa4dde695 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1193,15 +1193,15 @@ ffs_sb_make_inode(struct super_block *sb, void *data, inode = new_inode(sb); if (likely(inode)) { - struct timespec current_time = CURRENT_TIME; + struct timespec ts = current_time(inode); inode->i_ino = get_next_ino(); inode->i_mode = perms->mode; inode->i_uid = perms->uid; inode->i_gid = perms->gid; - inode->i_atime = current_time; - inode->i_mtime = current_time; - inode->i_ctime = current_time; + inode->i_atime = ts; + inode->i_mtime = ts; + inode->i_ctime = ts; inode->i_private = data; if (fops) inode->i_fop = fops; diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 16104b5ebdcb..bd82dd12deff 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -1913,7 +1913,7 @@ gadgetfs_make_inode (struct super_block *sb, inode->i_uid = make_kuid(&init_user_ns, default_uid); inode->i_gid = make_kgid(&init_user_ns, default_gid); inode->i_atime = inode->i_mtime = inode->i_ctime - = CURRENT_TIME; + = current_time(inode); inode->i_private = data; inode->i_fop = fops; } diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 8b1999b528e9..44fa598e6349 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -276,7 +276,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, inode_init_owner(inode, NULL, mode); inode->i_blocks = 0; inode->i_rdev = rdev; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_mapping->a_ops = &v9fs_addr_operations; switch (mode & S_IFMT) { diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 335055d828e4..860f3ec90c22 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -199,7 +199,7 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) return; cur_time: - *tv = CURRENT_TIME; + *tv = current_time(inode); return; too_early: diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 61b21051bd5a..ca9cbd6362e0 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c @@ -359,7 +359,7 @@ struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode) inode->i_uid = d_inode(sb->s_root)->i_uid; inode->i_gid = d_inode(sb->s_root)->i_gid; } - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_ino = get_next_ino(); if (S_ISDIR(mode)) { diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index fa84bb8832e0..623510e84c96 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -591,7 +591,7 @@ static int autofs4_dir_symlink(struct inode *dir, if (p_ino && !IS_ROOT(dentry)) atomic_inc(&p_ino->count); - dir->i_mtime = CURRENT_TIME; + dir->i_mtime = current_time(dir); return 0; } @@ -631,7 +631,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry) d_inode(dentry)->i_size = 0; clear_nlink(d_inode(dentry)); - dir->i_mtime = CURRENT_TIME; + dir->i_mtime = current_time(dir); spin_lock(&sbi->lookup_lock); __autofs4_add_expiring(dentry); @@ -762,7 +762,7 @@ static int autofs4_dir_mkdir(struct inode *dir, if (p_ino && !IS_ROOT(dentry)) atomic_inc(&p_ino->count); inc_nlink(dir); - dir->i_mtime = CURRENT_TIME; + dir->i_mtime = current_time(dir); return 0; } diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 79a5941c2474..9156c91def48 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -305,7 +305,7 @@ static int mknod_ptmx(struct super_block *sb) } inode->i_ino = 2; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); mode = S_IFCHR|opts->ptmxmode; init_special_inode(inode, mode, MKDEV(TTYAUX_MAJOR, 2)); @@ -411,7 +411,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) if (!inode) goto fail; inode->i_ino = 1; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; @@ -559,7 +559,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) inode->i_ino = index + 3; inode->i_uid = opts->setuid ? opts->uid : current_fsuid(); inode->i_gid = opts->setgid ? opts->gid : current_fsgid(); - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index)); sprintf(s, "%d", index); diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index 1d73fc6dba13..be5a33691f69 100644 --- a/fs/efivarfs/inode.c +++ b/fs/efivarfs/inode.c @@ -24,7 +24,7 @@ struct inode *efivarfs_get_inode(struct super_block *sb, if (inode) { inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_flags = is_removable ? 0 : S_IMMUTABLE; switch (mode & S_IFMT) { case S_IFREG: diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c index f69a1b5826a5..79101651fe9e 100644 --- a/fs/exofs/dir.c +++ b/fs/exofs/dir.c @@ -416,7 +416,7 @@ int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de, if (likely(!err)) err = exofs_commit_chunk(page, pos, len); exofs_put_page(page); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); mark_inode_dirty(dir); return err; } @@ -503,7 +503,7 @@ got_it: de->inode_no = cpu_to_le64(inode->i_ino); exofs_set_de_type(de, inode); err = exofs_commit_chunk(page, pos, rec_len); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); mark_inode_dirty(dir); sbi->s_numfiles++; @@ -554,7 +554,7 @@ int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page) dir->inode_no = 0; if (likely(!err)) err = exofs_commit_chunk(page, pos, to - from); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); mark_inode_dirty(inode); sbi->s_numfiles--; out: diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 9dc4c6dbf3c9..4327f71d302d 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c @@ -1007,7 +1007,7 @@ static int _do_truncate(struct inode *inode, loff_t newsize) struct exofs_sb_info *sbi = inode->i_sb->s_fs_info; int ret; - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); ret = ore_truncate(&sbi->layout, &oi->oc, (u64)newsize); if (likely(!ret)) @@ -1313,7 +1313,7 @@ struct inode *exofs_new_inode(struct inode *dir, umode_t mode) inode_init_owner(inode, dir, mode); inode->i_ino = sbi->s_nextid++; inode->i_blkbits = EXOFS_BLKSHIFT; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); oi->i_commit_size = inode->i_size = 0; spin_lock(&sbi->s_next_gen_lock); inode->i_generation = sbi->s_next_generation++; diff --git a/fs/exofs/namei.c b/fs/exofs/namei.c index 622a686bb08b..80c8114d76a6 100644 --- a/fs/exofs/namei.c +++ b/fs/exofs/namei.c @@ -142,7 +142,7 @@ static int exofs_link(struct dentry *old_dentry, struct inode *dir, { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); inode_inc_link_count(inode); ihold(inode); @@ -261,7 +261,7 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry, if (!new_de) goto out_dir; err = exofs_set_link(new_dir, new_de, new_page, old_inode); - new_inode->i_ctime = CURRENT_TIME; + new_inode->i_ctime = current_time(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); @@ -275,7 +275,7 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry, inode_inc_link_count(new_dir); } - old_inode->i_ctime = CURRENT_TIME; + old_inode->i_ctime = current_time(old_inode); exofs_delete_entry(old_de, old_page); mark_inode_dirty(old_inode); diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 1d9379568aa8..6cb042b53b5b 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1543,7 +1543,7 @@ out: if (inode->i_size < off+len-towrite) i_size_write(inode, off+len-towrite); inode->i_version++; - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); mark_inode_dirty(inode); return len - towrite; } diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 9054aeac8015..8e5309c532df 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -299,7 +299,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de, f2fs_dentry_kunmap(dir, page); set_page_dirty(page); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); f2fs_mark_inode_dirty_sync(dir); f2fs_put_page(page, 1); } @@ -451,7 +451,7 @@ void update_parent_metadata(struct inode *dir, struct inode *inode, f2fs_i_links_write(dir, true); clear_inode_flag(inode, FI_NEW_INODE); } - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); f2fs_mark_inode_dirty_sync(dir); if (F2FS_I(dir)->i_current_depth != current_depth) @@ -656,7 +656,7 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode) if (S_ISDIR(inode->i_mode)) f2fs_i_links_write(dir, false); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); f2fs_i_links_write(inode, false); if (S_ISDIR(inode->i_mode)) { @@ -703,7 +703,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, kunmap(page); /* kunmap - pair of f2fs_find_entry */ set_page_dirty(page); - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); f2fs_mark_inode_dirty_sync(dir); if (inode) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 28f4f4cbb8d8..b831d7662005 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -631,7 +631,7 @@ int f2fs_truncate(struct inode *inode) if (err) return err; - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); f2fs_mark_inode_dirty_sync(inode); return 0; } @@ -708,7 +708,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) if (err) return err; } - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); } } @@ -1395,7 +1395,7 @@ static long f2fs_fallocate(struct file *file, int mode, } if (!ret) { - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); f2fs_mark_inode_dirty_sync(inode); f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); } @@ -1487,7 +1487,7 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) fi->i_flags = flags; inode_unlock(inode); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); f2fs_set_inode_flags(inode); out: mnt_drop_write_file(filp); diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index ccea8735de59..b4af15b26a12 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -569,7 +569,7 @@ void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page, set_page_dirty(page); f2fs_put_page(page, 1); - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); f2fs_mark_inode_dirty_sync(dir); if (inode) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 73fa356f8fbb..dfb622ad86dc 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -46,7 +46,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) inode->i_ino = ino; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_generation = sbi->s_next_generation++; err = insert_inode_locked(inode); @@ -177,7 +177,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir, f2fs_balance_fs(sbi, true); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); ihold(inode); set_inode_flag(inode, FI_INC_LINK); @@ -718,7 +718,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, f2fs_set_link(new_dir, new_entry, new_page, old_inode); - new_inode->i_ctime = CURRENT_TIME; + new_inode->i_ctime = current_time(new_inode); down_write(&F2FS_I(new_inode)->i_sem); if (old_dir_entry) f2fs_i_links_write(new_inode, false); @@ -772,7 +772,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, file_set_enc_name(old_inode); up_write(&F2FS_I(old_inode)->i_sem); - old_inode->i_ctime = CURRENT_TIME; + old_inode->i_ctime = current_time(old_inode); f2fs_mark_inode_dirty_sync(old_inode); f2fs_delete_entry(old_entry, old_page, old_dir, NULL); @@ -927,7 +927,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, file_lost_pino(old_inode); up_write(&F2FS_I(old_inode)->i_sem); - old_dir->i_ctime = CURRENT_TIME; + old_dir->i_ctime = current_time(old_dir); if (old_nlink) { down_write(&F2FS_I(old_dir)->i_sem); f2fs_i_links_write(old_dir, old_nlink > 0); @@ -942,7 +942,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, file_lost_pino(new_inode); up_write(&F2FS_I(new_inode)->i_sem); - new_dir->i_ctime = CURRENT_TIME; + new_dir->i_ctime = current_time(new_dir); if (new_nlink) { down_write(&F2FS_I(new_dir)->i_sem); f2fs_i_links_write(new_dir, new_nlink > 0); diff --git a/fs/fuse/control.c b/fs/fuse/control.c index f863ac6647ac..6e22748b0704 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -220,7 +220,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, inode->i_mode = mode; inode->i_uid = fc->user_id; inode->i_gid = fc->group_id; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); /* setting ->i_op to NULL is not allowed */ if (iop) inode->i_op = iop; diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 6e2bec1cd289..945342202a5e 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -836,7 +836,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, gfs2_quota_change(ip, -(s64)btotal, ip->i_inode.i_uid, ip->i_inode.i_gid); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_dinode_out(ip, dibh->b_data); @@ -1063,7 +1063,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize) } i_size_write(inode, newsize); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_dinode_out(ip, dibh->b_data); if (journaled) @@ -1142,7 +1142,7 @@ static int trunc_end(struct gfs2_inode *ip) gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); gfs2_ordered_del_inode(ip); } - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG; gfs2_trans_add_meta(ip->i_gl, dibh); @@ -1252,7 +1252,7 @@ static int do_grow(struct inode *inode, u64 size) goto do_end_trans; i_size_write(inode, size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index fcb59b23f1e3..f75c9aef9f94 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -135,7 +135,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf, memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); if (ip->i_inode.i_size < offset + size) i_size_write(&ip->i_inode, offset + size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -233,7 +233,7 @@ out: if (ip->i_inode.i_size < offset + copied) i_size_write(&ip->i_inode, offset + copied); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); @@ -872,7 +872,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh, struct gfs2_leaf *leaf; struct gfs2_dirent *dent; struct qstr name = { .name = "" }; - struct timespec tv = CURRENT_TIME; + struct timespec tv = current_time(inode); error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL); if (error) @@ -1816,7 +1816,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, gfs2_inum_out(nip, dent); dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode)); dent->de_rahead = cpu_to_be16(gfs2_inode_ra_len(nip)); - tv = CURRENT_TIME; + tv = current_time(&ip->i_inode); if (ip->i_diskflags & GFS2_DIF_EXHASH) { leaf = (struct gfs2_leaf *)bh->b_data; be16_add_cpu(&leaf->lf_entries, 1); @@ -1878,7 +1878,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) const struct qstr *name = &dentry->d_name; struct gfs2_dirent *dent, *prev = NULL; struct buffer_head *bh; - struct timespec tv = CURRENT_TIME; + struct timespec tv = current_time(&dip->i_inode); /* Returns _either_ the entry (if its first in block) or the previous entry otherwise */ @@ -1960,7 +1960,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, gfs2_trans_add_meta(dip->i_gl, bh); } - dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME; + dip->i_inode.i_mtime = dip->i_inode.i_ctime = current_time(&dip->i_inode); gfs2_dinode_out(dip, bh->b_data); brelse(bh); return 0; diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e4da0ecd3285..a197a219eed9 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -652,7 +652,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, set_nlink(inode, S_ISDIR(mode) ? 2 : 1); inode->i_rdev = dev; inode->i_size = size; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); gfs2_set_inode_blocks(inode, 1); munge_mode_uid_gid(dip, inode); check_and_update_goal(dip); @@ -979,7 +979,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, gfs2_trans_add_meta(ip->i_gl, dibh); inc_nlink(&ip->i_inode); - ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_ctime = current_time(&ip->i_inode); ihold(inode); d_instantiate(dentry, inode); mark_inode_dirty(inode); @@ -1063,7 +1063,7 @@ static int gfs2_unlink_inode(struct gfs2_inode *dip, return error; ip->i_entries = 0; - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); if (S_ISDIR(inode->i_mode)) clear_nlink(inode); else @@ -1326,7 +1326,7 @@ static int update_moved_ino(struct gfs2_inode *ip, struct gfs2_inode *ndip, error = gfs2_meta_inode_buffer(ip, &dibh); if (error) return error; - ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 77930ca25303..422e640a5a9d 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -854,7 +854,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, size = loc + sizeof(struct gfs2_quota); if (size > inode->i_size) i_size_write(inode, size); - inode->i_mtime = inode->i_atime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = current_time(inode); mark_inode_dirty(inode); set_bit(QDF_REFRESH, &qd->qd_flags); } diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 3a2853504084..a4a577088d19 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -309,7 +309,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { - ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -775,7 +775,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er, error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { - ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -910,7 +910,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh, error = gfs2_meta_inode_buffer(ip, &dibh); if (error) goto out; - ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -1133,7 +1133,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el) error = gfs2_meta_inode_buffer(ip, &dibh); if (!error) { - ip->i_inode.i_ctime = CURRENT_TIME; + ip->i_inode.i_ctime = current_time(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 4ea71eba40a5..3053e200ec95 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -657,7 +657,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) i_size_write(inode, offset + len); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); out: inode_unlock(inode); return error; @@ -702,7 +702,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, inode->i_mode = S_IFDIR | config->mode; inode->i_uid = config->uid; inode->i_gid = config->gid; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); info = HUGETLBFS_I(inode); mpol_shared_policy_init(&info->policy, NULL); inode->i_op = &hugetlbfs_dir_inode_operations; @@ -741,7 +741,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, &hugetlbfs_i_mmap_rwsem_key); inode->i_mapping->a_ops = &hugetlbfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_mapping->private_data = resv_map; info = HUGETLBFS_I(inode); /* @@ -790,7 +790,7 @@ static int hugetlbfs_mknod(struct inode *dir, inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); if (inode) { - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ error = 0; @@ -827,7 +827,7 @@ static int hugetlbfs_symlink(struct inode *dir, } else iput(inode); } - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); return error; } diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index 21fa92ba2c19..4c1a6b5670df 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c @@ -81,7 +81,7 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type, rc = posix_acl_equiv_mode(acl, &inode->i_mode); if (rc < 0) return rc; - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); mark_inode_dirty(inode); if (rc == 0) acl = NULL; diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index ad3e7b1effc4..054cc761b426 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c @@ -403,7 +403,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length) break; } - ip->i_mtime = ip->i_ctime = CURRENT_TIME; + ip->i_mtime = ip->i_ctime = current_time(ip); mark_inode_dirty(ip); txCommit(tid, 1, &ip, 0); diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c index 5e33cb9a190d..375dd257a34f 100644 --- a/fs/jfs/jfs_inode.c +++ b/fs/jfs/jfs_inode.c @@ -131,7 +131,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) jfs_inode->mode2 |= inode->i_mode; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); jfs_inode->otime = inode->i_ctime.tv_sec; inode->i_generation = JFS_SBI(sb)->gengen++; diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 814b0c58016c..b05d0b4c68f6 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c @@ -162,7 +162,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode, mark_inode_dirty(ip); - dip->i_ctime = dip->i_mtime = CURRENT_TIME; + dip->i_ctime = dip->i_mtime = current_time(dip); mark_inode_dirty(dip); @@ -298,7 +298,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode) /* update parent directory inode */ inc_nlink(dip); /* for '..' from child directory */ - dip->i_ctime = dip->i_mtime = CURRENT_TIME; + dip->i_ctime = dip->i_mtime = current_time(dip); mark_inode_dirty(dip); rc = txCommit(tid, 2, &iplist[0], 0); @@ -406,7 +406,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) /* update parent directory's link count corresponding * to ".." entry of the target directory deleted */ - dip->i_ctime = dip->i_mtime = CURRENT_TIME; + dip->i_ctime = dip->i_mtime = current_time(dip); inode_dec_link_count(dip); /* @@ -528,7 +528,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) ASSERT(ip->i_nlink); - ip->i_ctime = dip->i_ctime = dip->i_mtime = CURRENT_TIME; + ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip); mark_inode_dirty(dip); /* update target's inode */ @@ -838,8 +838,8 @@ static int jfs_link(struct dentry *old_dentry, /* update object inode */ inc_nlink(ip); /* for new link */ - ip->i_ctime = CURRENT_TIME; - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + ip->i_ctime = current_time(ip); + dir->i_ctime = dir->i_mtime = current_time(dir); mark_inode_dirty(dir); ihold(ip); @@ -1039,7 +1039,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, mark_inode_dirty(ip); - dip->i_ctime = dip->i_mtime = CURRENT_TIME; + dip->i_ctime = dip->i_mtime = current_time(dip); mark_inode_dirty(dip); /* * commit update of parent directory and link object @@ -1215,7 +1215,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, tblk->xflag |= COMMIT_DELETE; tblk->u.ip = new_ip; } else { - new_ip->i_ctime = CURRENT_TIME; + new_ip->i_ctime = current_time(new_ip); mark_inode_dirty(new_ip); } } else { @@ -1278,7 +1278,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, /* * Update ctime on changed/moved inodes & mark dirty */ - old_ip->i_ctime = CURRENT_TIME; + old_ip->i_ctime = current_time(old_ip); mark_inode_dirty(old_ip); new_dir->i_ctime = new_dir->i_mtime = current_fs_time(new_dir->i_sb); @@ -1293,7 +1293,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, if (old_dir != new_dir) { iplist[ipcount++] = new_dir; - old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); mark_inode_dirty(old_dir); } @@ -1426,7 +1426,7 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry, mark_inode_dirty(ip); - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); mark_inode_dirty(dir); diff --git a/fs/jfs/super.c b/fs/jfs/super.c index cec8814a3b8b..85671f7f8518 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -830,7 +830,7 @@ out: if (inode->i_size < off+len-towrite) i_size_write(inode, off+len-towrite); inode->i_version++; - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); mark_inode_dirty(inode); inode_unlock(inode); return len - towrite; diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 0bf3c33aedff..c60f3d32ee91 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -658,7 +658,7 @@ static int ea_put(tid_t tid, struct inode *inode, struct ea_buffer *ea_buf, if (old_blocks) dquot_free_block(inode, old_blocks); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); return 0; } diff --git a/fs/libfs.c b/fs/libfs.c index 74dc8b9e7f53..cc9f7ef2a1ce 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -265,7 +265,7 @@ struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name, */ root->i_ino = 1; root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; - root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME; + root->i_atime = root->i_mtime = root->i_ctime = current_time(root); dentry = __d_alloc(s, &d_name); if (!dentry) { iput(root); @@ -295,7 +295,7 @@ int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *den { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); inc_nlink(inode); ihold(inode); dget(dentry); @@ -329,7 +329,7 @@ int simple_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); drop_nlink(inode); dput(dentry); return 0; @@ -369,7 +369,7 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry, } old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = - new_dir->i_mtime = inode->i_ctime = CURRENT_TIME; + new_dir->i_mtime = inode->i_ctime = current_time(old_dir); return 0; } @@ -520,7 +520,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic, */ inode->i_ino = 1; inode->i_mode = S_IFDIR | 0755; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; set_nlink(inode, 2); @@ -546,7 +546,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic, goto out; } inode->i_mode = S_IFREG | files->mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_fop = files->ops; inode->i_ino = i; d_add(dentry, inode); @@ -1092,7 +1092,7 @@ struct inode *alloc_anon_inode(struct super_block *s) inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); inode->i_flags |= S_PRIVATE; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); return inode; } EXPORT_SYMBOL(alloc_anon_inode); diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c index 9568064ecadf..a284dd8689a8 100644 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c @@ -226,7 +226,7 @@ static int logfs_unlink(struct inode *dir, struct dentry *dentry) ta->state = UNLINK_1; ta->ino = inode->i_ino; - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); page = logfs_get_dd_page(dir, dentry); if (!page) { @@ -540,7 +540,7 @@ static int logfs_link(struct dentry *old_dentry, struct inode *dir, { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); ihold(inode); inc_nlink(inode); mark_inode_dirty_sync(inode); @@ -573,7 +573,7 @@ static int logfs_delete_dd(struct inode *dir, loff_t pos) * (crc-protected) journal. */ BUG_ON(beyond_eof(dir, pos)); - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); log_dir(" Delete dentry (%lx, %llx)\n", dir->i_ino, pos); return logfs_delete(dir, pos, NULL); } diff --git a/fs/logfs/file.c b/fs/logfs/file.c index f01ddfb1a03b..dae4f312ffba 100644 --- a/fs/logfs/file.c +++ b/fs/logfs/file.c @@ -211,7 +211,7 @@ long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) li->li_flags = flags; inode_unlock(inode); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); mark_inode_dirty_sync(inode); return 0; diff --git a/fs/logfs/inode.c b/fs/logfs/inode.c index db9cfc598883..f440a1525da8 100644 --- a/fs/logfs/inode.c +++ b/fs/logfs/inode.c @@ -213,8 +213,8 @@ static void logfs_init_inode(struct super_block *sb, struct inode *inode) i_gid_write(inode, 0); inode->i_size = 0; inode->i_blocks = 0; - inode->i_ctime = CURRENT_TIME; - inode->i_mtime = CURRENT_TIME; + inode->i_ctime = current_time(inode); + inode->i_mtime = current_time(inode); li->li_refcount = 1; INIT_LIST_HEAD(&li->li_freeing_list); diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c index 3fb8c6d67303..bf19bf4a243f 100644 --- a/fs/logfs/readwrite.c +++ b/fs/logfs/readwrite.c @@ -1546,7 +1546,7 @@ static int __logfs_write_buf(struct inode *inode, struct page *page, long flags) int err; flags |= WF_WRITE | WF_DELETE; - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); logfs_unpack_index(index, &bix, &level); if (logfs_block(page) && logfs_block(page)->reserved_bytes) @@ -1578,7 +1578,7 @@ static int __logfs_delete(struct inode *inode, struct page *page) long flags = WF_DELETE; int err; - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); if (page->index < I0_BLOCKS) return logfs_write_direct(inode, page, flags); diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index 908ebbf0ac7e..582831ab3eb9 100644 --- a/fs/nilfs2/dir.c +++ b/fs/nilfs2/dir.c @@ -438,7 +438,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de, nilfs_set_de_type(de, inode); nilfs_commit_chunk(page, mapping, from, to); nilfs_put_page(page); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); } /* @@ -528,7 +528,7 @@ got_it: de->inode = cpu_to_le64(inode->i_ino); nilfs_set_de_type(de, inode); nilfs_commit_chunk(page, page->mapping, from, to); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); nilfs_mark_inode_dirty(dir); /* OFFSET_CACHE */ out_put: @@ -576,7 +576,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) pde->rec_len = nilfs_rec_len_to_disk(to - from); dir->inode = 0; nilfs_commit_chunk(page, mapping, from, to); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); out: nilfs_put_page(page); return err; diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index af04f553d7c9..bf084035f83c 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c @@ -367,7 +367,7 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode) atomic64_inc(&root->inodes_count); inode_init_owner(inode, dir, mode); inode->i_ino = ino; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) { err = nilfs_bmap_read(ii->i_bmap, NULL); @@ -749,7 +749,7 @@ void nilfs_truncate(struct inode *inode) nilfs_truncate_bmap(ii, blkoff); - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index f1d7989459fd..1d2c3d7711fe 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c @@ -174,7 +174,7 @@ static int nilfs_ioctl_setflags(struct inode *inode, struct file *filp, (flags & FS_FL_USER_MODIFIABLE); nilfs_set_inode_flags(inode); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c index dbcf1dc93a51..ace5ebf3b2a8 100644 --- a/fs/nilfs2/namei.c +++ b/fs/nilfs2/namei.c @@ -194,7 +194,7 @@ static int nilfs_link(struct dentry *old_dentry, struct inode *dir, if (err) return err; - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); inode_inc_link_count(inode); ihold(inode); @@ -391,7 +391,7 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, goto out_dir; nilfs_set_link(new_dir, new_de, new_page, old_inode); nilfs_mark_inode_dirty(new_dir); - new_inode->i_ctime = CURRENT_TIME; + new_inode->i_ctime = current_time(new_inode); if (dir_de) drop_nlink(new_inode); drop_nlink(new_inode); @@ -410,7 +410,7 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = CURRENT_TIME; + old_inode->i_ctime = current_time(old_inode); nilfs_delete_entry(old_de, old_page); diff --git a/fs/nsfs.c b/fs/nsfs.c index 8f20d6016e20..2b731bc2ae6d 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -82,7 +82,7 @@ slow: return ERR_PTR(-ENOMEM); } inode->i_ino = ns->inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_flags |= S_IMMUTABLE; inode->i_mode = S_IFREG | S_IRUGO; inode->i_fop = &ns_file_operations; diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index 2162434728c0..acf0012bfc9a 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -201,7 +201,7 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, } inode->i_mode = new_mode; - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); di->i_mode = cpu_to_le16(inode->i_mode); di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 7dabbc31060e..498e71141b53 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -7311,7 +7311,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, } inode->i_blocks = ocfs2_inode_sector_count(inode); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 98d36548153d..3a22be483af5 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -2020,7 +2020,7 @@ out_write_size: } inode->i_blocks = ocfs2_inode_sector_count(inode); di->i_size = cpu_to_le64((u64)i_size_read(inode)); - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 1); diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index e1adf285fc31..e7054e2ac922 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -1677,7 +1677,7 @@ int __ocfs2_add_entry(handle_t *handle, offset, ocfs2_dir_trailer_blk_off(dir->i_sb)); if (ocfs2_dirent_would_fit(de, rec_len)) { - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); if (retval < 0) { mlog_errno(retval); @@ -2990,7 +2990,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, ocfs2_dinode_new_extent_list(dir, di); i_size_write(dir, sb->s_blocksize); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); di->i_size = cpu_to_le64(sb->s_blocksize); di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec); diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index ef474cdd6404..f0d9763db126 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -398,7 +398,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) if (inode) { inode->i_ino = get_next_ino(); inode_init_owner(inode, NULL, mode); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inc_nlink(inode); inode->i_fop = &simple_dir_operations; @@ -421,7 +421,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent, inode->i_ino = get_next_ino(); inode_init_owner(inode, parent, mode); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); ip = DLMFS_I(inode); ip->ip_conn = DLMFS_I(parent)->ip_conn; diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 4e7b0dc22450..9adcac9dfda1 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -253,7 +253,7 @@ int ocfs2_should_update_atime(struct inode *inode, return 0; } - now = CURRENT_TIME; + now = current_time(inode); if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) return 0; else @@ -287,7 +287,7 @@ int ocfs2_update_inode_atime(struct inode *inode, * have i_mutex to guard against concurrent changes to other * inode fields. */ - inode->i_atime = CURRENT_TIME; + inode->i_atime = current_time(inode); di->i_atime = cpu_to_le64(inode->i_atime.tv_sec); di->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); @@ -308,7 +308,7 @@ int ocfs2_set_inode_size(handle_t *handle, i_size_write(inode, new_i_size); inode->i_blocks = ocfs2_inode_sector_count(inode); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); if (status < 0) { @@ -429,7 +429,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, } i_size_write(inode, new_i_size); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); di = (struct ocfs2_dinode *) fe_bh->b_data; di->i_size = cpu_to_le64(new_i_size); @@ -840,7 +840,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, i_size_write(inode, abs_to); inode->i_blocks = ocfs2_inode_sector_count(inode); di->i_size = cpu_to_le64((u64)i_size_read(inode)); - inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = current_time(inode); di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); di->i_mtime_nsec = di->i_ctime_nsec; @@ -1936,7 +1936,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, if (change_size && i_size_read(inode) < size) i_size_write(inode, size); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); if (ret < 0) mlog_errno(ret); diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index e3d05d9901a3..4e8f32eb0bdb 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -953,7 +953,7 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context) } di = (struct ocfs2_dinode *)di_bh->b_data; - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index a8f1225e6d9b..e2747d8d0552 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -798,7 +798,7 @@ static int ocfs2_link(struct dentry *old_dentry, } inc_nlink(inode); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); ocfs2_set_links_count(fe, inode->i_nlink); fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); @@ -1000,7 +1000,7 @@ static int ocfs2_unlink(struct inode *dir, ocfs2_set_links_count(fe, inode->i_nlink); ocfs2_journal_dirty(handle, fe_bh); - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); if (S_ISDIR(inode->i_mode)) drop_nlink(dir); @@ -1537,7 +1537,7 @@ static int ocfs2_rename(struct inode *old_dir, new_dir_bh, &target_insert); } - old_inode->i_ctime = CURRENT_TIME; + old_inode->i_ctime = current_time(old_inode); mark_inode_dirty(old_inode); status = ocfs2_journal_access_di(handle, INODE_CACHE(old_inode), @@ -1586,9 +1586,9 @@ static int ocfs2_rename(struct inode *old_dir, if (new_inode) { drop_nlink(new_inode); - new_inode->i_ctime = CURRENT_TIME; + new_inode->i_ctime = current_time(new_inode); } - old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); if (update_dot_dot) { status = ocfs2_update_entry(old_inode, handle, diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 92bbe93bfe10..19238512a324 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -3778,7 +3778,7 @@ static int ocfs2_change_ctime(struct inode *inode, goto out_commit; } - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); @@ -4094,7 +4094,7 @@ static int ocfs2_complete_reflink(struct inode *s_inode, * we want mtime to appear identical to the source and * update ctime. */ - t_inode->i_ctime = CURRENT_TIME; + t_inode->i_ctime = current_time(t_inode); di->i_ctime = cpu_to_le64(t_inode->i_ctime.tv_sec); di->i_ctime_nsec = cpu_to_le32(t_inode->i_ctime.tv_nsec); diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 5bb44f7a78ee..cb157a34a656 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -3431,7 +3431,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, goto out; } - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); ocfs2_journal_dirty(ctxt->handle, xis->inode_bh); diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 3d935c81789a..df7ea8543a2e 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -49,7 +49,7 @@ struct inode *omfs_new_inode(struct inode *dir, umode_t mode) inode_init_owner(inode, NULL, mode); inode->i_mapping->a_ops = &omfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_op = &omfs_dir_inops; diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index c7a86993d97e..c003a667ed1a 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -355,7 +355,7 @@ static struct inode *openprom_iget(struct super_block *sb, ino_t ino) if (!inode) return ERR_PTR(-ENOMEM); if (inode->i_state & I_NEW) { - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); if (inode->i_ino == OPENPROM_ROOT_INO) { inode->i_op = &openprom_inode_operations; inode->i_fop = &openprom_operations; diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 526040e09f78..e799bb4474f6 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -358,7 +358,7 @@ out: file_accessed(file); } else { SetMtimeFlag(orangefs_inode); - inode->i_mtime = CURRENT_TIME; + inode->i_mtime = current_time(inode); mark_inode_dirty_sync(inode); } } diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 28a0557a69be..113d928d1223 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -438,7 +438,7 @@ struct inode *orangefs_new_inode(struct super_block *sb, struct inode *dir, inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_size = PAGE_SIZE; inode->i_rdev = dev; diff --git a/fs/pipe.c b/fs/pipe.c index 4ebe6b2e5217..5c7c8b7726b8 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -716,7 +716,7 @@ static struct inode * get_pipe_inode(void) inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); return inode; diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 59d47ab0791a..ad0799c8b59b 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -897,7 +897,7 @@ int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type) acl = NULL; } - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); set_cached_acl(inode, type, acl); return 0; } diff --git a/fs/proc/base.c b/fs/proc/base.c index ac0df4dde823..029161d85355 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1664,7 +1664,7 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t /* Common stuff */ ei = PROC_I(inode); inode->i_ino = get_next_ino(); - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_op = &proc_def_inode_operations; /* diff --git a/fs/proc/inode.c b/fs/proc/inode.c index ce1f1a919902..e69ebe648a34 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -420,7 +420,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) if (inode) { inode->i_ino = de->low_ino; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); PROC_I(inode)->pde = de; if (is_empty_pde(de)) { diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 1b93650dda2f..f9e2f7a31abd 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -444,7 +444,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, ei->sysctl = head; ei->sysctl_entry = table; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_mode = table->mode; if (!S_ISDIR(table->mode)) { inode->i_mode |= S_IFREG; diff --git a/fs/proc/self.c b/fs/proc/self.c index b6a8d3529fea..40245954c450 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c @@ -56,7 +56,7 @@ int proc_setup_self(struct super_block *s) struct inode *inode = new_inode_pseudo(s); if (inode) { inode->i_ino = self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index e58a31e8fb2a..595b90a9766c 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c @@ -58,7 +58,7 @@ int proc_setup_thread_self(struct super_block *s) struct inode *inode = new_inode_pseudo(s); if (inode) { inode->i_ino = thread_self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index ec9ddef5ae75..1781dc50762e 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -230,7 +230,7 @@ static struct inode *pstore_get_inode(struct super_block *sb) struct inode *inode = new_inode(sb); if (inode) { inode->i_ino = get_next_ino(); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); } return inode; } diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index 1ab6e6c2e60e..8621c039b536 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -61,7 +61,7 @@ struct inode *ramfs_get_inode(struct super_block *sb, inode->i_mapping->a_ops = &ramfs_aops; mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); mapping_set_unevictable(inode->i_mapping); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); switch (mode & S_IFMT) { default: init_special_inode(inode, mode, dev); @@ -100,7 +100,7 @@ ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ error = 0; - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); } return error; } @@ -130,7 +130,7 @@ static int ramfs_symlink(struct inode * dir, struct dentry *dentry, const char * if (!error) { d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_time(dir); } else iput(inode); } diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index ad40b64c5e2f..21d36d284735 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -133,7 +133,7 @@ static struct inode *tracefs_get_inode(struct super_block *sb) struct inode *inode = new_inode(sb); if (inode) { inode->i_ino = get_next_ino(); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); } return inode; } diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 0b13ace266f2..8cbd6e6894d5 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -225,7 +225,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_mtime = inode->i_ctime = inode->i_atime = CURRENT_TIME; + inode->i_mtime = inode->i_ctime = inode->i_atime = current_time(inode); if (S_ISREG(mode)) { struct mqueue_inode_info *info; @@ -446,7 +446,7 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry, put_ipc_ns(ipc_ns); dir->i_size += DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = dir->i_atime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); d_instantiate(dentry, inode); dget(dentry); @@ -462,7 +462,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - dir->i_ctime = dir->i_mtime = dir->i_atime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); dir->i_size -= DIRENT_SIZE; drop_nlink(inode); dput(dentry); @@ -500,7 +500,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, if (ret <= 0) return ret; - file_inode(filp)->i_atime = file_inode(filp)->i_ctime = CURRENT_TIME; + file_inode(filp)->i_atime = file_inode(filp)->i_ctime = current_time(file_inode(filp)); return ret; } @@ -1060,7 +1060,7 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, __do_notify(info); } inode->i_atime = inode->i_mtime = inode->i_ctime = - CURRENT_TIME; + current_time(inode); } out_unlock: spin_unlock(&info->lock); @@ -1156,7 +1156,7 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, msg_ptr = msg_get(info); inode->i_atime = inode->i_mtime = inode->i_ctime = - CURRENT_TIME; + current_time(inode); /* There is now free space in queue. */ pipelined_receive(&wake_q, info); @@ -1277,7 +1277,7 @@ retry: if (u_notification == NULL) { if (info->notify_owner == task_tgid(current)) { remove_notification(info); - inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_ctime = current_time(inode); } } else if (info->notify_owner != NULL) { ret = -EBUSY; @@ -1302,7 +1302,7 @@ retry: info->notify_owner = get_pid(task_tgid(current)); info->notify_user_ns = get_user_ns(current_user_ns()); - inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_ctime = current_time(inode); } spin_unlock(&info->lock); out_fput: @@ -1359,7 +1359,7 @@ SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, f.file->f_flags &= ~O_NONBLOCK; spin_unlock(&f.file->f_lock); - inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_ctime = current_time(inode); } spin_unlock(&info->lock); diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index 5967b870a895..1ed8473ec537 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -97,7 +97,7 @@ static struct inode *bpf_get_inode(struct super_block *sb, return ERR_PTR(-ENOSPC); inode->i_ino = get_next_ino(); - inode->i_atime = CURRENT_TIME; + inode->i_atime = current_time(inode); inode->i_mtime = inode->i_atime; inode->i_ctime = inode->i_atime; diff --git a/mm/shmem.c b/mm/shmem.c index fd8b2b5741b1..28ae88bbeffa 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -933,7 +933,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) { shmem_undo_range(inode, lstart, lend, false); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); } EXPORT_SYMBOL_GPL(shmem_truncate_range); @@ -978,7 +978,7 @@ static int shmem_setattr(struct dentry *dentry, struct iattr *attr) if (error) return error; i_size_write(inode, newsize); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; + inode->i_ctime = inode->i_mtime = current_time(inode); } if (newsize <= oldsize) { loff_t holebegin = round_up(newsize, PAGE_SIZE); @@ -2082,7 +2082,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode inode->i_ino = get_next_ino(); inode_init_owner(inode, dir, mode); inode->i_blocks = 0; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_generation = get_seconds(); info = SHMEM_I(inode); memset(info, 0, (char *)inode - (char *)info); @@ -2853,7 +2853,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) i_size_write(inode, offset + len); - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); undone: spin_lock(&inode->i_lock); inode->i_private = NULL; @@ -2906,7 +2906,7 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) error = 0; dir->i_size += BOGO_DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ } @@ -2974,7 +2974,7 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr goto out; dir->i_size += BOGO_DIRENT_SIZE; - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); inc_nlink(inode); ihold(inode); /* New dentry reference */ dget(dentry); /* Extra pinning count for the created dentry */ @@ -2991,7 +2991,7 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry) shmem_free_inode(inode->i_sb); dir->i_size -= BOGO_DIRENT_SIZE; - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); drop_nlink(inode); dput(dentry); /* Undo the count from "create" - this does all the work */ return 0; @@ -3024,7 +3024,7 @@ static int shmem_exchange(struct inode *old_dir, struct dentry *old_dentry, stru old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = new_dir->i_mtime = d_inode(old_dentry)->i_ctime = - d_inode(new_dentry)->i_ctime = CURRENT_TIME; + d_inode(new_dentry)->i_ctime = current_time(old_dir); return 0; } @@ -3098,7 +3098,7 @@ static int shmem_rename2(struct inode *old_dir, struct dentry *old_dentry, struc new_dir->i_size += BOGO_DIRENT_SIZE; old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = new_dir->i_mtime = - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(old_dir); return 0; } @@ -3153,7 +3153,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s put_page(page); } dir->i_size += BOGO_DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = CURRENT_TIME; + dir->i_ctime = dir->i_mtime = current_time(dir); d_instantiate(dentry, inode); dget(dentry); return 0; diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 84f98cbe31c3..61a504fb1ae2 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -477,7 +477,7 @@ rpc_get_inode(struct super_block *sb, umode_t mode) return NULL; inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_fop = &simple_dir_operations; diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 729e595119ed..5923d5665209 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -381,7 +381,7 @@ void __aa_fs_profile_migrate_dents(struct aa_profile *old, for (i = 0; i < AAFS_PROF_SIZEOF; i++) { new->dents[i] = old->dents[i]; if (new->dents[i]) - new->dents[i]->d_inode->i_mtime = CURRENT_TIME; + new->dents[i]->d_inode->i_mtime = current_time(new->dents[i]->d_inode); old->dents[i] = NULL; } } diff --git a/security/inode.c b/security/inode.c index e3df905ab5b1..9cb979d2b013 100644 --- a/security/inode.c +++ b/security/inode.c @@ -117,7 +117,7 @@ struct dentry *securityfs_create_file(const char *name, umode_t mode, inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_private = data; if (is_dir) { inode->i_op = &simple_dir_inode_operations; diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 0765c5b053b5..72c145dd799f 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -1089,7 +1089,7 @@ static struct inode *sel_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; + ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); } return ret; } -- cgit v1.2.3 From c2050a454c7f123d7a57fa1d76ff61bd43643abb Mon Sep 17 00:00:00 2001 From: Deepa Dinamani Date: Wed, 14 Sep 2016 07:48:06 -0700 Subject: fs: Replace current_fs_time() with current_time() current_fs_time() uses struct super_block* as an argument. As per Linus's suggestion, this is changed to take struct inode* as a parameter instead. This is because the function is primarily meant for vfs inode timestamps. Also the function was renamed as per Arnd's suggestion. Change all calls to current_fs_time() to use the new current_time() function instead. current_fs_time() will be deleted. Signed-off-by: Deepa Dinamani Signed-off-by: Al Viro --- drivers/char/sonypi.c | 2 +- drivers/platform/x86/sony-laptop.c | 2 +- fs/attr.c | 2 +- fs/bad_inode.c | 2 +- fs/binfmt_misc.c | 2 +- fs/btrfs/file.c | 6 +++--- fs/btrfs/inode.c | 22 +++++++++++----------- fs/btrfs/ioctl.c | 8 ++++---- fs/btrfs/transaction.c | 4 ++-- fs/btrfs/xattr.c | 2 +- fs/ceph/file.c | 4 ++-- fs/ceph/inode.c | 2 +- fs/ceph/xattr.c | 2 +- fs/cifs/file.c | 4 ++-- fs/configfs/inode.c | 6 +++--- fs/debugfs/inode.c | 2 +- fs/f2fs/xattr.c | 2 +- fs/fat/file.c | 2 +- fs/fuse/dir.c | 2 +- fs/inode.c | 6 +++--- fs/jfs/namei.c | 2 +- fs/kernfs/inode.c | 2 +- fs/locks.c | 2 +- fs/nfsd/blocklayout.c | 2 +- fs/ntfs/inode.c | 2 +- fs/ntfs/mft.c | 2 +- fs/orangefs/namei.c | 10 +++++----- fs/udf/ialloc.c | 2 +- fs/udf/inode.c | 4 ++-- fs/udf/namei.c | 20 ++++++++++---------- fs/xfs/xfs_acl.c | 2 +- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_trans_inode.c | 2 +- 34 files changed, 70 insertions(+), 70 deletions(-) (limited to 'fs/jfs') diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index e496daefe9e0..719c5b4eed39 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -934,7 +934,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf, if (ret > 0) { struct inode *inode = file_inode(file); - inode->i_atime = current_fs_time(inode->i_sb); + inode->i_atime = current_time(inode); } return ret; diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 1dba3598cfcb..c890a49587e4 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -4116,7 +4116,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf, if (ret > 0) { struct inode *inode = file_inode(file); - inode->i_atime = current_fs_time(inode->i_sb); + inode->i_atime = current_time(inode); } return ret; diff --git a/fs/attr.c b/fs/attr.c index 42bb42bb3c72..236d11300216 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -209,7 +209,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de inode->i_flags &= ~S_NOSEC; } - now = current_fs_time(inode->i_sb); + now = current_time(inode); attr->ia_ctime = now; if (!(ia_valid & ATTR_ATIME_SET)) diff --git a/fs/bad_inode.c b/fs/bad_inode.c index 3ba385eaa26e..3c8ec390b446 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@ -173,7 +173,7 @@ 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_fop = &bad_file_ops; } diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 6103a6362ccd..9b4688ab1d8e 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -584,7 +584,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) inode->i_ino = get_next_ino(); inode->i_mode = mode; inode->i_atime = inode->i_mtime = inode->i_ctime = - current_fs_time(inode->i_sb); + current_time(inode); } return inode; } diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fea31a4a6e36..dad53ce54d91 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1757,7 +1757,7 @@ static void update_time_for_write(struct inode *inode) if (IS_NOCMTIME(inode)) return; - now = current_fs_time(inode->i_sb); + now = current_time(inode); if (!timespec_equal(&inode->i_mtime, &now)) inode->i_mtime = now; @@ -2578,7 +2578,7 @@ out_trans: goto out_free; inode_inc_iversion(inode); - inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_mtime = inode->i_ctime = current_time(inode); trans->block_rsv = &root->fs_info->trans_block_rsv; ret = btrfs_update_inode(trans, root, inode); @@ -2842,7 +2842,7 @@ static long btrfs_fallocate(struct file *file, int mode, if (IS_ERR(trans)) { ret = PTR_ERR(trans); } else { - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); i_size_write(inode, actual_end); btrfs_ordered_update_i_size(inode, actual_end, NULL); ret = btrfs_update_inode(trans, root, inode); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e6811c42e41e..2924774343e3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4059,7 +4059,7 @@ err: inode_inc_iversion(inode); inode_inc_iversion(dir); inode->i_ctime = dir->i_mtime = - dir->i_ctime = current_fs_time(inode->i_sb); + dir->i_ctime = current_time(inode); ret = btrfs_update_inode(trans, root, dir); out: return ret; @@ -4202,7 +4202,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, btrfs_i_size_write(dir, dir->i_size - name_len * 2); inode_inc_iversion(dir); - dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb); + dir->i_mtime = dir->i_ctime = current_time(dir); ret = btrfs_update_inode_fallback(trans, root, dir); if (ret) btrfs_abort_transaction(trans, ret); @@ -4965,7 +4965,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr) inode_inc_iversion(inode); if (!(mask & (ATTR_CTIME | ATTR_MTIME))) inode->i_ctime = inode->i_mtime = - current_fs_time(inode->i_sb); + current_time(inode); } if (newsize > oldsize) { @@ -5672,7 +5672,7 @@ static struct inode *new_simple_dir(struct super_block *s, inode->i_op = &btrfs_dir_ro_inode_operations; inode->i_fop = &simple_dir_operations; inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; - inode->i_mtime = current_fs_time(inode->i_sb); + inode->i_mtime = current_time(inode); inode->i_atime = inode->i_mtime; inode->i_ctime = inode->i_mtime; BTRFS_I(inode)->i_otime = inode->i_mtime; @@ -6258,7 +6258,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, inode_init_owner(inode, dir, mode); inode_set_bytes(inode, 0); - inode->i_mtime = current_fs_time(inode->i_sb); + inode->i_mtime = current_time(inode); inode->i_atime = inode->i_mtime; inode->i_ctime = inode->i_mtime; BTRFS_I(inode)->i_otime = inode->i_mtime; @@ -6372,7 +6372,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, name_len * 2); inode_inc_iversion(parent_inode); parent_inode->i_mtime = parent_inode->i_ctime = - current_fs_time(parent_inode->i_sb); + current_time(parent_inode); ret = btrfs_update_inode(trans, root, parent_inode); if (ret) btrfs_abort_transaction(trans, ret); @@ -6590,7 +6590,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, BTRFS_I(inode)->dir_index = 0ULL; inc_nlink(inode); inode_inc_iversion(inode); - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); ihold(inode); set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); @@ -9492,7 +9492,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, struct btrfs_root *dest = BTRFS_I(new_dir)->root; struct inode *new_inode = new_dentry->d_inode; struct inode *old_inode = old_dentry->d_inode; - struct timespec ctime = CURRENT_TIME; + struct timespec ctime = current_time(old_inode); struct dentry *parent; u64 old_ino = btrfs_ino(old_inode); u64 new_ino = btrfs_ino(new_inode); @@ -9860,7 +9860,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, inode_inc_iversion(old_inode); old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = new_dir->i_mtime = - old_inode->i_ctime = current_fs_time(old_dir->i_sb); + old_inode->i_ctime = current_time(old_dir); if (old_dentry->d_parent != new_dentry->d_parent) btrfs_record_unlink_dir(trans, old_dir, old_inode, 1); @@ -9885,7 +9885,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, if (new_inode) { inode_inc_iversion(new_inode); - new_inode->i_ctime = current_fs_time(new_inode->i_sb); + new_inode->i_ctime = current_time(new_inode); if (unlikely(btrfs_ino(new_inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { root_objectid = BTRFS_I(new_inode)->location.objectid; @@ -10403,7 +10403,7 @@ next: *alloc_hint = ins.objectid + ins.offset; inode_inc_iversion(inode); - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; if (!(mode & FALLOC_FL_KEEP_SIZE) && (actual_len > inode->i_size) && diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b2a2da5893af..c48e37444717 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -349,7 +349,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) btrfs_update_iflags(inode); inode_inc_iversion(inode); - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); ret = btrfs_update_inode(trans, root, inode); btrfs_end_transaction(trans, root); @@ -445,7 +445,7 @@ static noinline int create_subvol(struct inode *dir, struct btrfs_root *root = BTRFS_I(dir)->root; struct btrfs_root *new_root; struct btrfs_block_rsv block_rsv; - struct timespec cur_time = current_fs_time(dir->i_sb); + struct timespec cur_time = current_time(dir); struct inode *inode; int ret; int err; @@ -3279,7 +3279,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans, inode_inc_iversion(inode); if (!no_time_update) - inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_mtime = inode->i_ctime = current_time(inode); /* * We round up to the block size at eof when determining which * extents to clone above, but shouldn't round up the file size. @@ -5094,7 +5094,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file, struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_root_item *root_item = &root->root_item; struct btrfs_trans_handle *trans; - struct timespec ct = current_fs_time(inode->i_sb); + struct timespec ct = current_time(inode); int ret = 0; int received_uuid_changed; diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 95d41919d034..c294313ea2c8 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1474,7 +1474,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, parent_root = BTRFS_I(parent_inode)->root; record_root_in_trans(trans, parent_root, 0); - cur_time = current_fs_time(parent_inode->i_sb); + cur_time = current_time(parent_inode); /* * insert the directory item @@ -1630,7 +1630,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, btrfs_i_size_write(parent_inode, parent_inode->i_size + dentry->d_name.len * 2); parent_inode->i_mtime = parent_inode->i_ctime = - current_fs_time(parent_inode->i_sb); + current_time(parent_inode); ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode); if (ret) { btrfs_abort_transaction(trans, ret); diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index d1a177a3dbe8..fccbf5567e78 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -252,7 +252,7 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans, goto out; inode_inc_iversion(inode); - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); ret = btrfs_update_inode(trans, root, inode); BUG_ON(ret); diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 0f5375d8e030..a37a343fbd0f 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -886,7 +886,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, int num_pages = 0; int flags; int ret; - struct timespec mtime = current_fs_time(inode->i_sb); + struct timespec mtime = current_time(inode); size_t count = iov_iter_count(iter); loff_t pos = iocb->ki_pos; bool write = iov_iter_rw(iter) == WRITE; @@ -1091,7 +1091,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos, int flags; int check_caps = 0; int ret; - struct timespec mtime = current_fs_time(inode->i_sb); + struct timespec mtime = current_time(inode); size_t count = iov_iter_count(from); if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index dd3a6dbf71eb..ca1ccf741771 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2080,7 +2080,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) if (dirtied) { inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, &prealloc_cf); - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); } release &= issued; diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index adc231892b0d..40b703217977 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -1034,7 +1034,7 @@ retry: dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL, &prealloc_cf); ci->i_xattrs.dirty = true; - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); } spin_unlock(&ci->i_ceph_lock); diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 579e41b350a2..00b6bf08cdba 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1878,7 +1878,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) write_data, to - from, &offset); cifsFileInfo_put(open_file); /* Does mm or vfs already set times? */ - inode->i_atime = inode->i_mtime = current_fs_time(inode->i_sb); + inode->i_atime = inode->i_mtime = current_time(inode); if ((bytes_written > 0) && (offset)) rc = 0; else if (bytes_written < 0) @@ -3571,7 +3571,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page, cifs_dbg(FYI, "Bytes read %d\n", rc); file_inode(file)->i_atime = - current_fs_time(file_inode(file)->i_sb); + current_time(file_inode(file)); if (PAGE_SIZE > rc) memset(read_data + rc, 0, PAGE_SIZE - rc); diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index 0387968e6f47..ad718e5e37bb 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -76,7 +76,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) sd_iattr->ia_uid = GLOBAL_ROOT_UID; sd_iattr->ia_gid = GLOBAL_ROOT_GID; sd_iattr->ia_atime = sd_iattr->ia_mtime = - sd_iattr->ia_ctime = current_fs_time(inode->i_sb); + sd_iattr->ia_ctime = current_time(inode); sd->s_iattr = sd_iattr; } /* attributes were changed atleast once in past */ @@ -113,7 +113,7 @@ static inline void set_default_inode_attr(struct inode * inode, umode_t mode) { inode->i_mode = mode; inode->i_atime = inode->i_mtime = - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); } static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) @@ -197,7 +197,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in return -ENOMEM; p_inode = d_inode(dentry->d_parent); - p_inode->i_mtime = p_inode->i_ctime = current_fs_time(p_inode->i_sb); + p_inode->i_mtime = p_inode->i_ctime = current_time(p_inode); configfs_set_inode_lock_class(sd, inode); init(inode); diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 72361baf9da7..56a3c82a5785 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -45,7 +45,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb) if (inode) { inode->i_ino = get_next_ino(); inode->i_atime = inode->i_mtime = - inode->i_ctime = current_fs_time(sb); + inode->i_ctime = current_time(inode); } return inode; } diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index c8898b5148eb..62f76ea6cb3c 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -541,7 +541,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, if (is_inode_flag_set(inode, FI_ACL_MODE)) { inode->i_mode = F2FS_I(inode)->i_acl_mode; - inode->i_ctime = CURRENT_TIME; + inode->i_ctime = current_time(inode); clear_inode_flag(inode, FI_ACL_MODE); } if (index == F2FS_XATTR_INDEX_ENCRYPTION && diff --git a/fs/fat/file.c b/fs/fat/file.c index 811bbe0ab7a3..fc71ff524367 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c @@ -63,7 +63,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr) /* Equivalent to a chmod() */ ia.ia_valid = ATTR_MODE | ATTR_CTIME; - ia.ia_ctime = current_fs_time(inode->i_sb); + ia.ia_ctime = current_time(inode); if (is_dir) ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO); else { diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index c47b7780ce37..8de80dc563c5 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -637,7 +637,7 @@ static int fuse_symlink(struct inode *dir, struct dentry *entry, static inline 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 --git a/fs/inode.c b/fs/inode.c index 2172d0f77011..cadf75fb579e 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1636,7 +1636,7 @@ bool atime_needs_update(const struct path *path, struct inode *inode) 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)) return false; @@ -1670,7 +1670,7 @@ void touch_atime(const struct path *path) * We may also fail on filesystems that have the ability to make parts * of the fs read only, e.g. subvolumes in Btrfs. */ - now = current_fs_time(inode->i_sb); + now = current_time(inode); update_time(inode, &now, S_ATIME); __mnt_drop_write(mnt); skip_update: @@ -1793,7 +1793,7 @@ int file_update_time(struct file *file) if (IS_NOCMTIME(inode)) return 0; - now = current_fs_time(inode->i_sb); + now = current_time(inode); if (!timespec_equal(&inode->i_mtime, &now)) sync_it = S_MTIME; diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index b05d0b4c68f6..10449c1deac0 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c @@ -1281,7 +1281,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, old_ip->i_ctime = current_time(old_ip); mark_inode_dirty(old_ip); - new_dir->i_ctime = new_dir->i_mtime = current_fs_time(new_dir->i_sb); + new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); mark_inode_dirty(new_dir); /* Build list of inodes modified by this transaction */ diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index 63b925d5ba1e..43f6848266d5 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c @@ -241,7 +241,7 @@ static inline void set_default_inode_attr(struct inode *inode, umode_t mode) { inode->i_mode = mode; inode->i_atime = inode->i_mtime = - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); } static inline void set_inode_attr(struct inode *inode, struct iattr *iattr) diff --git a/fs/locks.c b/fs/locks.c index ee1b15f6fc13..b5152b067f37 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1539,7 +1539,7 @@ void lease_get_mtime(struct inode *inode, struct timespec *time) } if (has_lease) - *time = current_fs_time(inode->i_sb); + *time = current_time(inode); else *time = inode->i_mtime; } diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 5a1708441510..0780ff864539 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -123,7 +123,7 @@ nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp, if (lcp->lc_mtime.tv_nsec == UTIME_NOW || timespec_compare(&lcp->lc_mtime, &inode->i_mtime) < 0) - lcp->lc_mtime = current_fs_time(inode->i_sb); + lcp->lc_mtime = current_time(inode); iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime; diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index e01287c964a8..6b7588a6f98c 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -2813,7 +2813,7 @@ done: * for real. */ if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { - struct timespec now = current_fs_time(VFS_I(base_ni)->i_sb); + struct timespec now = current_time(VFS_I(base_ni)); int sync_it = 0; if (!timespec_equal(&VFS_I(base_ni)->i_mtime, &now) || diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index d15d492ce47b..d3c009626032 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -2692,7 +2692,7 @@ mft_rec_already_initialized: /* Set the inode times to the current time. */ vi->i_atime = vi->i_mtime = vi->i_ctime = - current_fs_time(vi->i_sb); + current_time(vi); /* * Set the file size to 0, the ntfs inode sizes are set to 0 by * the call to ntfs_init_big_inode() below. diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c index 62c525936ee8..e1ab95529231 100644 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -81,7 +81,7 @@ static int orangefs_create(struct inode *dir, dentry->d_name.name); 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: @@ -254,7 +254,7 @@ static int orangefs_unlink(struct inode *dir, struct dentry *dentry) drop_nlink(inode); 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); } return ret; @@ -331,7 +331,7 @@ static int orangefs_symlink(struct inode *dir, dentry->d_name.name); 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: @@ -399,7 +399,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode * across clients; keep constant at 1. */ 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); out: op_release(new_op); @@ -443,7 +443,7 @@ static int orangefs_rename(struct inode *old_dir, ret); if (new_dentry->d_inode) - new_dentry->d_inode->i_ctime = CURRENT_TIME; + new_dentry->d_inode->i_ctime = current_time(new_dentry->d_inode); op_release(new_op); return ret; diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index e77db621ec89..c1ed18a10ce4 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c @@ -121,7 +121,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) else iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; inode->i_mtime = inode->i_atime = inode->i_ctime = - iinfo->i_crtime = current_fs_time(inode->i_sb); + iinfo->i_crtime = current_time(inode); if (unlikely(insert_inode_locked(inode) < 0)) { make_bad_inode(inode); iput(inode); diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 55aa587bbc38..aad46401ede5 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -886,7 +886,7 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, *new = 1; iinfo->i_next_alloc_block = block; iinfo->i_next_alloc_goal = newblocknum; - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); if (IS_SYNC(inode)) udf_sync_inode(inode); @@ -1268,7 +1268,7 @@ set_size: up_write(&iinfo->i_data_sem); } update_time: - inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_mtime = inode->i_ctime = current_time(inode); if (IS_SYNC(inode)) udf_sync_inode(inode); else diff --git a/fs/udf/namei.c b/fs/udf/namei.c index c3e5c9679371..61af3f1e1973 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -616,7 +616,7 @@ static int udf_add_nondir(struct dentry *dentry, struct inode *inode) *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = cpu_to_le32(iinfo->i_unique & 0x00000000FFFFFFFFUL); udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); + dir->i_ctime = dir->i_mtime = current_time(dir); mark_inode_dirty(dir); if (fibh.sbh != fibh.ebh) brelse(fibh.ebh); @@ -730,7 +730,7 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) cfi.fileCharacteristics |= FID_FILE_CHAR_DIRECTORY; udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); inc_nlink(dir); - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); + dir->i_ctime = dir->i_mtime = current_time(dir); mark_inode_dirty(dir); unlock_new_inode(inode); d_instantiate(dentry, inode); @@ -845,7 +845,7 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) inode->i_size = 0; inode_dec_link_count(dir); inode->i_ctime = dir->i_ctime = dir->i_mtime = - current_fs_time(dir->i_sb); + current_time(inode); mark_inode_dirty(dir); end_rmdir: @@ -888,7 +888,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) retval = udf_delete_entry(dir, fi, &fibh, &cfi); if (retval) goto end_unlink; - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); + dir->i_ctime = dir->i_mtime = current_time(dir); mark_inode_dirty(dir); inode_dec_link_count(inode); inode->i_ctime = dir->i_ctime; @@ -1079,9 +1079,9 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir, brelse(fibh.ebh); brelse(fibh.sbh); inc_nlink(inode); - inode->i_ctime = current_fs_time(inode->i_sb); + inode->i_ctime = current_time(inode); mark_inode_dirty(inode); - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); + dir->i_ctime = dir->i_mtime = current_time(dir); mark_inode_dirty(dir); ihold(inode); d_instantiate(dentry, inode); @@ -1172,7 +1172,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_fs_time(old_inode->i_sb); + old_inode->i_ctime = current_time(old_inode); mark_inode_dirty(old_inode); /* @@ -1188,11 +1188,11 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry, udf_delete_entry(old_dir, ofi, &ofibh, &ocfi); if (new_inode) { - new_inode->i_ctime = current_fs_time(new_inode->i_sb); + new_inode->i_ctime = current_time(new_inode); inode_dec_link_count(new_inode); } - old_dir->i_ctime = old_dir->i_mtime = current_fs_time(old_dir->i_sb); - new_dir->i_ctime = new_dir->i_mtime = current_fs_time(new_dir->i_sb); + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); mark_inode_dirty(old_dir); mark_inode_dirty(new_dir); diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index b6e527b8eccb..74f7c68105b9 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -236,7 +236,7 @@ xfs_set_mode(struct inode *inode, umode_t mode) iattr.ia_valid = ATTR_MODE | ATTR_CTIME; iattr.ia_mode = mode; - iattr.ia_ctime = current_fs_time(inode->i_sb); + iattr.ia_ctime = current_time(inode); error = xfs_setattr_nonsize(XFS_I(inode), &iattr, XFS_ATTR_NOACL); } diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index e08eaea6327b..020110b76a40 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -821,7 +821,7 @@ xfs_ialloc( ip->i_d.di_nextents = 0; ASSERT(ip->i_d.di_nblocks == 0); - tv = current_fs_time(mp->m_super); + tv = current_time(inode); inode->i_mtime = tv; inode->i_atime = tv; inode->i_ctime = tv; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index b24c3102fa93..08c33f7fbe49 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -882,7 +882,7 @@ xfs_setattr_size( if (newsize != oldsize && !(iattr->ia_valid & (ATTR_CTIME | ATTR_MTIME))) { iattr->ia_ctime = iattr->ia_mtime = - current_fs_time(inode->i_sb); + current_time(inode); iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME; } diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index 11a3af08b5c7..dab8daa676f9 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c @@ -73,7 +73,7 @@ xfs_trans_ichgtime( ASSERT(tp); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); - tv = current_fs_time(inode->i_sb); + tv = current_time(inode); if (flags & XFS_ICHGTIME_MOD) inode->i_mtime = tv; -- cgit v1.2.3