diff mbox series

[GIT,PULL,for,v6.7] vfs time updates

Message ID 20231027-vfs-ctime-6271b23ced64@brauner (mailing list archive)
State New, archived
Headers show
Series [GIT,PULL,for,v6.7] vfs time updates | expand

Commit Message

Christian Brauner Oct. 27, 2023, 2:51 p.m. UTC
Hey Linus,

This pull request will have a merge conflict with the vfs-6.7.super
pr that will be available under the following link once sent:

    https://lore.kernel.org/r/20231027-vfs-super-aa4b9ecfd803@brauner

/* Summary */
This finishes the conversion of all inode time fields to accessor
functions as discussed on list. Changing timestamps manually as we used
to do before is error prone. Using accessors function makes this robust.

It does not contain the switch of the time fields to discrete 64 bit
integers to replace struct timespec and free up space in struct inode.
But after this, the switch can be trivially made and the patch should
only affect the vfs if we decide to do it.

/* Testing */
clang: Debian clang version 16.0.6 (16)
gcc: gcc (Debian 13.2.0-5) 13.2.0

All patches are based on v6.6-rc5 and have been sitting in linux-next.
No build failures or warnings were observed. xfstests were run for the
major filesystems. They pass.

/* Conflicts */

## Merge Conflicts with other trees

The following trees will have a merge conflict with this tree.

[1] linux-next: manual merge of the vfs-brauner tree with the ntfs3 tree
    https://lore.kernel.org/r/20231010103744.2e7085a6@canb.auug.org.au

[2] linux-next: manual merge of the vfs-brauner tree with the ext3 tree
    https://lore.kernel.org/r/20231027104356.3fda2bc9@canb.auug.org.au

[3] This will have a merge conflict with the btrfs and vfs.super trees.
    The vfs.super tree does contain the btrfs tree this cycle and the
    conflict resolution will be provided on the vfs-6.7.super pr as
    mentioned above.

[4] For bcachefs a whole separate patch would be needed:

>From 7aaefe3c8d4eda19519235c7a575d964120e31a5 Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@kernel.org>
Date: Sat, 30 Sep 2023 08:41:01 -0400
Subject: [PATCH] bcachefs: convert to new timestamp accessors

Convert to using the new inode timestamp accessor functions.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/bcachefs/fs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

pr-tracker-bot@kernel.org Oct. 30, 2023, 8:05 p.m. UTC | #1
The pull request you sent on Fri, 27 Oct 2023 16:51:07 +0200:

> git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.7.ctime

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/14ab6d425e80674b6a0145f05719b11e82e64824

Thank you!
diff mbox series

Patch

diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 09137a20449b..1fbaad27d07b 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -66,9 +66,9 @@  void bch2_inode_update_after_write(struct btree_trans *trans,
 	inode->v.i_mode	= bi->bi_mode;
 
 	if (fields & ATTR_ATIME)
-		inode->v.i_atime = bch2_time_to_timespec(c, bi->bi_atime);
+		inode_set_atime_to_ts(&inode->v, bch2_time_to_timespec(c, bi->bi_atime));
 	if (fields & ATTR_MTIME)
-		inode->v.i_mtime = bch2_time_to_timespec(c, bi->bi_mtime);
+		inode_set_mtime_to_ts(&inode->v, bch2_time_to_timespec(c, bi->bi_mtime));
 	if (fields & ATTR_CTIME)
 		inode_set_ctime_to_ts(&inode->v, bch2_time_to_timespec(c, bi->bi_ctime));
 
@@ -753,8 +753,8 @@  static int bch2_getattr(struct mnt_idmap *idmap,
 	stat->gid	= inode->v.i_gid;
 	stat->rdev	= inode->v.i_rdev;
 	stat->size	= i_size_read(&inode->v);
-	stat->atime	= inode->v.i_atime;
-	stat->mtime	= inode->v.i_mtime;
+	stat->atime	= inode_get_atime(&inode->v);
+	stat->mtime	= inode_get_mtime(&inode->v);
 	stat->ctime	= inode_get_ctime(&inode->v);
 	stat->blksize	= block_bytes(c);
 	stat->blocks	= inode->v.i_blocks;
@@ -1418,8 +1418,8 @@  static int inode_update_times_fn(struct btree_trans *trans,
 {
 	struct bch_fs *c = inode->v.i_sb->s_fs_info;
 
-	bi->bi_atime	= timespec_to_bch2_time(c, inode->v.i_atime);
-	bi->bi_mtime	= timespec_to_bch2_time(c, inode->v.i_mtime);
+	bi->bi_atime	= timespec_to_bch2_time(c, inode_get_atime(&inode->v));
+	bi->bi_mtime	= timespec_to_bch2_time(c, inode_get_mtime(&inode->v));
 	bi->bi_ctime	= timespec_to_bch2_time(c, inode_get_ctime(&inode->v));
 
 	return 0;