All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deepa Dinamani <deepa.kernel@gmail.com>
To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org
Cc: viro@zeniv.linux.org.uk, tglx@linutronix.de, arnd@arndb.de
Subject: [PATCH 2/2] vfs: Add vfs_time accessors
Date: Wed,  2 Mar 2016 07:31:50 -0800	[thread overview]
Message-ID: <1456932710-10926-3-git-send-email-deepa.kernel@gmail.com> (raw)
In-Reply-To: <1456932710-10926-1-git-send-email-deepa.kernel@gmail.com>

Add vfs_time accessors to help convert vfs timestamps to use
64 bit times. These create an abstraction layer so that
vfs inode times can be switched to use struct timespec64 from
struct timespec without breaking the individual filesystems
after they have incorporated these.

Use uapi exposed data types, timespec and timespec64 here to keep
minimal timestamp data type conversions in API's interfacing with
vfs.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/fs.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index e0b29d4..5bbddfc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1409,6 +1409,21 @@ 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.
  */
-- 
1.9.1


  parent reply	other threads:[~2016-03-02 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 15:31 [PATCH 0/2] Add infrastructure to support vfs 64 bit times Deepa Dinamani
2016-03-02 15:31 ` [PATCH 1/2] fs: Add current_fs_time_sec() function Deepa Dinamani
2016-03-02 16:21   ` [Y2038] " Arnd Bergmann
2016-03-02 15:31 ` Deepa Dinamani [this message]
2016-03-02 16:21   ` [Y2038] [PATCH 2/2] vfs: Add vfs_time accessors Arnd Bergmann
2016-03-02 16:22 ` [Y2038] [PATCH 0/2] Add infrastructure to support vfs 64 bit times Arnd Bergmann
2016-04-08 15:47 [PATCH 0/2] Add infrastructure to support vfs 64 bit timestamps Deepa Dinamani
2016-04-08 15:47 ` [PATCH 2/2] vfs: Add vfs_time accessors Deepa Dinamani
2016-04-09  1:17   ` Arnd Bergmann

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=1456932710-10926-3-git-send-email-deepa.kernel@gmail.com \
    --to=deepa.kernel@gmail.com \
    --cc=arnd@arndb.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --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.