mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
fs: Replace CURRENT_TIME with current_time() for inode timestamps
CURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_time() instead. CURRENT_TIME is also not y2038 safe. This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. As part of the effort current_time() will be extended to do range checks. Hence, it is necessary for all file system timestamps to use current_time(). Also, current_time() will be transitioned along with vfs to be y2038 safe. Note that whenever a single call to current_time() is used to change timestamps in different inodes, it is because they share the same time granularity. Signed-off-by: Deepa Dinamani <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Felipe Balbi <[email protected]> Acked-by: Steven Whitehouse <[email protected]> Acked-by: Ryusuke Konishi <[email protected]> Acked-by: David Sterba <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
2554c72edb
commit
078cd8279e
76 changed files with 182 additions and 182 deletions
|
|
@ -299,7 +299,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
|
|||
f2fs_dentry_kunmap(dir, page);
|
||||
set_page_dirty(page);
|
||||
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
f2fs_put_page(page, 1);
|
||||
}
|
||||
|
|
@ -451,7 +451,7 @@ void update_parent_metadata(struct inode *dir, struct inode *inode,
|
|||
f2fs_i_links_write(dir, true);
|
||||
clear_inode_flag(inode, FI_NEW_INODE);
|
||||
}
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
|
||||
if (F2FS_I(dir)->i_current_depth != current_depth)
|
||||
|
|
@ -656,7 +656,7 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode)
|
|||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
f2fs_i_links_write(dir, false);
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
|
||||
f2fs_i_links_write(inode, false);
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
|
|
@ -703,7 +703,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
|
|||
kunmap(page); /* kunmap - pair of f2fs_find_entry */
|
||||
set_page_dirty(page);
|
||||
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
|
||||
if (inode)
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ int f2fs_truncate(struct inode *inode)
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
f2fs_mark_inode_dirty_sync(inode);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -708,7 +708,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
if (err)
|
||||
return err;
|
||||
}
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1395,7 +1395,7 @@ static long f2fs_fallocate(struct file *file, int mode,
|
|||
}
|
||||
|
||||
if (!ret) {
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
f2fs_mark_inode_dirty_sync(inode);
|
||||
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
|
||||
}
|
||||
|
|
@ -1487,7 +1487,7 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
|
|||
fi->i_flags = flags;
|
||||
inode_unlock(inode);
|
||||
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
f2fs_set_inode_flags(inode);
|
||||
out:
|
||||
mnt_drop_write_file(filp);
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page,
|
|||
set_page_dirty(page);
|
||||
f2fs_put_page(page, 1);
|
||||
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
|
||||
if (inode)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
|
|||
|
||||
inode->i_ino = ino;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
inode->i_generation = sbi->s_next_generation++;
|
||||
|
||||
err = insert_inode_locked(inode);
|
||||
|
|
@ -177,7 +177,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
|
|||
|
||||
f2fs_balance_fs(sbi, true);
|
||||
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
ihold(inode);
|
||||
|
||||
set_inode_flag(inode, FI_INC_LINK);
|
||||
|
|
@ -718,7 +718,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||
|
||||
f2fs_set_link(new_dir, new_entry, new_page, old_inode);
|
||||
|
||||
new_inode->i_ctime = CURRENT_TIME;
|
||||
new_inode->i_ctime = current_time(new_inode);
|
||||
down_write(&F2FS_I(new_inode)->i_sem);
|
||||
if (old_dir_entry)
|
||||
f2fs_i_links_write(new_inode, false);
|
||||
|
|
@ -772,7 +772,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||
file_set_enc_name(old_inode);
|
||||
up_write(&F2FS_I(old_inode)->i_sem);
|
||||
|
||||
old_inode->i_ctime = CURRENT_TIME;
|
||||
old_inode->i_ctime = current_time(old_inode);
|
||||
f2fs_mark_inode_dirty_sync(old_inode);
|
||||
|
||||
f2fs_delete_entry(old_entry, old_page, old_dir, NULL);
|
||||
|
|
@ -927,7 +927,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||
file_lost_pino(old_inode);
|
||||
up_write(&F2FS_I(old_inode)->i_sem);
|
||||
|
||||
old_dir->i_ctime = CURRENT_TIME;
|
||||
old_dir->i_ctime = current_time(old_dir);
|
||||
if (old_nlink) {
|
||||
down_write(&F2FS_I(old_dir)->i_sem);
|
||||
f2fs_i_links_write(old_dir, old_nlink > 0);
|
||||
|
|
@ -942,7 +942,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||
file_lost_pino(new_inode);
|
||||
up_write(&F2FS_I(new_inode)->i_sem);
|
||||
|
||||
new_dir->i_ctime = CURRENT_TIME;
|
||||
new_dir->i_ctime = current_time(new_dir);
|
||||
if (new_nlink) {
|
||||
down_write(&F2FS_I(new_dir)->i_sem);
|
||||
f2fs_i_links_write(new_dir, new_nlink > 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue