]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
idmap: override btrfs_ioctl_vol_args_v2 if system header doesn't have subvolid
authorDarrick J. Wong <djwong@kernel.org>
Mon, 23 Aug 2021 18:21:38 +0000 (11:21 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 29 Aug 2021 13:05:45 +0000 (21:05 +0800)
commit90199d8061509a02d514dbdcc930928ce3fc8b1c
tree2a79ed3f2acc8b13c70a91bbe689439ddb3560c4
parentf4660739feddf1d4717530a83c96f44135417fe0
idmap: override btrfs_ioctl_vol_args_v2 if system header doesn't have subvolid

The struct btrfs_ioctl_vol_args_v2 in /usr/include/linux/btrfs.h on
my system predates the inclusion of the "subvolid" field.  This
causes the following build failure:

idmapped-mounts.c: In function 'btrfs_delete_subvolume_id':
idmapped-mounts.c:9730:6: error: 'struct btrfs_ioctl_vol_args_v2' has no member named 'subvolid'
 9730 |  args.subvolid = subvolid;
      |      ^

Since this source file contains its own more uptodate copy of that
structure, add some more autoconf/cpp magic so that we can override
the struct definition if the system header doesn't have the desired
field.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Anju T Sudhakar<anju@linux.vnet.ibm.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
configure.ac
src/idmapped-mounts/idmapped-mounts.c