Peter Tribble wrote:
On Thu, Dec 3, 2009 at 12:08 PM, Darren J Moffat
<darr...@opensolaris.org> wrote:
Per Baatrup wrote:
I would like to to concatenate N files into one big file taking advantage
of ZFS copy-on-write semantics so that the file concatenation is done
without actually copying any (large amount of) file content.
cat f1 f2 f3 f4 f5 > f15
Is this already possible when source and target are on the same ZFS
filesystem?
Am looking into the ZFS source code to understand if there are sufficient
(private) interfaces to make a simple "zcat -o f15 f1 f2 f3 f4 f5"
userland application in C code. Does anybody have advice on this?
The answer to this is likely deduplication which ZFS now has.
The reason dedup should help here is that after the 'cat' f15 will be made
up of blocks that match the blocks of f1 f2 f3 f4 f5.
Is that likely to happen? dedup is at the block level, so the blocks
in f2 will only
match the same data in f15 if they're aligned, which is only going to happen if
f1 ends on a block boundary.
Correct you will only get the maximum benefit if the source files are
ending on a block boundary. Which is why I said "likely deduplication".
Besides, you still have to read all the data off the disk, manipulate
it, and write it all back.
Yep.
--
Darren J Moffat
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss