From 02027d42c3f747945f19111d3da2092ed2148ac8 Mon Sep 17 00:00:00 2001 From: Deepa Dinamani Date: Wed, 14 Sep 2016 07:48:05 -0700 Subject: 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 Acked-by: Jan Kara Signed-off-by: Al Viro --- fs/ufs/namei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/ufs/namei.c') 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, struct inode *inode = d_inode(old_dentry); int error; - inode->i_ctime = CURRENT_TIME_SEC; + inode->i_ctime = current_time(inode); inode_inc_link_count(inode); ihold(inode); @@ -279,7 +279,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, if (!new_de) goto out_dir; ufs_set_link(new_dir, new_de, new_page, old_inode, 1); - new_inode->i_ctime = CURRENT_TIME_SEC; + new_inode->i_ctime = current_time(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); @@ -295,7 +295,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = CURRENT_TIME_SEC; + old_inode->i_ctime = current_time(old_inode); ufs_delete_entry(old_dir, old_de, old_page); mark_inode_dirty(old_inode); -- cgit v1.2.3