The series contains infrastucture patches required to convert vfs times to use 64 bit time.
The intention is to include these as part of 4.6 so that the follow on patches can go into 4.7.
Patch 1 is as per the agreed upon RFC approach 2b: https://lkml.org/lkml/2016/2/12/105 And, patch 2 is as per previously agreed upon discussion in: https://lkml.org/lkml/2016/1/7/20
The patches that will use these will be posted for the subsequent kernel release.
The series and the plan have been discussed with Arnd Bergmann.
Deepa Dinamani (2): fs: Add current_fs_time_sec() function vfs: Add vfs_time accessors
include/linux/fs.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
This is in preparation for the series that transitions filesystem timestamps to use 64 bit time and hence make them y2038 safe.
The function is meant to replace CURRENT_TIME_SEC macro. The macro CURRENT_TIME_SEC does not represent filesystem times correctly as it cannot perform range checks. current_fs_time_sec() will be extended to include these.
CURRENT_TIME_SEC is also not y2038 safe. current_fs_time_sec() will be transitioned to use 64 bit time along with vfs in a separate series.
The function is inline for now to maintain similar performance to that of the macro.
The function takes super block as a parameter to allow for future range checking of filesystem timestamps.
Signed-off-by: Deepa Dinamani deepa.kernel@gmail.com --- include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1af4727..e0b29d4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1404,6 +1404,11 @@ 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 }; +} + /* * Snapshotting support. */
On Wednesday 02 March 2016 07:31:49 Deepa Dinamani wrote:
This is in preparation for the series that transitions filesystem timestamps to use 64 bit time and hence make them y2038 safe.
The function is meant to replace CURRENT_TIME_SEC macro. The macro CURRENT_TIME_SEC does not represent filesystem times correctly as it cannot perform range checks. current_fs_time_sec() will be extended to include these.
CURRENT_TIME_SEC is also not y2038 safe. current_fs_time_sec() will be transitioned to use 64 bit time along with vfs in a separate series.
The function is inline for now to maintain similar performance to that of the macro.
The function takes super block as a parameter to allow for future range checking of filesystem timestamps.
Signed-off-by: Deepa Dinamani deepa.kernel@gmail.com
Acked-by: Arnd Bergmann arnd@arndb.de
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. */
On Wednesday 02 March 2016 07:31:50 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
Acked-by: Arnd Bergmann arnd@arndb.de
On Wednesday 02 March 2016 07:31:48 Deepa Dinamani wrote:
The series contains infrastucture patches required to convert vfs times to use 64 bit time.
The intention is to include these as part of 4.6 so that the follow on patches can go into 4.7.
Patch 1 is as per the agreed upon RFC approach 2b: https://lkml.org/lkml/2016/2/12/105 And, patch 2 is as per previously agreed upon discussion in: https://lkml.org/lkml/2016/1/7/20
The patches that will use these will be posted for the subsequent kernel release.
The series and the plan have been discussed with Arnd Bergmann.
Looks all good to me.
Al, Thomas: can one of you pick these up into the vfs or the tip/2038 tree?
Arnd