]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: implement atime updates in xfs_trans_ichgtime
authorDarrick J. Wong <djwong@kernel.org>
Wed, 2 Oct 2024 01:10:42 +0000 (18:10 -0700)
committerAndrey Albershteyn <aalbersh@redhat.com>
Fri, 4 Oct 2024 10:42:07 +0000 (12:42 +0200)
Source kernel commit: 3d1dfb6df9b7b9ffc95499b9ddd92d949e5a60d2

Enable xfs_trans_ichgtime to change the inode access time so that we can
use this function to set inode times when allocating inodes instead of
open-coding it.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_shared.h
libxfs/xfs_trans_inode.c

index 34f104ed372c096ec45a76195b5ff497bf847ebb..9a705381f9e4ac9d4ffd1f17d13358c4cd74e5d8 100644 (file)
@@ -183,6 +183,7 @@ void        xfs_log_get_max_trans_res(struct xfs_mount *mp,
 #define        XFS_ICHGTIME_MOD        0x1     /* data fork modification timestamp */
 #define        XFS_ICHGTIME_CHG        0x2     /* inode field change timestamp */
 #define        XFS_ICHGTIME_CREATE     0x4     /* inode create timestamp */
+#define        XFS_ICHGTIME_ACCESS     0x8     /* last access timestamp */
 
 /* Computed inode geometry for the filesystem. */
 struct xfs_ino_geometry {
index f8484eb20e8257dee5f6956cb18ac09430d1d089..45b513bc5ceb40f3c7ff6847811c7b18742fe61e 100644 (file)
@@ -65,6 +65,8 @@ xfs_trans_ichgtime(
                inode_set_mtime_to_ts(inode, tv);
        if (flags & XFS_ICHGTIME_CHG)
                inode_set_ctime_to_ts(inode, tv);
+       if (flags & XFS_ICHGTIME_ACCESS)
+               inode_set_atime_to_ts(inode, tv);
        if (flags & XFS_ICHGTIME_CREATE)
                ip->i_crtime = tv;
 }