btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME
* btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case if this constant is not defined. * tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined.
This commit is contained in:
parent
3f36611e98
commit
ea516df85e
2
btrfs.c
2
btrfs.c
@ -1333,7 +1333,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
|
|||||||
|
|
||||||
case BTRFS_IOC_CLONE: /* FICLONE */
|
case BTRFS_IOC_CLONE: /* FICLONE */
|
||||||
case BTRFS_IOC_CLONE_RANGE: /* FICLONERANGE */
|
case BTRFS_IOC_CLONE_RANGE: /* FICLONERANGE */
|
||||||
|
#ifdef BTRFS_IOC_FILE_EXTENT_SAME
|
||||||
case BTRFS_IOC_FILE_EXTENT_SAME: /* FIDEDUPERANGE */
|
case BTRFS_IOC_FILE_EXTENT_SAME: /* FIDEDUPERANGE */
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* FICLONE, FICLONERANGE, and FIDEDUPERANGE started out as
|
* FICLONE, FICLONERANGE, and FIDEDUPERANGE started out as
|
||||||
* btrfs ioctls and the code was kept for the generic
|
* btrfs ioctls and the code was kept for the generic
|
||||||
|
@ -1574,6 +1574,7 @@ btrfs_test_dev_replace_ioctl(void)
|
|||||||
static void
|
static void
|
||||||
btrfs_test_extent_same_ioctl(void)
|
btrfs_test_extent_same_ioctl(void)
|
||||||
{
|
{
|
||||||
|
#ifdef BTRFS_IOC_FILE_EXTENT_SAME
|
||||||
struct file_dedupe_range args = {
|
struct file_dedupe_range args = {
|
||||||
.src_offset = 1024,
|
.src_offset = 1024,
|
||||||
.src_length = 10240,
|
.src_length = 10240,
|
||||||
@ -1689,6 +1690,7 @@ btrfs_test_extent_same_ioctl(void)
|
|||||||
close(fd2);
|
close(fd2);
|
||||||
}
|
}
|
||||||
free(argsp);
|
free(argsp);
|
||||||
|
#endif /* BTRFS_IOC_FILE_EXTENT_SAME */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user