Skip to content
Commit 5eba9784 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan Committed by Colin Walters
Browse files

GFile: Add Btrfs clone ioctl support

The attached patch adds support for the btrfs "clone" ioctl which
makes Copy-on-Write reflinks, resulting in cheap O(1) copies when
source/destination are on the same filesystem. The ioctl itself is
quite straightforward, and GNU coreutils has had support since 7.5
(--reflink=auto --sparse=auto).

The ioctl only operates on regular files and symlinks, and always
follows symlinks; checks have been added accordingly.

This patch would be very useful for everyone who uses btrfs
filesystems (Meego folks for instance). On systems that don't have
btrfs, or if the the source is not on a btrfs filesystem, the ioctl
returns EINVAL, and the fallback code is triggered. Hence this will
cause no problems for non-btrfs users.

https://bugzilla.gnome.org/show_bug.cgi?id=626497
parent f42347d8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment