diff options
author | Johannes Thumshirn <johannes.thumshirn@wdc.com> | 2020-07-13 21:29:00 +0900 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-07-27 12:55:43 +0200 |
commit | 49bac897683340457a0ab1f76b924a1220bdb604 (patch) | |
tree | 4a50383d6c465d8e11d4838153c28382f35f1ddd /fs/btrfs | |
parent | 0fb408a558aadbaa58beb75b02c95741e1fbb514 (diff) | |
download | linux-49bac897683340457a0ab1f76b924a1220bdb604.tar.gz linux-49bac897683340457a0ab1f76b924a1220bdb604.tar.bz2 linux-49bac897683340457a0ab1f76b924a1220bdb604.zip |
btrfs: add metadata_uuid to FS_INFO ioctl
Add retrieval of the filesystem's metadata UUID to the fsinfo ioctl.
This is driven by setting the BTRFS_FS_INFO_FLAG_METADATA_UUID flag in
btrfs_ioctl_fs_info_args::flags.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 55dd20d0f9cb..b4ddf51ae377 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3252,6 +3252,12 @@ static long btrfs_ioctl_fs_info(struct btrfs_fs_info *fs_info, fi_args->flags |= BTRFS_FS_INFO_FLAG_GENERATION; } + if (flags_in & BTRFS_FS_INFO_FLAG_METADATA_UUID) { + memcpy(&fi_args->metadata_uuid, fs_devices->metadata_uuid, + sizeof(fi_args->metadata_uuid)); + fi_args->flags |= BTRFS_FS_INFO_FLAG_METADATA_UUID; + } + if (copy_to_user(arg, fi_args, sizeof(*fi_args))) ret = -EFAULT; |