Commit b1f1a29d authored by Deepa Dinamani's avatar Deepa Dinamani Committed by Christoph Hellwig

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: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
Acked-by: default avatarJoel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 5bb9871e
...@@ -75,7 +75,8 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) ...@@ -75,7 +75,8 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
sd_iattr->ia_mode = sd->s_mode; sd_iattr->ia_mode = sd->s_mode;
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_ctime = CURRENT_TIME; sd_iattr->ia_atime = sd_iattr->ia_mtime =
sd_iattr->ia_ctime = current_fs_time(inode->i_sb);
sd->s_iattr = sd_iattr; sd->s_iattr = sd_iattr;
} }
/* attributes were changed atleast once in past */ /* attributes were changed atleast once in past */
...@@ -111,7 +112,8 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) ...@@ -111,7 +112,8 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
static inline void set_default_inode_attr(struct inode * inode, umode_t mode) 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_ctime = CURRENT_TIME; inode->i_atime = inode->i_mtime =
inode->i_ctime = current_fs_time(inode->i_sb);
} }
static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) 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 ...@@ -195,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_TIME; p_inode->i_mtime = p_inode->i_ctime = current_fs_time(p_inode->i_sb);
configfs_set_inode_lock_class(sd, inode); configfs_set_inode_lock_class(sd, inode);
init(inode); init(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment