btrfs-progs: sync DEV_INFO ioctl from kernel

Add fsid to DEV_INFO structure introduced in kernel 6.3 by 2943868a909f
("btrfs: ioctl: return device fsid from DEV_INFO ioctl").

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2023-03-18 08:07:50 +08:00 committed by David Sterba
parent 8e11c07269
commit dad89b7aca
2 changed files with 22 additions and 2 deletions

View file

@ -214,7 +214,17 @@ struct btrfs_ioctl_dev_info_args {
__u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
__u64 bytes_used; /* out */
__u64 total_bytes; /* out */
__u64 unused[379]; /* pad to 4k */
/*
* Optional, out.
*
* Showing the fsid of the device, allowing user space to check if this
* device is a seed one.
*
* Introduced in v6.3, thus user space still needs to check if kernel
* changed this value. Older kernel will not touch the values here.
*/
__u8 fsid[BTRFS_UUID_SIZE];
__u64 unused[377]; /* pad to 4k */
__u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
};
BUILD_ASSERT(sizeof(struct btrfs_ioctl_dev_info_args) == 4096);

View file

@ -224,7 +224,17 @@ struct btrfs_ioctl_dev_info_args {
__u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
__u64 bytes_used; /* out */
__u64 total_bytes; /* out */
__u64 unused[379]; /* pad to 4k */
/*
* Optional, out.
*
* Showing the fsid of the device, allowing user space to check if this
* device is a seed one.
*
* Introduced in v6.3, thus user space still needs to check if kernel
* changed this value. Older kernel will not touch the values here.
*/
__u8 fsid[BTRFS_UUID_SIZE];
__u64 unused[377]; /* pad to 4k */
__u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
};