Skip to main content

Module qgroup

Module qgroup 

Source
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§

QgroupInfo
Usage and limit information for a single qgroup.
QgroupLimitFlags
Which limit fields are actively enforced on a qgroup.
QgroupList
Result of qgroup_list: overall quota status and per-qgroup details.
QgroupStatusFlags
Status flags for the quota tree as a whole (BTRFS_QGROUP_STATUS_KEY).

Functions§

qgroup_assign
Assign qgroup src as a member of qgroup dst (i.e. src becomes a child of dst).
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 qgroupid on the filesystem referred to by fd.
qgroup_destroy
Destroy the qgroup with the given qgroupid on the filesystem referred to by fd.
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 src and dst.
qgroupid_level
Extract the hierarchy level from a packed qgroup ID.
qgroupid_subvolid
Extract the subvolume ID component from a packed qgroup ID.