Jeremy Teo wrote:
Hello,
this is with reference to bug #6343653, "want to quickly "copy" a file
from a snapshot".
After a short dig through source code, the issue is that 'mv' will do
a copy because the rename syscall fails for files on different
filesystems (snapshots are mounted as separate filesystems from the
host filesystem).
There are 2 ways around this:
1) Hack/Modify the rename syscall to special case the ZFS snapshot
situation
2) Implement a special internal ZFS call, which is only used by
something like "zfs mv <source> <destination>"
Implementation wise, I prefer 2. Thoughts anyone? :)
Hi Jeremy,
While I agree that option 2 has certain merits, I think you would
be better off with special-casing the syscall. It should not be all
that difficult (famous las words) to handle the special case, and
for anybody working on that part of the code after you, it should
be simple to keep track of what's going on. That's the essential
difference to option (2) - if you change the zfs code to special-case
handle this system call, then whoever updates the system call has
to know that you've done this and keep track of the zfs part as well
as all the other bits.
I'm sure you can special-case handle the syscall in an elegant
manner, too :)
best regards,
James C. McPherson
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss