diff options
author | Deepa Dinamani <deepa.kernel@gmail.com> | 2016-09-14 10:48:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-27 21:06:22 -0400 |
commit | 02027d42c3f747945f19111d3da2092ed2148ac8 (patch) | |
tree | 1eac59f95ba905fb1d1fe5a53a792145e8e9c267 /fs/fat/namei_vfat.c | |
parent | 078cd8279e659989b103359bb22373cc79445bde (diff) |
fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
CURRENT_TIME_SEC is not y2038 safe. current_time() will
be transitioned to use 64 bit time along with vfs in a
separate patch.
There is no plan to transistion CURRENT_TIME_SEC to use
y2038 safe time interfaces.
current_time() will also be extended to use superblock
range checking parameters when range checking is introduced.
This works because alloc_super() fills in the the s_time_gran
in super block to NSEC_PER_SEC.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fat/namei_vfat.c')
-rw-r--r-- | fs/fat/namei_vfat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index 92b7363dafa9..d4a1b2bfda64 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c | |||
@@ -777,7 +777,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
777 | 777 | ||
778 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 778 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
779 | 779 | ||
780 | ts = CURRENT_TIME_SEC; | 780 | ts = current_time(dir); |
781 | err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); | 781 | err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); |
782 | if (err) | 782 | if (err) |
783 | goto out; | 783 | goto out; |
@@ -821,7 +821,7 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry) | |||
821 | drop_nlink(dir); | 821 | drop_nlink(dir); |
822 | 822 | ||
823 | clear_nlink(inode); | 823 | clear_nlink(inode); |
824 | inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; | 824 | inode->i_mtime = inode->i_atime = current_time(inode); |
825 | fat_detach(inode); | 825 | fat_detach(inode); |
826 | dentry->d_time = dir->i_version; | 826 | dentry->d_time = dir->i_version; |
827 | out: | 827 | out: |
@@ -847,7 +847,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry) | |||
847 | if (err) | 847 | if (err) |
848 | goto out; | 848 | goto out; |
849 | clear_nlink(inode); | 849 | clear_nlink(inode); |
850 | inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; | 850 | inode->i_mtime = inode->i_atime = current_time(inode); |
851 | fat_detach(inode); | 851 | fat_detach(inode); |
852 | dentry->d_time = dir->i_version; | 852 | dentry->d_time = dir->i_version; |
853 | out: | 853 | out: |
@@ -866,7 +866,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
866 | 866 | ||
867 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 867 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
868 | 868 | ||
869 | ts = CURRENT_TIME_SEC; | 869 | ts = current_time(dir); |
870 | cluster = fat_alloc_new_dir(dir, &ts); | 870 | cluster = fat_alloc_new_dir(dir, &ts); |
871 | if (cluster < 0) { | 871 | if (cluster < 0) { |
872 | err = cluster; | 872 | err = cluster; |
@@ -931,7 +931,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
931 | } | 931 | } |
932 | } | 932 | } |
933 | 933 | ||
934 | ts = CURRENT_TIME_SEC; | 934 | ts = current_time(old_dir); |
935 | if (new_inode) { | 935 | if (new_inode) { |
936 | if (is_dir) { | 936 | if (is_dir) { |
937 | err = fat_dir_empty(new_inode); | 937 | err = fat_dir_empty(new_inode); |