Resending for inclusion in Thomas's tree.
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 and Thomas Gleixner.
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(+)
-- 1.9.1
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 e3c0b7e..fc09058 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1435,6 +1435,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 Friday 08 April 2016, 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
Reviewed-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 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. */
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
On Fri, 8 Apr 2016, Deepa Dinamani wrote:
Resending for inclusion in Thomas's tree.
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.
Al: Are you ok with those? Can you ship them to Linus or shall I route them?
Thanks,
tglx
On Friday 08 April 2016 08:49:14 Thomas Gleixner wrote:
On Fri, 8 Apr 2016, Deepa Dinamani wrote:
Resending for inclusion in Thomas's tree.
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.
Al: Are you ok with those? Can you ship them to Linus or shall I route them?
It seems these fell through the cracks, any chance we can still get them into 4.6?
Arnd
On Friday 08 April 2016 08:49:14 Thomas Gleixner wrote:
On Fri, 8 Apr 2016, Deepa Dinamani wrote:
Resending for inclusion in Thomas's tree.
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.
Al: Are you ok with those? Can you ship them to Linus or shall I route them?
I guess it's too late for v4.6 now, but I've put all three patches into my y2038 tree so they get some exposure in linux-next and so we can start queuing some of the patches depending on them on top for v4.7.
I can send these on as pull requests to either of you, Thomas or Al, or I'll send them to Linus directly in the merge window if you don't want to deal with them.
Arnd