fs: refactor file timestamp update logic
[ Upstream commit
3cd9a42f1b5e34d3972237cbf8541af60844cbd4 ]
Currently the two high-level APIs use two helper functions to implement
almost all of the logic. Refactor the two helpers and the common logic
into a new file_update_time_flags routine that gets the iocb flags or
0 in case of file_update_time passed so that the entire logic is
contained in a single function and can be easily understood and modified.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20251120064859.2911749-2-hch@lst.de
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Stable-dep-of:
7f30e7a42371 ("fs: lift the FMODE_NOCMTIME check into file_update_time_flags")
Signed-off-by: Sasha Levin <sashal@kernel.org>