aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-10-14 13:11:00 -0400
committerDavid Sterba <dsterba@suse.com>2021-10-26 19:08:08 +0200
commite60feb445fce9e51c1558a6aa7faf9dd5ded533b (patch)
tree8e294e906c689646e276f52c0c3acbcbf5e6194c /include/linux/fs.h
parentbtrfs: fix deadlock when defragging transparent huge pages (diff)
downloadlinux-dev-e60feb445fce9e51c1558a6aa7faf9dd5ded533b.tar.xz
linux-dev-e60feb445fce9e51c1558a6aa7faf9dd5ded533b.zip
fs: export an inode_update_time helper
If you already have an inode and need to update the time on the inode there is no way to do this properly. Export this helper to allow file systems to update time on the inode so the appropriate handler is called, either ->update_time or generic_update_time. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e7a633353fd2..56eba723477e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2498,6 +2498,8 @@ enum file_time_flags {
extern bool atime_needs_update(const struct path *, struct inode *);
extern void touch_atime(const struct path *);
+int inode_update_time(struct inode *inode, struct timespec64 *time, int flags);
+
static inline void file_accessed(struct file *file)
{
if (!(file->f_flags & O_NOATIME))