[cmake-developers] Using reflinks during install phase

Alessandro Di Federico ale at clearmind.me
Fri May 30 18:27:17 EDT 2014


On Fri, 30 May 2014 13:13:07 -0400
Matthew Woehlke <mw_triad at users.sourceforge.net> wrote:

> That was my assumption also. I would've thought that would be better,
> as coreutils basically exists only on Linux. (And even then, someone
> could in theory have a different 'cp', though that is unlikely.)
> 
> @Alessandro, would you expect this to ever be used on e.g. a BSD or
> OS/X system?

Well, in theory it's technically possible, in the sense that e.g. ZFS
should allow something like reflinks [1], however I'm not sure if
and when this will happen.
Moreover, currently there's no FS-independent syscall, there was a
proposal [2] but I can't see it implemented in the current Linux
kernel. This means that we have to deal directly with ioctl (see
actual `cp` implementation [3]), which is something specific per-FS (and
per-OS). Moreover we also have to detect the FS. It looks to me a lot
work to reinvent what `cp` is already doing, and will be doing in a
future-proof way.

I'd go for detecting if `cp` is from GNU coreutils and if it's recent
enough. If in future some other `cp` implements this we can detect it
as well, or if we get an easily usable syscall we can go for it.

What do you think?

--
Ale

[1] https://github.com/zfsonlinux/zfs/issues/405
[2] http://thread.gmane.org/gmane.linux.file-systems/31535
[3] http://bit.ly/1k9rWOd



More information about the cmake-developers mailing list