diff options
author | Jeff Layton <jlayton@kernel.org> | 2023-08-07 15:38:34 -0400 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-08-09 08:56:37 +0200 |
commit | 541d4c798a598854fcce7326d947cbcbd35701d6 (patch) | |
tree | 26703c5d9b35218747b417efd69d77459a159a87 /include/linux/fs.h | |
parent | 0d72b92883c651a11059d93335f33d65c6eb653b (diff) |
fs: drop the timespec64 arg from generic_update_time
In future patches we're going to change how the ctime is updated
to keep track of when it has been queried. The way that the update_time
operation works (and a lot of its callers) make this difficult, since
they grab a timestamp early and then pass it down to eventually be
copied into the inode.
All of the existing update_time callers pass in the result of
current_time() in some fashion. Drop the "time" parameter from
generic_update_time, and rework it to fetch its own timestamp.
This change means that an update_time could fetch a different timestamp
than was seen in inode_needs_update_time. update_time is only ever
called with one of two flag combinations: Either S_ATIME is set, or
S_MTIME|S_CTIME|S_VERSION are set.
With this change we now treat the flags argument as an indicator that
some value needed to be updated when last checked, rather than an
indication to update specific timestamps.
Rework the logic for updating the timestamps and put it in a new
inode_update_timestamps helper that other update_time routines can use.
S_ATIME is as treated as we always have, but if any of the other three
are set, then we attempt to update all three.
Also, some callers of generic_update_time need to know what timestamps
were actually updated. Change it to return an S_* flag mask to indicate
that and rework the callers to expect it.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Message-Id: <20230807-mgctime-v7-3-d1dec143a704@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 85977cdeda94..bb3c2c4f871f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2343,7 +2343,8 @@ extern int current_umask(void); extern void ihold(struct inode * inode); extern void iput(struct inode *); -extern int generic_update_time(struct inode *, struct timespec64 *, int); +int inode_update_timestamps(struct inode *inode, int flags); +int generic_update_time(struct inode *, int); /* /sys/fs */ extern struct kobject *fs_kobj; |