FYI, I once implemented a similar patch to teach du(1) to show the disk footprint with reflinked stuff for OCFS2 only.
It is make use of rb-tree to figure out the shared extents and calculate the exactly used space eventually. http://oss.oracle.com/pipermail/ocfs2-devel/2010-September/007293.html http://oss.oracle.com/pipermail/ocfs2-devel/2010-September/007288.html http://oss.oracle.com/pipermail/ocfs2-devel/2010-September/007287.html I have not submit the patch set to Coreutils since I guess it is hard to accept by upstream as reflink and FIEMAP_EXTENT_SHARED flag are not spread over the general filesystems. Thanks, -Jeff > * Pádraig Brady ([email protected]) [20110414 17:30]: > >> I don't think there is anything else you could do, >> like minimizing reads from a set of files with >> shared extents, as there is no way to ID the extent. >> Oh I suppose you could by using device_id, physical_offset. >> You could extend the di_set stuff we have for matching >> hardlinks to do that I suppose. But then one can currently >> only clone a file, not an extent (on BTRFS at least). >> What is your use case exactly? > > As far as I understood the request, it's for reflink support in du so that > it's possible to see the space savings reflinks give you. Given your hint > I'll have a look at the di_set stuff to see how this can possibly be > extended to use the FIEMAP info. > >> Also it would be better to send details to [email protected] >> as others might have suggestions. > > Which I'm doing hereby. BTW, could somebody point me to the documents for > copyright assignment? I have one on file for GCC but now I'd need one for > coreutils. > > Philpp >
