Expand description
§Quota group (qgroup) management: hierarchical accounting of disk usage
Qgroups track how much disk space a subvolume (or a group of subvolumes) uses. Every subvolume automatically gets a level-0 qgroup whose ID matches the subvolume ID. Higher-level qgroups can be created and linked into a parent–child hierarchy so that space usage rolls up through the tree.
Quota must be enabled on the filesystem (see crate::quota) before any
qgroup operations will succeed. Most operations require CAP_SYS_ADMIN.
Structs§
- Qgroup
Info - Usage and limit information for a single qgroup.
- Qgroup
Limit Flags - Which limit fields are actively enforced on a qgroup.
- Qgroup
List - Result of
qgroup_list: overall quota status and per-qgroup details. - Qgroup
Status Flags - Status flags for the quota tree as a whole (
BTRFS_QGROUP_STATUS_KEY).
Functions§
- qgroup_
assign - Assign qgroup
srcas a member of qgroupdst(i.e.srcbecomes a child ofdst). - qgroup_
clear_ stale - Destroy all “stale” level-0 qgroups — those whose corresponding subvolume no longer exists.
- qgroup_
create - Create a new qgroup with the given
qgroupidon the filesystem referred to byfd. - qgroup_
destroy - Destroy the qgroup with the given
qgroupidon the filesystem referred to byfd. - qgroup_
limit - Set usage limits on a qgroup.
- qgroup_
list - List all qgroups and overall quota status for the filesystem referred to
by
fd. - qgroup_
remove - Remove the child–parent relationship between qgroups
srcanddst. - qgroupid_
level - Extract the hierarchy level from a packed qgroup ID.
- qgroupid_
subvolid - Extract the subvolume ID component from a packed qgroup ID.