linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-bcachefs@vger.kernel.org" <linux-bcachefs@vger.kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Josef Bacik <josef@toxicpanda.com>,
	Miklos Szeredi <mszeredi@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	David Howells <dhowells@redhat.com>
Subject: Re: [PATCH v2] statx: stx_subvol
Date: Mon, 11 Mar 2024 08:12:33 +0000	[thread overview]
Message-ID: <2f598709-fccb-4364-bf15-f9c171b440aa@wdc.com> (raw)
In-Reply-To: <20240308022914.196982-1-kent.overstreet@linux.dev>

On 08.03.24 03:29, Kent Overstreet wrote:
> Add a new statx field for (sub)volume identifiers, as implemented by
> btrfs and bcachefs.
> 
> This includes bcachefs support; we'll definitely want btrfs support as
> well.

For btrfs you can add the following:


 From 82343b7cb2a947bca43234c443b9c22339367f68 Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Date: Mon, 11 Mar 2024 09:09:36 +0100
Subject: [PATCH] btrfs: provide subvolume id for statx

Add the inode's subvolume id to the newly proposed statx subvol field.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
  fs/btrfs/inode.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 37701531eeb1..8cf692c708d7 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8779,6 +8779,9 @@ static int btrfs_getattr(struct mnt_idmap *idmap,
  	generic_fillattr(idmap, request_mask, inode, stat);
  	stat->dev = BTRFS_I(inode)->root->anon_dev;

+	stat->subvol = BTRFS_I(inode)->root->root_key.objectid;
+	stat->result_mask |= STATX_SUBVOL;
+
  	spin_lock(&BTRFS_I(inode)->lock);
  	delalloc_bytes = BTRFS_I(inode)->new_delalloc_bytes;
  	inode_bytes = inode_get_bytes(inode);
-- 
2.35.3



  parent reply	other threads:[~2024-03-11  8:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08  2:29 [PATCH v2] statx: stx_subvol Kent Overstreet
2024-03-08 11:42 ` Neal Gompa
2024-03-08 16:34   ` Kent Overstreet
2024-03-08 16:44     ` Neal Gompa
2024-03-08 16:48       ` Kent Overstreet
2024-03-08 16:56         ` Darrick J. Wong
2024-03-08 17:13           ` Kent Overstreet
2024-03-09 11:46             ` Jeff Layton
2024-03-09 12:15               ` Kent Overstreet
2024-03-11  2:17           ` Dave Chinner
2024-03-11  5:30             ` Miklos Szeredi
2024-03-11  5:49               ` Kent Overstreet
2024-03-11 13:42           ` Christian Brauner
2024-03-11  8:12 ` Johannes Thumshirn [this message]
2024-03-11 13:43   ` Christian Brauner
2024-03-11 20:15     ` Kent Overstreet
2024-03-12 14:27       ` Christian Brauner
2024-03-11 22:43     ` David Sterba
2024-03-12 14:27       ` Christian Brauner
2024-03-12 17:17         ` Neal Gompa
2024-03-12  2:13 ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f598709-fccb-4364-bf15-f9c171b440aa@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=josef@toxicpanda.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).