diff mbox series

[v4,9/9] btrfs: convert to multigrain timestamps

Message ID 20230518114742.128950-10-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series fs: implement multigrain timestamps | expand

Commit Message

Jeff Layton May 18, 2023, 11:47 a.m. UTC
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/btrfs/delayed-inode.c | 2 +-
 fs/btrfs/inode.c         | 2 +-
 fs/btrfs/super.c         | 5 +++--
 fs/btrfs/tree-log.c      | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

Comments

David Sterba May 22, 2023, 9:56 a.m. UTC | #1
On Thu, May 18, 2023 at 07:47:42AM -0400, Jeff Layton wrote:
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Acked-by: David Sterba <dsterba@suse.com>

Please add a brief description to the changelog too, there's a similar
text in the patches adding the infrastructure. Something like "Allow to
optimize lot of metadata updates by encoding the status in the cmtime.
The fine grained time is needed for NFS."
Jeff Layton May 22, 2023, 10:08 a.m. UTC | #2
On Mon, 2023-05-22 at 11:56 +0200, David Sterba wrote:
> On Thu, May 18, 2023 at 07:47:42AM -0400, Jeff Layton wrote:
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> 
> Acked-by: David Sterba <dsterba@suse.com>
> 
> Please add a brief description to the changelog too, there's a similar
> text in the patches adding the infrastructure. Something like "Allow to
> optimize lot of metadata updates by encoding the status in the cmtime.
> The fine grained time is needed for NFS."

Sure thing.

Christian, do you want to just alter the changelog with David's
suggestion, or would you rather I resend the series?

Thanks,
Christian Brauner May 22, 2023, 10:53 a.m. UTC | #3
On Mon, May 22, 2023 at 06:08:56AM -0400, Jeff Layton wrote:
> On Mon, 2023-05-22 at 11:56 +0200, David Sterba wrote:
> > On Thu, May 18, 2023 at 07:47:42AM -0400, Jeff Layton wrote:
> > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > 
> > Acked-by: David Sterba <dsterba@suse.com>
> > 
> > Please add a brief description to the changelog too, there's a similar
> > text in the patches adding the infrastructure. Something like "Allow to
> > optimize lot of metadata updates by encoding the status in the cmtime.
> > The fine grained time is needed for NFS."
> 
> Sure thing.
> 
> Christian, do you want to just alter the changelog with David's
> suggestion, or would you rather I resend the series?

Nah, don't bother resending I'll just add it to the fs specific patches.
I'll end up updating the patch trailers anyway when individual
maintainers add new Acks.
diff mbox series

Patch

diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 6b457b010cbc..8307fd69da43 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1810,7 +1810,7 @@  static void fill_stack_inode_item(struct btrfs_trans_handle *trans,
 	btrfs_set_stack_timespec_sec(&inode_item->ctime,
 				     inode->i_ctime.tv_sec);
 	btrfs_set_stack_timespec_nsec(&inode_item->ctime,
-				      inode->i_ctime.tv_nsec);
+				      ctime_nsec_peek(inode));
 
 	btrfs_set_stack_timespec_sec(&inode_item->otime,
 				     BTRFS_I(inode)->i_otime.tv_sec);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2335b5e1cecc..b27d4dda6024 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3970,7 +3970,7 @@  static void fill_inode_item(struct btrfs_trans_handle *trans,
 	btrfs_set_token_timespec_sec(&token, &item->ctime,
 				     inode->i_ctime.tv_sec);
 	btrfs_set_token_timespec_nsec(&token, &item->ctime,
-				      inode->i_ctime.tv_nsec);
+				      ctime_nsec_peek(inode));
 
 	btrfs_set_token_timespec_sec(&token, &item->otime,
 				     BTRFS_I(inode)->i_otime.tv_sec);
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index ec18e2210602..fc6abf8b1f42 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2144,7 +2144,7 @@  static struct file_system_type btrfs_fs_type = {
 	.name		= "btrfs",
 	.mount		= btrfs_mount,
 	.kill_sb	= btrfs_kill_super,
-	.fs_flags	= FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA,
+	.fs_flags	= FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_MULTIGRAIN_TS,
 };
 
 static struct file_system_type btrfs_root_fs_type = {
@@ -2152,7 +2152,8 @@  static struct file_system_type btrfs_root_fs_type = {
 	.name		= "btrfs",
 	.mount		= btrfs_mount_root,
 	.kill_sb	= btrfs_kill_super,
-	.fs_flags	= FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_ALLOW_IDMAP,
+	.fs_flags	= FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
+			  FS_ALLOW_IDMAP | FS_MULTIGRAIN_TS,
 };
 
 MODULE_ALIAS_FS("btrfs");
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 9b212e8c70cc..9a4d1b2ab204 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -4150,7 +4150,7 @@  static void fill_inode_item(struct btrfs_trans_handle *trans,
 	btrfs_set_token_timespec_sec(&token, &item->ctime,
 				     inode->i_ctime.tv_sec);
 	btrfs_set_token_timespec_nsec(&token, &item->ctime,
-				      inode->i_ctime.tv_nsec);
+				      ctime_nsec_peek(inode));
 
 	/*
 	 * We do not need to set the nbytes field, in fact during a fast fsync