Skip to content

Commit 24a8b7b

Browse files
ita93brauner
authored andcommitted
fs: use inode_set_ctime_to_ts to set inode ctime to current time
The function inode_set_ctime_current simply retrieves the current time and assigns it to the field __i_ctime without any alterations. Therefore, it is possible to set ctime to now directly using inode_set_ctime_to_ts Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com> Link: https://lore.kernel.org/r/20240228173031.3208743-1-phind.uet@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 7ded1e3 commit 24a8b7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2510,7 +2510,7 @@ struct timespec64 inode_set_ctime_current(struct inode *inode)
25102510
{
25112511
struct timespec64 now = current_time(inode);
25122512

2513-
inode_set_ctime(inode, now.tv_sec, now.tv_nsec);
2513+
inode_set_ctime_to_ts(inode, now);
25142514
return now;
25152515
}
25162516
EXPORT_SYMBOL(inode_set_ctime_current);

0 commit comments

Comments
 (0)