All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	Deepa Dinamani <deepa.kernel@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: [GIT PULL] y2038 changes for vfs
Date: Tue, 24 May 2016 22:11:16 +0200	[thread overview]
Message-ID: <5722005.e8ezZRvZ1E@wuerfel> (raw)

The following changes since commit bf16200689118d19de1b8d2a3c314fc21f5dc7bb:

  Linux 4.6-rc3 (2016-04-10 17:58:30 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git tags/y2038-4.7

for you to fetch changes up to 4b277763c5b3ce6d60168797e6f38260416d9b13:

  vfs: Add support to document max and min inode times (2016-04-26 18:12:30 +0200)

----------------------------------------------------------------
y2038 changes for vfs

This is a preparation series for changing the VFS infrastructure to use
time64_t in inode timestamps, introducing a couple of simple conversion
helper functions that can be used to make the individual file systems
independent of the type of inode->i_{a,c,m}time and
iattr->ia_{a,c,m}time, following the plan described at
http://kernelnewbies.org/y2038/vfs.

The patches were done by Deepa Dinamani during her Outreachy internship
along with the following set of more than 100 patches that depend on
them but that can get merged through the individual file system
maintainer trees.

Thomas Gleixner reviewed the patches and the approach before, but after
http://www.spinics.net/lists/y2038/msg01514.html, both he and Al Viro
were busy in other areas of the kernel and neither of them picked them
up. I'm sending the series for inclusion directly so we can make
progress on the follow-up series and hopefully convert struct inode
to timespec64 in 4.8 or 4.9.

One small cleanup patch from Tina Ruchandani is included in the branch
as well, this is also related to the y2038 effort and is the last one
of a backlog of older patches that I picked up last year and otherwise
got merged through maintainer trees.

----------------------------------------------------------------
Deepa Dinamani (3):
      fs: Add current_fs_time_sec() function
      vfs: Add vfs_time accessors
      vfs: Add support to document max and min inode times

Tina Ruchandani (1):
      AFS: Correctly use 64-bit time for UUID

 fs/afs/main.c      |  6 ++----
 include/linux/fs.h | 29 ++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/fs/afs/main.c b/fs/afs/main.c
index 35de0c04729f..129ff432391c 100644
--- a/fs/afs/main.c
+++ b/fs/afs/main.c
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/completion.h>
 #include <linux/sched.h>
+#include <linux/ktime.h>
 #include "internal.h"
 
 MODULE_DESCRIPTION("AFS Client File System");
@@ -37,7 +38,6 @@ struct workqueue_struct *afs_wq;
  */
 static int __init afs_get_client_UUID(void)
 {
-	struct timespec ts;
 	u64 uuidtime;
 	u16 clockseq;
 	int ret;
@@ -48,9 +48,7 @@ static int __init afs_get_client_UUID(void)
 	if (ret < 0)
 		return ret;
 
-	getnstimeofday(&ts);
-	uuidtime = (u64) ts.tv_sec * 1000 * 1000 * 10;
-	uuidtime += ts.tv_nsec / 100;
+	uuidtime = ktime_divns(ktime_get_real(), 100);
 	uuidtime += AFS_UUID_TO_UNIX_TIME;
 	afs_uuid.time_low = uuidtime;
 	afs_uuid.time_mid = uuidtime >> 32;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 70e61b58baaf..d9573060591e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1362,7 +1362,14 @@ struct super_block {
 
 	/* Granularity of c/m/atime in ns.
 	   Cannot be worse than a second */
-	u32		   s_time_gran;
+	u32		s_time_gran;
+
+	/*
+	 * Max and min values for timestamps
+	 * according to the range supported by filesystems.
+	 */
+	time64_t	s_time_min;
+	time64_t	s_time_max;
 
 	/*
 	 * The next field is for VFS *only*. No filesystems have any business
@@ -1423,6 +1430,26 @@ struct super_block {
 
 extern struct timespec current_fs_time(struct super_block *sb);
 
+static inline struct timespec current_fs_time_sec(struct super_block *sb)
+{
+	return (struct timespec) { get_seconds(), 0 };
+}
+
+/* Place holder defines to ensure safe transition to timespec64
+ * in the vfs layer.
+ * These can be deleted after all filesystems and vfs are switched
+ * over to using 64 bit time.
+ */
+static inline struct timespec vfs_time_to_timespec(struct timespec inode_ts)
+{
+	return inode_ts;
+}
+
+static inline struct timespec timespec_to_vfs_time(struct timespec ts)
+{
+	return ts;
+}
+
 /*
  * Snapshotting support.
  */

             reply	other threads:[~2016-05-24 20:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 20:11 Arnd Bergmann [this message]
2016-05-24 22:23 ` [GIT PULL] y2038 changes for vfs Linus Torvalds
2016-05-24 22:44   ` Linus Torvalds
2016-05-25  0:10     ` Deepa Dinamani
2016-05-25 16:03   ` Arnd Bergmann
2016-05-25 21:33     ` Dave Chinner

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=5722005.e8ezZRvZ1E@wuerfel \
    --to=arnd@arndb.de \
    --cc=deepa.kernel@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.