Commit c2050a45 authored by Deepa Dinamani's avatar Deepa Dinamani Committed by Al Viro

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: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 02027d42
...@@ -934,7 +934,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf, ...@@ -934,7 +934,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
if (ret > 0) { if (ret > 0) {
struct inode *inode = file_inode(file); struct inode *inode = file_inode(file);
inode->i_atime = current_fs_time(inode->i_sb); inode->i_atime = current_time(inode);
} }
return ret; return ret;
......
...@@ -4116,7 +4116,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf, ...@@ -4116,7 +4116,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
if (ret > 0) { if (ret > 0) {
struct inode *inode = file_inode(file); struct inode *inode = file_inode(file);
inode->i_atime = current_fs_time(inode->i_sb); inode->i_atime = current_time(inode);
} }
return ret; return ret;
......
...@@ -209,7 +209,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de ...@@ -209,7 +209,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de
inode->i_flags &= ~S_NOSEC; inode->i_flags &= ~S_NOSEC;
} }
now = current_fs_time(inode->i_sb); now = current_time(inode);
attr->ia_ctime = now; attr->ia_ctime = now;
if (!(ia_valid & ATTR_ATIME_SET)) if (!(ia_valid & ATTR_ATIME_SET))
......
...@@ -173,7 +173,7 @@ void make_bad_inode(struct inode *inode) ...@@ -173,7 +173,7 @@ void make_bad_inode(struct inode *inode)
inode->i_mode = S_IFREG; inode->i_mode = S_IFREG;
inode->i_atime = inode->i_mtime = inode->i_ctime = 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_op = &bad_inode_ops;
inode->i_fop = &bad_file_ops; inode->i_fop = &bad_file_ops;
} }
......
...@@ -584,7 +584,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) ...@@ -584,7 +584,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode)
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode->i_mode = mode; inode->i_mode = mode;
inode->i_atime = inode->i_mtime = inode->i_ctime = inode->i_atime = inode->i_mtime = inode->i_ctime =
current_fs_time(inode->i_sb); current_time(inode);
} }
return inode; return inode;
} }
......
...@@ -1757,7 +1757,7 @@ static void update_time_for_write(struct inode *inode) ...@@ -1757,7 +1757,7 @@ static void update_time_for_write(struct inode *inode)
if (IS_NOCMTIME(inode)) if (IS_NOCMTIME(inode))
return; return;
now = current_fs_time(inode->i_sb); now = current_time(inode);
if (!timespec_equal(&inode->i_mtime, &now)) if (!timespec_equal(&inode->i_mtime, &now))
inode->i_mtime = now; inode->i_mtime = now;
...@@ -2578,7 +2578,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) ...@@ -2578,7 +2578,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
goto out_free; goto out_free;
inode_inc_iversion(inode); 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; trans->block_rsv = &root->fs_info->trans_block_rsv;
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, root, inode);
...@@ -2842,7 +2842,7 @@ static long btrfs_fallocate(struct file *file, int mode, ...@@ -2842,7 +2842,7 @@ static long btrfs_fallocate(struct file *file, int mode,
if (IS_ERR(trans)) { if (IS_ERR(trans)) {
ret = PTR_ERR(trans); ret = PTR_ERR(trans);
} else { } else {
inode->i_ctime = current_fs_time(inode->i_sb); inode->i_ctime = current_time(inode);
i_size_write(inode, actual_end); i_size_write(inode, actual_end);
btrfs_ordered_update_i_size(inode, actual_end, NULL); btrfs_ordered_update_i_size(inode, actual_end, NULL);
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, root, inode);
......
...@@ -4059,7 +4059,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, ...@@ -4059,7 +4059,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
inode_inc_iversion(inode); inode_inc_iversion(inode);
inode_inc_iversion(dir); inode_inc_iversion(dir);
inode->i_ctime = dir->i_mtime = 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); ret = btrfs_update_inode(trans, root, dir);
out: out:
return ret; return ret;
...@@ -4202,7 +4202,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, ...@@ -4202,7 +4202,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
btrfs_i_size_write(dir, dir->i_size - name_len * 2); btrfs_i_size_write(dir, dir->i_size - name_len * 2);
inode_inc_iversion(dir); 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); ret = btrfs_update_inode_fallback(trans, root, dir);
if (ret) if (ret)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
...@@ -4965,7 +4965,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr) ...@@ -4965,7 +4965,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
inode_inc_iversion(inode); inode_inc_iversion(inode);
if (!(mask & (ATTR_CTIME | ATTR_MTIME))) if (!(mask & (ATTR_CTIME | ATTR_MTIME)))
inode->i_ctime = inode->i_mtime = inode->i_ctime = inode->i_mtime =
current_fs_time(inode->i_sb); current_time(inode);
} }
if (newsize > oldsize) { if (newsize > oldsize) {
...@@ -5672,7 +5672,7 @@ static struct inode *new_simple_dir(struct super_block *s, ...@@ -5672,7 +5672,7 @@ static struct inode *new_simple_dir(struct super_block *s,
inode->i_op = &btrfs_dir_ro_inode_operations; inode->i_op = &btrfs_dir_ro_inode_operations;
inode->i_fop = &simple_dir_operations; inode->i_fop = &simple_dir_operations;
inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; 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_atime = inode->i_mtime;
inode->i_ctime = inode->i_mtime; inode->i_ctime = inode->i_mtime;
BTRFS_I(inode)->i_otime = 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, ...@@ -6258,7 +6258,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
inode_init_owner(inode, dir, mode); inode_init_owner(inode, dir, mode);
inode_set_bytes(inode, 0); 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_atime = inode->i_mtime;
inode->i_ctime = inode->i_mtime; inode->i_ctime = inode->i_mtime;
BTRFS_I(inode)->i_otime = inode->i_mtime; BTRFS_I(inode)->i_otime = inode->i_mtime;
...@@ -6372,7 +6372,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, ...@@ -6372,7 +6372,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
name_len * 2); name_len * 2);
inode_inc_iversion(parent_inode); inode_inc_iversion(parent_inode);
parent_inode->i_mtime = parent_inode->i_ctime = 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); ret = btrfs_update_inode(trans, root, parent_inode);
if (ret) if (ret)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
...@@ -6590,7 +6590,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, ...@@ -6590,7 +6590,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
BTRFS_I(inode)->dir_index = 0ULL; BTRFS_I(inode)->dir_index = 0ULL;
inc_nlink(inode); inc_nlink(inode);
inode_inc_iversion(inode); inode_inc_iversion(inode);
inode->i_ctime = current_fs_time(inode->i_sb); inode->i_ctime = current_time(inode);
ihold(inode); ihold(inode);
set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
...@@ -9492,7 +9492,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, ...@@ -9492,7 +9492,7 @@ static int btrfs_rename_exchange(struct inode *old_dir,
struct btrfs_root *dest = BTRFS_I(new_dir)->root; struct btrfs_root *dest = BTRFS_I(new_dir)->root;
struct inode *new_inode = new_dentry->d_inode; struct inode *new_inode = new_dentry->d_inode;
struct inode *old_inode = old_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; struct dentry *parent;
u64 old_ino = btrfs_ino(old_inode); u64 old_ino = btrfs_ino(old_inode);
u64 new_ino = btrfs_ino(new_inode); u64 new_ino = btrfs_ino(new_inode);
...@@ -9860,7 +9860,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -9860,7 +9860,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
inode_inc_iversion(old_inode); inode_inc_iversion(old_inode);
old_dir->i_ctime = old_dir->i_mtime = old_dir->i_ctime = old_dir->i_mtime =
new_dir->i_ctime = new_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) if (old_dentry->d_parent != new_dentry->d_parent)
btrfs_record_unlink_dir(trans, old_dir, old_inode, 1); 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, ...@@ -9885,7 +9885,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (new_inode) { if (new_inode) {
inode_inc_iversion(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) == if (unlikely(btrfs_ino(new_inode) ==
BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
root_objectid = BTRFS_I(new_inode)->location.objectid; root_objectid = BTRFS_I(new_inode)->location.objectid;
...@@ -10403,7 +10403,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode, ...@@ -10403,7 +10403,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
*alloc_hint = ins.objectid + ins.offset; *alloc_hint = ins.objectid + ins.offset;
inode_inc_iversion(inode); 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; BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC;
if (!(mode & FALLOC_FL_KEEP_SIZE) && if (!(mode & FALLOC_FL_KEEP_SIZE) &&
(actual_len > inode->i_size) && (actual_len > inode->i_size) &&
......
...@@ -349,7 +349,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) ...@@ -349,7 +349,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
btrfs_update_iflags(inode); btrfs_update_iflags(inode);
inode_inc_iversion(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); ret = btrfs_update_inode(trans, root, inode);
btrfs_end_transaction(trans, root); btrfs_end_transaction(trans, root);
...@@ -445,7 +445,7 @@ static noinline int create_subvol(struct inode *dir, ...@@ -445,7 +445,7 @@ static noinline int create_subvol(struct inode *dir,
struct btrfs_root *root = BTRFS_I(dir)->root; struct btrfs_root *root = BTRFS_I(dir)->root;
struct btrfs_root *new_root; struct btrfs_root *new_root;
struct btrfs_block_rsv block_rsv; 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; struct inode *inode;
int ret; int ret;
int err; int err;
...@@ -3279,7 +3279,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans, ...@@ -3279,7 +3279,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans,
inode_inc_iversion(inode); inode_inc_iversion(inode);
if (!no_time_update) 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 * We round up to the block size at eof when determining which
* extents to clone above, but shouldn't round up the file size. * 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, ...@@ -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 *root = BTRFS_I(inode)->root;
struct btrfs_root_item *root_item = &root->root_item; struct btrfs_root_item *root_item = &root->root_item;
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
struct timespec ct = current_fs_time(inode->i_sb); struct timespec ct = current_time(inode);
int ret = 0; int ret = 0;
int received_uuid_changed; int received_uuid_changed;
......
...@@ -1474,7 +1474,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, ...@@ -1474,7 +1474,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
parent_root = BTRFS_I(parent_inode)->root; parent_root = BTRFS_I(parent_inode)->root;
record_root_in_trans(trans, parent_root, 0); 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 * insert the directory item
...@@ -1630,7 +1630,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, ...@@ -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 + btrfs_i_size_write(parent_inode, parent_inode->i_size +
dentry->d_name.len * 2); dentry->d_name.len * 2);
parent_inode->i_mtime = parent_inode->i_ctime = 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); ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
......
...@@ -252,7 +252,7 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans, ...@@ -252,7 +252,7 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans,
goto out; goto out;
inode_inc_iversion(inode); 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); set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, root, inode);
BUG_ON(ret); BUG_ON(ret);
......
...@@ -886,7 +886,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, ...@@ -886,7 +886,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
int num_pages = 0; int num_pages = 0;
int flags; int flags;
int ret; int ret;
struct timespec mtime = current_fs_time(inode->i_sb); struct timespec mtime = current_time(inode);
size_t count = iov_iter_count(iter); size_t count = iov_iter_count(iter);
loff_t pos = iocb->ki_pos; loff_t pos = iocb->ki_pos;
bool write = iov_iter_rw(iter) == WRITE; bool write = iov_iter_rw(iter) == WRITE;
...@@ -1091,7 +1091,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos, ...@@ -1091,7 +1091,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
int flags; int flags;
int check_caps = 0; int check_caps = 0;
int ret; int ret;
struct timespec mtime = current_fs_time(inode->i_sb); struct timespec mtime = current_time(inode);
size_t count = iov_iter_count(from); size_t count = iov_iter_count(from);
if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) if (ceph_snap(file_inode(file)) != CEPH_NOSNAP)
......
...@@ -2080,7 +2080,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) ...@@ -2080,7 +2080,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
if (dirtied) { if (dirtied) {
inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied,
&prealloc_cf); &prealloc_cf);
inode->i_ctime = current_fs_time(inode->i_sb); inode->i_ctime = current_time(inode);
} }
release &= issued; release &= issued;
......
...@@ -1034,7 +1034,7 @@ int __ceph_setxattr(struct inode *inode, const char *name, ...@@ -1034,7 +1034,7 @@ int __ceph_setxattr(struct inode *inode, const char *name,
dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL, dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL,
&prealloc_cf); &prealloc_cf);
ci->i_xattrs.dirty = true; 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); spin_unlock(&ci->i_ceph_lock);
......
...@@ -1878,7 +1878,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) ...@@ -1878,7 +1878,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
write_data, to - from, &offset); write_data, to - from, &offset);
cifsFileInfo_put(open_file); cifsFileInfo_put(open_file);
/* Does mm or vfs already set times? */ /* 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)) if ((bytes_written > 0) && (offset))
rc = 0; rc = 0;
else if (bytes_written < 0) else if (bytes_written < 0)
...@@ -3571,7 +3571,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page, ...@@ -3571,7 +3571,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
cifs_dbg(FYI, "Bytes read %d\n", rc); cifs_dbg(FYI, "Bytes read %d\n", rc);
file_inode(file)->i_atime = file_inode(file)->i_atime =
current_fs_time(file_inode(file)->i_sb); current_time(file_inode(file));
if (PAGE_SIZE > rc) if (PAGE_SIZE > rc)
memset(read_data + rc, 0, PAGE_SIZE - rc); memset(read_data + rc, 0, PAGE_SIZE - rc);
......
...@@ -76,7 +76,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) ...@@ -76,7 +76,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
sd_iattr->ia_uid = GLOBAL_ROOT_UID; sd_iattr->ia_uid = GLOBAL_ROOT_UID;
sd_iattr->ia_gid = GLOBAL_ROOT_GID; sd_iattr->ia_gid = GLOBAL_ROOT_GID;
sd_iattr->ia_atime = sd_iattr->ia_mtime = 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; sd->s_iattr = sd_iattr;
} }
/* attributes were changed atleast once in past */ /* attributes were changed atleast once in past */
...@@ -113,7 +113,7 @@ static inline void set_default_inode_attr(struct inode * inode, umode_t mode) ...@@ -113,7 +113,7 @@ static inline void set_default_inode_attr(struct inode * inode, umode_t mode)
{ {
inode->i_mode = mode; inode->i_mode = mode;
inode->i_atime = inode->i_mtime = 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) 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 ...@@ -197,7 +197,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in
return -ENOMEM; return -ENOMEM;
p_inode = d_inode(dentry->d_parent); 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); configfs_set_inode_lock_class(sd, inode);
init(inode); init(inode);
......
...@@ -45,7 +45,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb) ...@@ -45,7 +45,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb)
if (inode) { if (inode) {
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode->i_atime = inode->i_mtime = inode->i_atime = inode->i_mtime =
inode->i_ctime = current_fs_time(sb); inode->i_ctime = current_time(inode);
} }
return inode; return inode;
} }
......
...@@ -541,7 +541,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, ...@@ -541,7 +541,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
if (is_inode_flag_set(inode, FI_ACL_MODE)) { if (is_inode_flag_set(inode, FI_ACL_MODE)) {
inode->i_mode = F2FS_I(inode)->i_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); clear_inode_flag(inode, FI_ACL_MODE);
} }
if (index == F2FS_XATTR_INDEX_ENCRYPTION && if (index == F2FS_XATTR_INDEX_ENCRYPTION &&
......
...@@ -63,7 +63,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr) ...@@ -63,7 +63,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
/* Equivalent to a chmod() */ /* Equivalent to a chmod() */
ia.ia_valid = ATTR_MODE | ATTR_CTIME; 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) if (is_dir)
ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO); ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO);
else { else {
......
...@@ -637,7 +637,7 @@ static int fuse_symlink(struct inode *dir, struct dentry *entry, ...@@ -637,7 +637,7 @@ static int fuse_symlink(struct inode *dir, struct dentry *entry,
static inline void fuse_update_ctime(struct inode *inode) static inline void fuse_update_ctime(struct inode *inode)
{ {
if (!IS_NOCMTIME(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); mark_inode_dirty_sync(inode);
} }
} }
......
...@@ -1636,7 +1636,7 @@ bool atime_needs_update(const struct path *path, struct inode *inode) ...@@ -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)) if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
return false; return false;
now = current_fs_time(inode->i_sb); now = current_time(inode);
if (!relatime_need_update(mnt, inode, now)) if (!relatime_need_update(mnt, inode, now))
return false; return false;
...@@ -1670,7 +1670,7 @@ void touch_atime(const struct path *path) ...@@ -1670,7 +1670,7 @@ void touch_atime(const struct path *path)
* We may also fail on filesystems that have the ability to make parts * We may also fail on filesystems that have the ability to make parts
* of the fs read only, e.g. subvolumes in Btrfs. * 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); update_time(inode, &now, S_ATIME);
__mnt_drop_write(mnt); __mnt_drop_write(mnt);
skip_update: skip_update:
...@@ -1793,7 +1793,7 @@ int file_update_time(struct file *file) ...@@ -1793,7 +1793,7 @@ int file_update_time(struct file *file)
if (IS_NOCMTIME(inode)) if (IS_NOCMTIME(inode))
return 0; return 0;
now = current_fs_time(inode->i_sb); now = current_time(inode);
if (!timespec_equal(&inode->i_mtime, &now)) if (!timespec_equal(&inode->i_mtime, &now))
sync_it = S_MTIME; sync_it = S_MTIME;
......
...@@ -1281,7 +1281,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1281,7 +1281,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
old_ip->i_ctime = current_time(old_ip); old_ip->i_ctime = current_time(old_ip);
mark_inode_dirty(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); mark_inode_dirty(new_dir);
/* Build list of inodes modified by this transaction */