提交 4be3df28 编写于 作者: E Eric W. Biederman 提交者: Greg Kroah-Hartman

sysfs: Simplify iattr time assignments

The granularity of sysfs time when we keep it is 1 ns.  Which
when passed to timestamp_trunc results in a nop.  So remove
the unnecessary function call making sysfs_setattr slightly
easier to read.
Acked-by: NTejun Heo <tj@kernel.org>
Acked-by: NSerge Hallyn <serue@us.ibm.com>
Signed-off-by: NEric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 4c6974f5
...@@ -104,14 +104,11 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr) ...@@ -104,14 +104,11 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr)
if (ia_valid & ATTR_GID) if (ia_valid & ATTR_GID)
iattrs->ia_gid = iattr->ia_gid; iattrs->ia_gid = iattr->ia_gid;
if (ia_valid & ATTR_ATIME) if (ia_valid & ATTR_ATIME)
iattrs->ia_atime = timespec_trunc(iattr->ia_atime, iattrs->ia_atime = iattr->ia_atime;
inode->i_sb->s_time_gran);
if (ia_valid & ATTR_MTIME) if (ia_valid & ATTR_MTIME)
iattrs->ia_mtime = timespec_trunc(iattr->ia_mtime, iattrs->ia_mtime = iattr->ia_mtime;
inode->i_sb->s_time_gran);
if (ia_valid & ATTR_CTIME) if (ia_valid & ATTR_CTIME)
iattrs->ia_ctime = timespec_trunc(iattr->ia_ctime, iattrs->ia_ctime = iattr->ia_ctime;
inode->i_sb->s_time_gran);
if (ia_valid & ATTR_MODE) { if (ia_valid & ATTR_MODE) {
umode_t mode = iattr->ia_mode; umode_t mode = iattr->ia_mode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册