All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deepa Dinamani <deepa.kernel@gmail.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	y2038@lists.linaro.org
Subject: [RFC 12/15] vfs: remove inode_timespec and timespec references
Date: Wed,  6 Jan 2016 21:36:09 -0800	[thread overview]
Message-ID: <1452144972-15802-13-git-send-email-deepa.kernel@gmail.com> (raw)
In-Reply-To: <1452144972-15802-1-git-send-email-deepa.kernel@gmail.com>

Substitute inode_timespec aliases with timespec64.
Since CONFIG_FS_USES_64BIT_TIME is enabled, internally
all inode_timespec references are using timespec64
already.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 fs/attr.c            |  2 +-
 fs/bad_inode.c       |  2 +-
 fs/binfmt_misc.c     |  2 +-
 fs/inode.c           | 36 ++++++++++++++++++------------------
 fs/libfs.c           | 12 ++++++------
 fs/locks.c           |  2 +-
 fs/nsfs.c            |  2 +-
 fs/pipe.c            |  2 +-
 fs/utimes.c          |  4 ++--
 include/linux/fs.h   | 24 +++++++++---------------
 include/linux/stat.h |  6 +++---
 11 files changed, 44 insertions(+), 50 deletions(-)

diff --git a/fs/attr.c b/fs/attr.c
index 4156239..ec5e9ad 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -192,7 +192,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de
 	struct inode *inode = dentry->d_inode;
 	umode_t mode = inode->i_mode;
 	int error;
-	struct inode_timespec now;
+	struct timespec64 now;
 	unsigned int ia_valid = attr->ia_valid;
 
 	WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex));
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 3c51e22..2a8daef 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -169,7 +169,7 @@ static const struct inode_operations bad_inode_ops =
  
 void make_bad_inode(struct inode *inode)
 {
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	remove_inode_hash(inode);
 
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 4fd4437..c58ecb7 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -562,7 +562,7 @@ static void entry_status(Node *e, char *page)
 static struct inode *bm_get_inode(struct super_block *sb, int mode)
 {
 	struct inode *inode = new_inode(sb);
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	if (inode) {
 		inode->i_ino = get_next_ino();
diff --git a/fs/inode.c b/fs/inode.c
index d3d64dc..86218f6 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1532,12 +1532,12 @@ EXPORT_SYMBOL(bmap);
  * passed since the last atime update.
  */
 static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
-			     struct inode_timespec now)
+			     struct timespec64 now)
 {
 
-	struct inode_timespec ctime;
-	struct inode_timespec mtime;
-	struct inode_timespec atime;
+	struct timespec64 ctime;
+	struct timespec64 mtime;
+	struct timespec64 atime;
 
 	if (!(mnt->mnt_flags & MNT_RELATIME))
 		return 1;
@@ -1549,12 +1549,12 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
 	/*
 	 * Is mtime younger than atime? If yes, update atime:
 	 */
-	if (inode_timespec_compare(&mtime, &atime) >= 0)
+	if (timespec64_compare(&mtime, &atime) >= 0)
 		return 1;
 	/*
 	 * Is ctime younger than atime? If yes, update atime:
 	 */
-	if (inode_timespec_compare(&ctime, &atime) >= 0)
+	if (timespec64_compare(&ctime, &atime) >= 0)
 		return 1;
 
 	/*
@@ -1569,7 +1569,7 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
 	return 0;
 }
 
-int generic_update_time(struct inode *inode, struct inode_timespec *time,
+int generic_update_time(struct inode *inode, struct timespec64 *time,
 			int flags)
 {
 	int iflags = I_DIRTY_TIME;
@@ -1594,10 +1594,10 @@ EXPORT_SYMBOL(generic_update_time);
  * This does the actual work of updating an inodes time or version.  Must have
  * had called mnt_want_write() before calling this.
  */
-static int update_time(struct inode *inode, struct inode_timespec *time,
+static int update_time(struct inode *inode, struct timespec64 *time,
 		       int flags)
 {
-	int (*update_time)(struct inode *, struct inode_timespec *, int);
+	int (*update_time)(struct inode *, struct timespec64 *, int);
 
 	update_time = inode->i_op->update_time ? inode->i_op->update_time :
 		generic_update_time;
@@ -1617,8 +1617,8 @@ static int update_time(struct inode *inode, struct inode_timespec *time,
 bool atime_needs_update(const struct path *path, struct inode *inode)
 {
 	struct vfsmount *mnt = path->mnt;
-	struct inode_timespec now;
-	struct inode_timespec atime;
+	struct timespec64 now;
+	struct timespec64 atime;
 
 	if (inode->i_flags & S_NOATIME)
 		return false;
@@ -1637,7 +1637,7 @@ bool atime_needs_update(const struct path *path, struct inode *inode)
 		return false;
 
 	atime = VFS_INODE_GET_XTIME(i_atime, inode);
-	if (inode_timespec_equal(&atime, &now))
+	if (timespec64_equal(&atime, &now))
 		return false;
 
 	return true;
@@ -1647,7 +1647,7 @@ void touch_atime(const struct path *path)
 {
 	struct vfsmount *mnt = path->mnt;
 	struct inode *inode = d_inode(path->dentry);
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	if (!atime_needs_update(path, inode))
 		return;
@@ -1782,9 +1782,9 @@ EXPORT_SYMBOL(file_remove_privs);
 int file_update_time(struct file *file)
 {
 	struct inode *inode = file_inode(file);
-	struct inode_timespec now;
-	struct inode_timespec mtime;
-	struct inode_timespec ctime;
+	struct timespec64 now;
+	struct timespec64 mtime;
+	struct timespec64 ctime;
 
 	int sync_it = 0;
 	int ret;
@@ -1798,10 +1798,10 @@ int file_update_time(struct file *file)
 	mtime = VFS_INODE_GET_XTIME(i_mtime, inode);
 	ctime = VFS_INODE_GET_XTIME(i_ctime, inode);
 
-	if (!inode_timespec_equal(&mtime, &now))
+	if (!timespec64_equal(&mtime, &now))
 		sync_it = S_MTIME;
 
-	if (!inode_timespec_equal(&ctime, &now))
+	if (!timespec64_equal(&ctime, &now))
 		sync_it |= S_CTIME;
 
 	if (IS_I_VERSION(inode))
diff --git a/fs/libfs.c b/fs/libfs.c
index 5a0c7c2..ffa9e65 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -216,7 +216,7 @@ struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,
 	struct dentry *dentry;
 	struct inode *root;
 	struct qstr d_name = QSTR_INIT(name, strlen(name));
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	s = sget(fs_type, NULL, set_anon_super, MS_NOUSER, NULL);
 	if (IS_ERR(s))
@@ -274,7 +274,7 @@ EXPORT_SYMBOL(simple_open);
 int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
 {
 	struct inode *inode = d_inode(old_dentry);
-	struct inode_timespec now = current_fs_time(inode->i_sb);
+	struct timespec64 now = current_fs_time(inode->i_sb);
 
 	VFS_INODE_SET_XTIME(i_ctime, inode, now);
 	VFS_INODE_SET_XTIME(i_mtime, dir, now);
@@ -311,7 +311,7 @@ EXPORT_SYMBOL(simple_empty);
 int simple_unlink(struct inode *dir, struct dentry *dentry)
 {
 	struct inode *inode = d_inode(dentry);
-	struct inode_timespec now = current_fs_time(inode->i_sb);
+	struct timespec64 now = current_fs_time(inode->i_sb);
 
 	VFS_INODE_SET_XTIME(i_ctime, inode, now);
 	VFS_INODE_SET_XTIME(i_mtime, dir, now);
@@ -339,7 +339,7 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
 {
 	struct inode *inode = d_inode(old_dentry);
 	int they_are_dirs = d_is_dir(old_dentry);
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	if (!simple_empty(new_dentry))
 		return -ENOTEMPTY;
@@ -495,7 +495,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
 	struct inode *inode;
 	struct dentry *root;
 	struct dentry *dentry;
-	struct inode_timespec now;
+	struct timespec64 now;
 	int i;
 
 	s->s_blocksize = PAGE_CACHE_SIZE;
@@ -1080,7 +1080,7 @@ struct inode *alloc_anon_inode(struct super_block *s)
 		.set_page_dirty = anon_set_page_dirty,
 	};
 	struct inode *inode = new_inode_pseudo(s);
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
diff --git a/fs/locks.c b/fs/locks.c
index 2b818eb..ccf9c23 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1491,7 +1491,7 @@ EXPORT_SYMBOL(__break_lease);
  * exclusive leases.  The justification is that if someone has an
  * exclusive lease, then they could be modifying it.
  */
-void lease_get_mtime(struct inode *inode, struct inode_timespec *time)
+void lease_get_mtime(struct inode *inode, struct timespec64 *time)
 {
 	bool has_lease = false;
 	struct file_lock_context *ctx;
diff --git a/fs/nsfs.c b/fs/nsfs.c
index a079fc9..e9012b5 100644
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -51,7 +51,7 @@ void *ns_get_path(struct path *path, struct task_struct *task,
 	struct qstr qname = { .name = "", };
 	struct dentry *dentry;
 	struct inode *inode;
-	struct inode_timespec now;
+	struct timespec64 now;
 	struct ns_common *ns;
 	unsigned long d;
 
diff --git a/fs/pipe.c b/fs/pipe.c
index 5d414a3..3bcb870 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -637,7 +637,7 @@ static struct inode * get_pipe_inode(void)
 {
 	struct inode *inode = new_inode_pseudo(pipe_mnt->mnt_sb);
 	struct pipe_inode_info *pipe;
-	struct inode_timespec now;
+	struct timespec64 now;
 
 	if (!inode)
 		goto fail_inode;
diff --git a/fs/utimes.c b/fs/utimes.c
index c23c8e6..6c0d208 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -48,7 +48,7 @@ static bool nsec_valid(long nsec)
 	return nsec >= 0 && nsec <= 999999999;
 }
 
-static int utimes_common(struct path *path, struct inode_timespec *times)
+static int utimes_common(struct path *path, struct timespec64 *times)
 {
 	int error;
 	struct iattr newattrs;
@@ -135,7 +135,7 @@ out:
  * Else, update from *times, must be owner or super user.
  */
 long do_utimes(int dfd, const char __user *filename,
-	       struct inode_timespec *times,
+	       struct timespec64 *times,
 	       int flags)
 {
 	int error = -EINVAL;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5112bc2..4a754a2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -249,9 +249,9 @@ struct iattr {
 	kuid_t			ia_uid;
 	kgid_t			ia_gid;
 	loff_t			ia_size;
-	struct inode_timespec	ia_atime;
-	struct inode_timespec	ia_mtime;
-	struct inode_timespec	ia_ctime;
+	struct timespec64	ia_atime;
+	struct timespec64	ia_mtime;
+	struct timespec64	ia_ctime;
 
 	/*
 	 * Not an attribute, but an auxiliary info for filesystems wanting to
@@ -616,18 +616,12 @@ struct inode {
 	};
 	dev_t			i_rdev;
 	loff_t			i_size;
-#ifdef CONFIG_FS_USES_64BIT_TIME
 	time64_t		i_atime_sec;
 	time64_t		i_mtime_sec;
 	time64_t		i_ctime_sec;
 	s32			i_atime_nsec;
 	s32			i_mtime_nsec;
 	s32			i_ctime_nsec;
-#else
-	struct timespec		i_atime;
-	struct timespec		i_mtime;
-	struct timespec		i_ctime;
-#endif
 	spinlock_t		i_lock;	/* i_blocks, i_bytes, maybe i_size */
 	unsigned short          i_bytes;
 	unsigned int		i_blkbits;
@@ -727,7 +721,7 @@ struct inode {
 
 #define VFS_INODE_SWAP_XTIME(xtime, inode1, inode2)		\
 	do {							\
-		struct inode_timespec __ts =			\
+		struct timespec64 __ts =			\
 			VFS_INODE_GET_XTIME(xtime, inode1);	\
 		VFS_INODE_SET_XTIME(xtime, inode1,		\
 			VFS_INODE_GET_XTIME(xtime, inode2));	\
@@ -1448,11 +1442,11 @@ struct super_block {
 
 #endif
 
-extern int is_fs_timestamp_bad(struct inode_timespec ts);
-extern struct inode_timespec current_fs_time(struct super_block *sb);
-extern struct inode_timespec current_fs_time_sec(struct super_block *sb);
-extern struct inode_timespec
-fs_time_trunc(struct inode_timespec ts, struct super_block *sb);
+extern int is_fs_timestamp_bad(struct timespec64 ts);
+extern struct timespec64 current_fs_time(struct super_block *sb);
+extern struct timespec64 current_fs_time_sec(struct super_block *sb);
+extern struct timespec64
+fs_time_trunc(struct timespec64 ts, struct super_block *sb);
 
 /*
  * Snapshotting support.
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 559983f..5561337 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -27,9 +27,9 @@ struct kstat {
 	kgid_t		gid;
 	dev_t		rdev;
 	loff_t		size;
-	struct inode_timespec	atime;
-	struct inode_timespec	mtime;
-	struct inode_timespec	ctime;
+	struct timespec64	atime;
+	struct timespec64	mtime;
+	struct timespec64	ctime;
 	unsigned long	blksize;
 	unsigned long long	blocks;
 };
-- 
1.9.1


  parent reply	other threads:[~2016-01-07  5:37 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07  5:35 [RFC 00/15] Add 64 bit timestamp support Deepa Dinamani
2016-01-07  5:35 ` [RFC 01/15] fs: add Kconfig entry CONFIG_FS_USES_64BIT_TIME Deepa Dinamani
2016-01-07  5:35 ` [RFC 02/15] vfs: Change all structures to support 64 bit time Deepa Dinamani
2016-01-10 23:03   ` Dave Chinner
2016-01-12  5:42     ` Deepa Dinamani
2016-01-12  8:29       ` Dave Chinner
2016-01-12  9:27         ` [Y2038] " Arnd Bergmann
2016-01-13  6:27           ` Dave Chinner
2016-01-13  9:20             ` Arnd Bergmann
2016-01-13  9:20               ` Arnd Bergmann
2016-01-13 16:33         ` Deepa Dinamani
2016-01-13 21:04           ` Dave Chinner
2016-01-14 16:53             ` [Y2038] " Arnd Bergmann
2016-01-14 18:00               ` Deepa Dinamani
2016-01-14 21:00               ` Dave Chinner
2016-01-14 22:46                 ` Arnd Bergmann
2016-01-14 22:54                   ` Arnd Bergmann
2016-01-15  2:27                     ` Dave Chinner
2016-01-15 17:01                       ` Arnd Bergmann
2016-01-15 22:41                         ` Dave Chinner
2016-01-15  2:49                   ` Dave Chinner
2016-01-15 16:50                     ` Arnd Bergmann
2016-01-16 19:14                       ` Andreas Dilger
2016-01-16 23:36                         ` Arnd Bergmann
2016-01-17  2:30                           ` Andreas Dilger
2016-01-18  6:09                             ` Deepa Dinamani
2016-01-18 10:56                               ` Arnd Bergmann
2016-01-18 17:40                                 ` Deepa Dinamani
2016-01-18 19:53                                   ` Arnd Bergmann
2016-01-18 21:14                                     ` Dave Chinner
2016-01-18 21:46                                       ` Arnd Bergmann
2016-01-19  1:38                                         ` Dave Chinner
2016-01-19  5:27                                           ` Deepa Dinamani
2016-01-19 20:49                                             ` Dave Chinner
2016-01-19 22:25                                               ` Arnd Bergmann
2016-01-20  5:12                                                 ` Deepa Dinamani
2016-01-20 15:04                                                   ` Deepa Dinamani
2016-01-20 23:06                                                 ` Dave Chinner
2016-01-20 23:17                                                   ` [Y2038] " Arnd Bergmann
2016-01-27  6:26                                                     ` Deepa Dinamani
2016-01-15  5:03                 ` Deepa Dinamani
2016-01-07  5:36 ` [RFC 03/15] kernel: time: Add macros and functions " Deepa Dinamani
2016-01-07  5:36 ` [RFC 04/15] vfs: Add support for vfs code to use " Deepa Dinamani
2016-01-07  5:36 ` [RFC 05/15] fs: cifs: Add support for cifs " Deepa Dinamani
2016-01-07  5:36 ` [RFC 06/15] fs: fat: convert fat to " Deepa Dinamani
2016-01-07  5:36 ` [RFC 07/15] fs: ext4: convert to use " Deepa Dinamani
2016-01-07  5:36 ` [RFC 08/15] fs: Enable " Deepa Dinamani
2016-01-07  5:36 ` [RFC 09/15] fs: cifs: replace inode_timespec with timespec64 Deepa Dinamani
2016-01-07  5:36 ` [RFC 10/15] fs: fat: " Deepa Dinamani
2016-01-07  5:36 ` [RFC 11/15] fs: ext4: " Deepa Dinamani
2016-01-07  5:36 ` Deepa Dinamani [this message]
2016-01-07  5:36 ` [RFC 13/15] kernel: time: change inode_timespec to timespec64 Deepa Dinamani
2016-01-07  8:50   ` Michael Adam
2016-01-07 10:42     ` Deepa Dinamani
2016-01-07  5:36 ` [RFC 14/15] vfs: Remove inode_timespec aliases Deepa Dinamani
2016-01-07  5:36 ` [RFC 15/15] fs: Drop CONFIG_FS_USES_64BIT_TIME Deepa Dinamani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452144972-15802-13-git-send-email-deepa.kernel@gmail.com \
    --to=deepa.kernel@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.