Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1339644

[PATCH 4/8] fs: configfs: Replace CURRENT_TIME by current_fs_time()

From Deepa Dinamani <deepa.kernel@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 4/8] fs: configfs: Replace CURRENT_TIME by current_fs_time()
Date 2016-02-22 16:30 +0100
Message-ID <r50AX-7F1-47@gated-at.bofh.it> (permalink)
References <r50rf-7B2-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <deepa.kernel@gmail.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: stoph Hellwig <hch@lst.de>
---
 fs/configfs/inode.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index cee087d..5f24ad3 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -75,7 +75,8 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
 		sd_iattr->ia_mode = sd->s_mode;
 		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_TIME;
+		sd_iattr->ia_atime = sd_iattr->ia_mtime =
+			sd_iattr->ia_ctime = current_fs_time(inode->i_sb);
 		sd->s_iattr = sd_iattr;
 	}
 	/* attributes were changed atleast once in past */
@@ -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)
 {
 	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)
@@ -195,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_TIME;
+	p_inode->i_mtime = p_inode->i_ctime = current_fs_time(p_inode->i_sb);
 	configfs_set_inode_lock_class(sd, inode);
 
 	init(inode);
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] Remove CURRENT_TIME and CURRENT_TIME_SEC - PART 2 Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:20 +0100
  [PATCH 1/8] fs: debugfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100
  [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100
    Re: [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time() Trond Myklebust <trond.myklebust@primarydata.com> - 2016-02-22 16:40 +0100
      Re: [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:50 +0100
      Re: [Y2038] [PATCH 8/8] net: sunrpc: Replace CURRENT_TIME by current_fs_time() Arnd Bergmann <arnd@arndb.de> - 2016-02-24 16:10 +0100
  [PATCH 7/8] fs: kernfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100
  [PATCH 3/8] fs: devpts: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100
  [PATCH 6/8] fs: ramfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100
  [PATCH 4/8] fs: configfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100
    Re: [PATCH 4/8] fs: configfs: Replace CURRENT_TIME by  current_fs_time() Joel Becker <jlbec@evilplan.org> - 2016-02-24 10:10 +0100
    Re: [PATCH 4/8] fs: configfs: Replace CURRENT_TIME by  current_fs_time() stoph Hellwig <hch@lst.de> - 2016-02-26 10:50 +0100
  [PATCH 5/8] fs: proc: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100
  [PATCH 2/8] fs: logfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-02-22 16:30 +0100

csiph-web