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

Krishnan Parthasarathi kparthas at redhat.com
Fri Oct 11 11:18:34 UTC 2013


All,

Today, marker xlator doesn't account for the blocks consumed by directories.
This document describes the approach we plan to use to add directory size
accounting.

Extended attributes to be added:
--------------------------------

key = trusted.quota.dir-blocks-contri.
value = no. of ia_blocks consumed by this directory inode, as seen via stat(3).
This will be referred to as "directory sizes" herein.

Note: This extended attribute will be set only on directories.

This value indicates the contribution by the directory (alone) that has been
accounted so far, towards the parent's size.

With the above extended attribute we can keep track of changes in directory
sizes similar to how we handle changes to file sizes. A directory's
contribution to its parent would be as below,

Total size of a directory = Total Contribution to parent
    = ValueOfXattr(trusted.quota.dir-blocks-contri) +
      ValueOfXattr(trusted.quota.size)

This relation must be used for both reporting disk-usage in the context of
quotas and for percolating (delta) accounting updates 'upwards'.

Let us know if you see any issues with this approach, as soon as possible.

thanks,
Krish






More information about the Gluster-devel mailing list