Skip to content

Commit b1f1a29

Browse files
deepa-hubChristoph Hellwig
authored and
Christoph Hellwig
committed
configfs: Replace CURRENT_TIME by current_fs_time()
CURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_fs_time() instead. Signed-off-by: Deepa Dinamani <[email protected]> Acked-by: Joel Becker <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 5bb9871 commit b1f1a29

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/configfs/inode.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
7575
sd_iattr->ia_mode = sd->s_mode;
7676
sd_iattr->ia_uid = GLOBAL_ROOT_UID;
7777
sd_iattr->ia_gid = GLOBAL_ROOT_GID;
78-
sd_iattr->ia_atime = sd_iattr->ia_mtime = sd_iattr->ia_ctime = CURRENT_TIME;
78+
sd_iattr->ia_atime = sd_iattr->ia_mtime =
79+
sd_iattr->ia_ctime = current_fs_time(inode->i_sb);
7980
sd->s_iattr = sd_iattr;
8081
}
8182
/* attributes were changed atleast once in past */
@@ -111,7 +112,8 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
111112
static inline void set_default_inode_attr(struct inode * inode, umode_t mode)
112113
{
113114
inode->i_mode = mode;
114-
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
115+
inode->i_atime = inode->i_mtime =
116+
inode->i_ctime = current_fs_time(inode->i_sb);
115117
}
116118

117119
static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
@@ -195,7 +197,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in
195197
return -ENOMEM;
196198

197199
p_inode = d_inode(dentry->d_parent);
198-
p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME;
200+
p_inode->i_mtime = p_inode->i_ctime = current_fs_time(p_inode->i_sb);
199201
configfs_set_inode_lock_class(sd, inode);
200202

201203
init(inode);

0 commit comments

Comments
 (0)