Skip to contentSkip to conversation

Add infrastructure to support vfs 64 bit timestamps

PATCH In review Deepa Dinamani 3 participants 8 messages Apr 8, 2016 – Apr 26, 2016 VFS

lore
Share & tools
lore
#0 lore raw

cover Add infrastructure to support vfs 64 bit timestamps

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

#1 lore raw

PATCH 1/2 fs: Add current_fs_time_sec() function

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.

---
 include/linux/fs.h | 5 +++++
 1 file changed, 5 insertions(+)
include/linux/fs.h +5 -0
index e3c0b7e..fc09058 100644
@@ -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.
  */
Signature · 1 line
1.9.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] fs: Add current_fs_time_sec() function

Quoted 13 lines · Deepa Dinamani

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.

Quoted 7 lines

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.

#3 lore raw

PATCH 2/2 vfs: Add vfs_time accessors

In reply to Deepa Dinamani

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.

---
 include/linux/fs.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
include/linux/fs.h +15 -0
index fc09058..d0bf64f 100644
@@ -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.
  */
Signature · 1 line
1.9.1
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] vfs: Add vfs_time accessors

Quoted 11 lines · Deepa Dinamani

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.

#5 lore raw
In reply to Deepa Dinamani
Quoted 8 lines · Deepa Dinamani

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.

Quoted 7 lines

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

#6 lore raw
Quoted 15 lines · On Friday 08 April 2016 08:49:14 Thomas Gleixner wrote:
Quoted 13 lines · Deepa Dinamani

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

Quoted 4 lines
Quoted 2 lines

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

#7 lore raw
In reply to Thomas Gleixner
Quoted 15 lines · On Friday 08 April 2016 08:49:14 Thomas Gleixner wrote:
Quoted 13 lines · Deepa Dinamani

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

Quoted 4 lines
Quoted 2 lines

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