mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 04:47:05 +00:00
btrfs: have it use inode_update_timestamps
In later patches, we're going to drop the "now" argument from the update_time operation. Have btrfs_update_time use the new inode_update_timestamps helper to fetch a new timestamp and update it properly. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Message-Id: <20230807-mgctime-v7-4-d1dec143a704@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
541d4c798a
commit
bb7cc0a62e
1 changed files with 1 additions and 8 deletions
|
@ -6068,14 +6068,7 @@ static int btrfs_update_time(struct inode *inode, struct timespec64 *now,
|
|||
if (btrfs_root_readonly(root))
|
||||
return -EROFS;
|
||||
|
||||
if (flags & S_VERSION)
|
||||
dirty |= inode_maybe_inc_iversion(inode, dirty);
|
||||
if (flags & S_CTIME)
|
||||
inode_set_ctime_to_ts(inode, *now);
|
||||
if (flags & S_MTIME)
|
||||
inode->i_mtime = *now;
|
||||
if (flags & S_ATIME)
|
||||
inode->i_atime = *now;
|
||||
dirty = inode_update_timestamps(inode, flags);
|
||||
return dirty ? btrfs_dirty_inode(BTRFS_I(inode)) : 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue