[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Btrfs clone support in copy operations
From: |
sbaugh |
Subject: |
Re: Btrfs clone support in copy operations |
Date: |
Tue, 05 Jul 2016 19:39:08 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Kieran Colford <address@hidden> writes:
> + /* Perform the O(1) btrfs clone operation, if possible. */
> +#ifdef __linux__
> +# undef BTRFS_IOCTL_MAGIC
> +# define BTRFS_IOCTL_MAGIC 0x94
> +# undef BTRFS_IOC_CLONE
> +# define BTRFS_IOC_CLONE _IOW (BTRFS_IOCTL_MAGIC, 9, int)
> + if (ioctl (ofd, BTRFS_IOC_CLONE, ifd) == 0)
> + goto done_copy;
> +#endif
Perhaps you should use the FICLONE flag, which doesn't mention
BTRFS. (and is conceivably filesystem independent - I think XFS supports
it?)