Re: [PATCH 1/2] Introduce btrfsCloneFile for btrfs COW copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/13/2015 09:18 AM, Chen Hanxiao wrote:
> Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
> ---
>  src/storage/storage_backend.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index b990a82..5ce3566 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -156,6 +156,32 @@ enum {
>  #define READ_BLOCK_SIZE_DEFAULT  (1024 * 1024)
>  #define WRITE_BLOCK_SIZE_DEFAULT (4 * 1024)
>  
> +/*
> + * Perform the O(1) btrfs clone operation, if possible.
> + * Upon success, return 0.  Otherwise, return -1 and set errno.
> + */
> +#if !defined(BTRFS_IOCTL_MAGIC)
> +# define BTRFS_IOCTL_MAGIC 0x94
> +#endif
> +
> +#define BTRFS_IOC_CLONE _IOW (BTRFS_IOCTL_MAGIC, 9, int)
> +

Instead of redefining the constants, can we check for btrfs.h at configure
time and wrap the function in #ifdef BTRFS_IOC_CLONE ?

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]