aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorKent Overstreet <[email protected]>2024-03-08 02:29:12 +0000
committerChristian Brauner <[email protected]>2024-03-26 08:01:18 +0000
commit2a82bb02941fb53d1f8df2a360e7798ae3d9d962 (patch)
treebbc159905c9a051e549d225ecfff31c9b7fe6ec7 /fs/btrfs/inode.c
parentLinux 6.9-rc1 (diff)
downloadkernel-2a82bb02941fb53d1f8df2a360e7798ae3d9d962.tar.gz
kernel-2a82bb02941fb53d1f8df2a360e7798ae3d9d962.zip
statx: stx_subvol
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. Link: https://lore.kernel.org/linux-fsdevel/2uvhm6gweyl7iyyp2xpfryvcu2g3padagaeqcbiavjyiis6prl@yjm725bizncq/ Signed-off-by: Kent Overstreet <[email protected]> Cc: Josef Bacik <[email protected]> Cc: Miklos Szeredi <[email protected]> Cc: Christian Brauner <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: Kent Overstreet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c3
1 files changed, 3 insertions, 0 deletions
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);