]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage_util: Prefer generic FICLONE over btrfs/xfs defines
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 9 Jul 2018 10:59:20 +0000 (12:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 24 Jul 2018 13:15:34 +0000 (15:15 +0200)
After my change to the original patch that resulted in commit
8ed874b39b3 it was brought to my attention that all three defines
are the same: FICLONE = BTRFS_IOC_CLONE = XFS_IOC_CLONE (as
documented in ioctl_ficlone(2)). Therefore we should prefer
generic FICLONE over 'specific' defines for btrfs/xfs.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/storage/storage_util.c

index da99043e0a5bbb508801521a23a6fa4f86adcc32..715d5c2f88bc1cf75bc404e065fc300feaea5f82 100644 (file)
 # include <selinux/selinux.h>
 #endif
 
-#if HAVE_LINUX_BTRFS_H
+#ifdef FICLONE
+# define REFLINK_IOC_CLONE FICLONE
+#elif HAVE_LINUX_BTRFS_H
 # include <linux/btrfs.h>
 # define REFLINK_IOC_CLONE BTRFS_IOC_CLONE
 #elif HAVE_XFS_XFS_H
 # include <xfs/xfs.h>
 # define REFLINK_IOC_CLONE XFS_IOC_CLONE
-#elif defined(FICLONE)
-# define REFLINK_IOC_CLONE FICLONE
 #endif
 
 #include "datatypes.h"