[Ocfs2-devel] [PATCH 1/3] fs: Document the reflink(2) system call.
Jamie Lokier
jamie at shareable.org
Tue May 12 12:30:37 PDT 2009
jim owens wrote:
> du rules
In general, hard :-)
See the difficulties reporting process memory usage given shared
libraries for how tricky it gets.
Imho, the simplest is for du to report how much space it would take if
all the files were fully unCOWed, either by being modified or copied
to another filesystem. In other words, just return the data blocks
assigned to a file as usual; the COW difference is the same block can
be assigned to more than one file. Sometimes knowing the unCOWed
space would even be useful.
Of course knowing the COWed space is also useful. (Both together
would give you a nice feel for how much space COW is saving.) I
suspect that would need changes to du to give useful answers (and
similar changes to "Disk Usage Analyzer" if you like that tool).
du detects hard links by i_nlink!=1 and inode number, and merges the
accounting. For partially shared files, I'm not sure how best to get
the right information out. FIEMAP is inherently a lot slower than
stat() because it can do much more disk access, and it might not
always work (depending on how data is represented on disk), and it
might not always be permitted. Worse, there's no i_nlink!=1
equivalent to decide when FIEMAP does not need to be called.
-- Jamie
More information about the Ocfs2-devel
mailing list