diff mbox

[2/2] vfs: Add vfs_time accessors

Message ID 1460130431-7865-3-git-send-email-deepa.kernel@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Deepa Dinamani April 8, 2016, 3:47 p.m. UTC
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(+)

Comments

Arnd Bergmann April 9, 2016, 1:17 a.m. UTC | #1
On Friday 08 April 2016, Deepa Dinamani wrote:
> 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>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/fs.h b/include/linux/fs.h
index fc09058..d0bf64f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1440,6 +1440,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.
  */