Darren J Moffat 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.
Copy-on-write isn't what helps you here it is dedup.
Well, to be precise, dedup is implemented based on the COW features in
ZFS-es block allocator :) So yes, COW helps: it is the actual
optimization feature.
However, for this use case, it is DEDUP that obviates the need to do any
'special case' handling for this specific type of job, because DEDUP
generalizes the detection of re-useable sotrage blocks.
In all accounts: yes, yes and yes inclusive :)
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss