aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2016-09-14 10:48:05 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-09-27 21:06:22 -0400
commit02027d42c3f747945f19111d3da2092ed2148ac8 (patch)
tree1eac59f95ba905fb1d1fe5a53a792145e8e9c267 /fs/hfs
parent078cd8279e659989b103359bb22373cc79445bde (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/hfs')
-rw-r--r--fs/hfs/catalog.c8
-rw-r--r--fs/hfs/dir.c2
-rw-r--r--fs/hfs/inode.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c
index 8f4afd3f5108..8a66405b0f8b 100644
--- a/fs/hfs/catalog.c
+++ b/fs/hfs/catalog.c
@@ -125,7 +125,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct i
125 goto err1; 125 goto err1;
126 126
127 dir->i_size++; 127 dir->i_size++;
128 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 128 dir->i_mtime = dir->i_ctime = current_time(dir);
129 mark_inode_dirty(dir); 129 mark_inode_dirty(dir);
130 hfs_find_exit(&fd); 130 hfs_find_exit(&fd);
131 return 0; 131 return 0;
@@ -261,7 +261,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str)
261 } 261 }
262 262
263 dir->i_size--; 263 dir->i_size--;
264 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 264 dir->i_mtime = dir->i_ctime = current_time(dir);
265 mark_inode_dirty(dir); 265 mark_inode_dirty(dir);
266 res = 0; 266 res = 0;
267out: 267out:
@@ -321,7 +321,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
321 if (err) 321 if (err)
322 goto out; 322 goto out;
323 dst_dir->i_size++; 323 dst_dir->i_size++;
324 dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME_SEC; 324 dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir);
325 mark_inode_dirty(dst_dir); 325 mark_inode_dirty(dst_dir);
326 326
327 /* finally remove the old entry */ 327 /* finally remove the old entry */
@@ -333,7 +333,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
333 if (err) 333 if (err)
334 goto out; 334 goto out;
335 src_dir->i_size--; 335 src_dir->i_size--;
336 src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME_SEC; 336 src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir);
337 mark_inode_dirty(src_dir); 337 mark_inode_dirty(src_dir);
338 338
339 type = entry.type; 339 type = entry.type;
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 163190ecc0d2..4f379fb91691 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -268,7 +268,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)
268 if (res) 268 if (res)
269 return res; 269 return res;
270 clear_nlink(inode); 270 clear_nlink(inode);
271 inode->i_ctime = CURRENT_TIME_SEC; 271 inode->i_ctime = current_time(inode);
272 hfs_delete_inode(inode); 272 hfs_delete_inode(inode);
273 mark_inode_dirty(inode); 273 mark_inode_dirty(inode);
274 return 0; 274 return 0;
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index c6a32415735b..b8b57ecbe1ab 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -193,7 +193,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
193 inode->i_uid = current_fsuid(); 193 inode->i_uid = current_fsuid();
194 inode->i_gid = current_fsgid(); 194 inode->i_gid = current_fsgid();
195 set_nlink(inode, 1); 195 set_nlink(inode, 1);
196 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 196 inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
197 HFS_I(inode)->flags = 0; 197 HFS_I(inode)->flags = 0;
198 HFS_I(inode)->rsrc_inode = NULL; 198 HFS_I(inode)->rsrc_inode = NULL;
199 HFS_I(inode)->fs_blocks = 0; 199 HFS_I(inode)->fs_blocks = 0;