lkml.org 
[lkml]   [2016]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v2b 1/5] vfs: Add vfs_time accessors
Date
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 4af612f..1623c95 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1412,6 +1412,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
\
 
 \ /
  Last update: 2016-02-12 11:01    [W:0.876 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site