diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2016-06-08 13:51:01 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2016-06-08 13:51:01 +1000 |
commit | a9f7d46dd9b13d21463886c621c12c0998d55294 (patch) | |
tree | 6f8081c2bca56015b79aae2b5665ea286637e80c | |
parent | 0f4a35eafb1778dfea6e536b552d40ae33818baf (diff) | |
parent | 4b277763c5b3ce6d60168797e6f38260416d9b13 (diff) | |
download | linux-next-a9f7d46dd9b13d21463886c621c12c0998d55294.tar.gz |
Merge remote-tracking branch 'y2038/y2038'
-rw-r--r-- | fs/afs/main.c | 6 | ||||
-rw-r--r-- | include/linux/fs.h | 29 |
2 files changed, 30 insertions, 5 deletions
diff --git a/fs/afs/main.c b/fs/afs/main.c index 35de0c04729f..129ff432391c 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -14,6 +14,7 @@ #include <linux/init.h> #include <linux/completion.h> #include <linux/sched.h> +#include <linux/ktime.h> #include "internal.h" MODULE_DESCRIPTION("AFS Client File System"); @@ -37,7 +38,6 @@ struct workqueue_struct *afs_wq; */ static int __init afs_get_client_UUID(void) { - struct timespec ts; u64 uuidtime; u16 clockseq; int ret; @@ -48,9 +48,7 @@ static int __init afs_get_client_UUID(void) if (ret < 0) return ret; - getnstimeofday(&ts); - uuidtime = (u64) ts.tv_sec * 1000 * 1000 * 10; - uuidtime += ts.tv_nsec / 100; + uuidtime = ktime_divns(ktime_get_real(), 100); uuidtime += AFS_UUID_TO_UNIX_TIME; afs_uuid.time_low = uuidtime; afs_uuid.time_mid = uuidtime >> 32; diff --git a/include/linux/fs.h b/include/linux/fs.h index fd822343fa47..9daf137eb600 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1391,7 +1391,14 @@ struct super_block { /* Granularity of c/m/atime in ns. Cannot be worse than a second */ - u32 s_time_gran; + u32 s_time_gran; + + /* + * Max and min values for timestamps + * according to the range supported by filesystems. + */ + time64_t s_time_min; + time64_t s_time_max; /* * The next field is for VFS *only*. No filesystems have any business @@ -1452,6 +1459,26 @@ 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 }; +} + +/* 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. */ |