]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: remove inode_update_time
authorChristoph Hellwig <hch@lst.de>
Thu, 8 Jan 2026 14:19:01 +0000 (15:19 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 12 Jan 2026 13:01:32 +0000 (14:01 +0100)
The only external user is gone now, open code it in the two VFS
callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260108141934.2052404-2-hch@lst.de
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/inode.c
include/linux/fs.h

index 521383223d8a455a2d09caff70615032213e3dfc..07effa0cb9999c1765e9e4470650b3ca02d2ed66 100644 (file)
@@ -2157,19 +2157,6 @@ int generic_update_time(struct inode *inode, int flags)
 }
 EXPORT_SYMBOL(generic_update_time);
 
-/*
- * This does the actual work of updating an inodes time or version.  Must have
- * had called mnt_want_write() before calling this.
- */
-int inode_update_time(struct inode *inode, int flags)
-{
-       if (inode->i_op->update_time)
-               return inode->i_op->update_time(inode, flags);
-       generic_update_time(inode, flags);
-       return 0;
-}
-EXPORT_SYMBOL(inode_update_time);
-
 /**
  *     atime_needs_update      -       update the access time
  *     @path: the &struct path to update
@@ -2237,7 +2224,10 @@ void touch_atime(const struct path *path)
         * We may also fail on filesystems that have the ability to make parts
         * of the fs read only, e.g. subvolumes in Btrfs.
         */
-       inode_update_time(inode, S_ATIME);
+       if (inode->i_op->update_time)
+               inode->i_op->update_time(inode, S_ATIME);
+       else
+               generic_update_time(inode, S_ATIME);
        mnt_put_write_access(mnt);
 skip_update:
        sb_end_write(inode->i_sb);
@@ -2392,7 +2382,10 @@ static int file_update_time_flags(struct file *file, unsigned int flags)
 
        if (mnt_get_write_access_file(file))
                return 0;
-       ret = inode_update_time(inode, sync_mode);
+       if (inode->i_op->update_time)
+               ret = inode->i_op->update_time(inode, sync_mode);
+       else
+               ret = generic_update_time(inode, sync_mode);
        mnt_put_write_access_file(file);
        return ret;
 }
index 04ceeca12a0d5caadb68643bf68b7a78e17c08d4..294e4c0b5aa80277cb647bef9d5bb4078a4df575 100644 (file)
@@ -2246,7 +2246,6 @@ 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, int flags);
 
 static inline void file_accessed(struct file *file)
 {