[Gluster-devel] [RFC] Accounting directory blocks in marker

Raghavendra Gowdappa rgowdapp at redhat.com
Tue Oct 15 02:18:56 UTC 2013

> This sounds Ok to me, but is there any reason we couldn't use the
> existing marker xattr naming scheme instead of creating a new key? E.g.,
> a directory gets the same contribution xattr that a file gets, only it
> happens to contribute to itself? Alternatively, maybe there's room for
> an optimization here where the directory stat data can simply be folded
> into the directory size. Thoughts?

Yes, I think we can do away with an extra xattr indicating contribution of directory file size if we change the semantics of contribution variable to "size contributed from this directory towards its parent, where size is sum of directory file size and size of directory subtree". This way we can always calculate delta as:

delta = (disk usage of directory subtree stored in size xattrs) + (disk usage of directory file as indicated by st_blocks) - (value stored in contribution xattrs).

If delta is non-zero, it needs to be updated till root.


More information about the Gluster-devel mailing list