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/ufs | |
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/ufs')
-rw-r--r-- | fs/ufs/dir.c | 6 | ||||
-rw-r--r-- | fs/ufs/ialloc.c | 2 | ||||
-rw-r--r-- | fs/ufs/inode.c | 6 | ||||
-rw-r--r-- | fs/ufs/namei.c | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index fa3bda1a860f..de01b8f2aa78 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c | |||
@@ -100,7 +100,7 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, | |||
100 | err = ufs_commit_chunk(page, pos, len); | 100 | err = ufs_commit_chunk(page, pos, len); |
101 | ufs_put_page(page); | 101 | ufs_put_page(page); |
102 | if (update_times) | 102 | if (update_times) |
103 | dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; | 103 | dir->i_mtime = dir->i_ctime = current_time(dir); |
104 | mark_inode_dirty(dir); | 104 | mark_inode_dirty(dir); |
105 | } | 105 | } |
106 | 106 | ||
@@ -389,7 +389,7 @@ got_it: | |||
389 | ufs_set_de_type(sb, de, inode->i_mode); | 389 | ufs_set_de_type(sb, de, inode->i_mode); |
390 | 390 | ||
391 | err = ufs_commit_chunk(page, pos, rec_len); | 391 | err = ufs_commit_chunk(page, pos, rec_len); |
392 | dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; | 392 | dir->i_mtime = dir->i_ctime = current_time(dir); |
393 | 393 | ||
394 | mark_inode_dirty(dir); | 394 | mark_inode_dirty(dir); |
395 | /* OFFSET_CACHE */ | 395 | /* OFFSET_CACHE */ |
@@ -530,7 +530,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, | |||
530 | pde->d_reclen = cpu_to_fs16(sb, to - from); | 530 | pde->d_reclen = cpu_to_fs16(sb, to - from); |
531 | dir->d_ino = 0; | 531 | dir->d_ino = 0; |
532 | err = ufs_commit_chunk(page, pos, to - from); | 532 | err = ufs_commit_chunk(page, pos, to - from); |
533 | inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; | 533 | inode->i_ctime = inode->i_mtime = current_time(inode); |
534 | mark_inode_dirty(inode); | 534 | mark_inode_dirty(inode); |
535 | out: | 535 | out: |
536 | ufs_put_page(page); | 536 | ufs_put_page(page); |
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index fd0203ce1f7f..9774555b3721 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c | |||
@@ -290,7 +290,7 @@ cg_found: | |||
290 | inode_init_owner(inode, dir, mode); | 290 | inode_init_owner(inode, dir, mode); |
291 | inode->i_blocks = 0; | 291 | inode->i_blocks = 0; |
292 | inode->i_generation = 0; | 292 | inode->i_generation = 0; |
293 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; | 293 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
294 | ufsi->i_flags = UFS_I(dir)->i_flags; | 294 | ufsi->i_flags = UFS_I(dir)->i_flags; |
295 | ufsi->i_lastfrag = 0; | 295 | ufsi->i_lastfrag = 0; |
296 | ufsi->i_shadow = 0; | 296 | ufsi->i_shadow = 0; |
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 9f49431e798d..edd3c0a58ed4 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -293,7 +293,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned index, | |||
293 | 293 | ||
294 | if (new) | 294 | if (new) |
295 | *new = 1; | 295 | *new = 1; |
296 | inode->i_ctime = CURRENT_TIME_SEC; | 296 | inode->i_ctime = current_time(inode); |
297 | if (IS_SYNC(inode)) | 297 | if (IS_SYNC(inode)) |
298 | ufs_sync_inode (inode); | 298 | ufs_sync_inode (inode); |
299 | mark_inode_dirty(inode); | 299 | mark_inode_dirty(inode); |
@@ -375,7 +375,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block, | |||
375 | mark_buffer_dirty(bh); | 375 | mark_buffer_dirty(bh); |
376 | if (IS_SYNC(inode)) | 376 | if (IS_SYNC(inode)) |
377 | sync_dirty_buffer(bh); | 377 | sync_dirty_buffer(bh); |
378 | inode->i_ctime = CURRENT_TIME_SEC; | 378 | inode->i_ctime = current_time(inode); |
379 | mark_inode_dirty(inode); | 379 | mark_inode_dirty(inode); |
380 | out: | 380 | out: |
381 | brelse (bh); | 381 | brelse (bh); |
@@ -1185,7 +1185,7 @@ static int ufs_truncate(struct inode *inode, loff_t size) | |||
1185 | truncate_setsize(inode, size); | 1185 | truncate_setsize(inode, size); |
1186 | 1186 | ||
1187 | __ufs_truncate_blocks(inode); | 1187 | __ufs_truncate_blocks(inode); |
1188 | inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; | 1188 | inode->i_mtime = inode->i_ctime = current_time(inode); |
1189 | mark_inode_dirty(inode); | 1189 | mark_inode_dirty(inode); |
1190 | out: | 1190 | out: |
1191 | UFSD("EXIT: err %d\n", err); | 1191 | UFSD("EXIT: err %d\n", err); |
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index a1559f762805..e3b263998130 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c | |||
@@ -153,7 +153,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir, | |||
153 | struct inode *inode = d_inode(old_dentry); | 153 | struct inode *inode = d_inode(old_dentry); |
154 | int error; | 154 | int error; |
155 | 155 | ||
156 | inode->i_ctime = CURRENT_TIME_SEC; | 156 | inode->i_ctime = current_time(inode); |
157 | inode_inc_link_count(inode); | 157 | inode_inc_link_count(inode); |
158 | ihold(inode); | 158 | ihold(inode); |
159 | 159 | ||
@@ -279,7 +279,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
279 | if (!new_de) | 279 | if (!new_de) |
280 | goto out_dir; | 280 | goto out_dir; |
281 | ufs_set_link(new_dir, new_de, new_page, old_inode, 1); | 281 | ufs_set_link(new_dir, new_de, new_page, old_inode, 1); |
282 | new_inode->i_ctime = CURRENT_TIME_SEC; | 282 | new_inode->i_ctime = current_time(new_inode); |
283 | if (dir_de) | 283 | if (dir_de) |
284 | drop_nlink(new_inode); | 284 | drop_nlink(new_inode); |
285 | inode_dec_link_count(new_inode); | 285 | inode_dec_link_count(new_inode); |
@@ -295,7 +295,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
295 | * Like most other Unix systems, set the ctime for inodes on a | 295 | * Like most other Unix systems, set the ctime for inodes on a |
296 | * rename. | 296 | * rename. |
297 | */ | 297 | */ |
298 | old_inode->i_ctime = CURRENT_TIME_SEC; | 298 | old_inode->i_ctime = current_time(old_inode); |
299 | 299 | ||
300 | ufs_delete_entry(old_dir, old_de, old_page); | 300 | ufs_delete_entry(old_dir, old_de, old_page); |
301 | mark_inode_dirty(old_inode); | 301 | mark_inode_dirty(old_inode); |