diff mbox series

[v2] btrfs-progs: sync ioctl from kernel

Message ID 4fbc61d726ee1830d3e24313b7bf6f8a763951a1.1679098064.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series [v2] btrfs-progs: sync ioctl from kernel | expand

Commit Message

Qu Wenruo March 18, 2023, 12:07 a.m. UTC
This sync is mostly for the new member, btrfs_ioctl_dev_info_args::fsid.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
Changelog:
v2:
- Separate from the btrfs/249 fix
  The btrfs/249 fallback fix is a little too niche, and the proper fix is
  already merged

- Only sync to "include/ioctl.h" and "libbtrfsutil/btrfs.h"
---
 include/ioctl.h      | 13 ++++++++++++-
 libbtrfsutil/btrfs.h | 13 ++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)

Comments

Anand Jain March 18, 2023, 12:11 p.m. UTC | #1
On 3/18/23 08:07, Qu Wenruo wrote:
> This sync is mostly for the new member, btrfs_ioctl_dev_info_args::fsid.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>
David Sterba March 21, 2023, 1:58 a.m. UTC | #2
On Sat, Mar 18, 2023 at 08:07:50AM +0800, Qu Wenruo wrote:
> This sync is mostly for the new member, btrfs_ioctl_dev_info_args::fsid.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Added to devel, thanks.
diff mbox series

Patch

diff --git a/include/ioctl.h b/include/ioctl.h
index 1af16db13241..d8a8bb9cad3d 100644
--- a/include/ioctl.h
+++ b/include/ioctl.h
@@ -214,7 +214,18 @@  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);
diff --git a/libbtrfsutil/btrfs.h b/libbtrfsutil/btrfs.h
index 0d863d58ec23..d9415ea2faed 100644
--- a/libbtrfsutil/btrfs.h
+++ b/libbtrfsutil/btrfs.h
@@ -224,7 +224,18 @@  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 */
 };