23 #ifndef STORAGE_BTRFS_QGROUP_H 24 #define STORAGE_BTRFS_QGROUP_H 27 #include "storage/Devicegraph.h" 28 #include "storage/Devices/Device.h" 54 using id_t = std::pair<unsigned int, unsigned long long>;
166 const Impl& get_impl()
const;
void set_exclusive_limit(unsigned long long exclusive_limit)
Set the limit for the exclusive size of the qgroup.
Class to represent a btrfs filesystem https://en.wikipedia.org/wiki/Btrfs in the devicegraph.
Definition: Btrfs.h:79
std::pair< unsigned int, unsigned long long > id_t
Type for a btrfs qgroup id.
Definition: BtrfsQgroup.h:54
bool is_assigned(const BtrfsQgroup *btrfs_qgroup) const
Return whether the btrfs_qgroup is assigned to the qgroup.
static BtrfsQgroup * create(Devicegraph *devicegraph, const id_t &id)
id_t get_id() const
Get the id of the qgroup.
void unassign(BtrfsQgroup *btrfs_qgroup)
Unassign btrfs_qgroup from the qgroup.
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
bool has_exclusive_limit() const
Return whether the qgroup has a limit for the exclusive size.
bool has_referenced_limit() const
Return whether the qgroup has a limit for the referenced size.
void set_referenced_limit(unsigned long long referenced_limit)
Set the limit for the referenced size of the qgroup.
unsigned long long get_referenced() const
Get the referenced size of the qgroup.
An abstract base class for storage devices.
Definition: Device.h:81
unsigned long long get_referenced_limit() const
Return the limit for the referenced size of the qgroup.
Btrfs * get_btrfs()
Get the btrfs filesystem this qgroup belongs to.
void clear_exclusive_limit()
Clear the limit for the exclusive size of the qgroup.
Class to represent a qgroup of a btrfs filesystem.
Definition: BtrfsQgroup.h:44
unsigned long long get_exclusive() const
Get the exclusive size of the qgroup.
bool is_btrfs_qgroup(const Device *device)
Checks whether device points to a Btrfs.
void clear_referenced_limit()
Clear the limit for the referenced size of the qgroup.
void assign(BtrfsQgroup *btrfs_qgroup)
Assign btrfs_qgroup to the qgroup.
The storage namespace.
Definition: Actiongraph.h:39
BtrfsQgroup * to_btrfs_qgroup(Device *device)
Converts pointer to Device to pointer to Btrfs.
unsigned long long get_exclusive_limit() const
Return the limit for the exclusive size of the qgroup.
std::vector< BtrfsQgroup * > get_assigned_btrfs_qgroups()
Get all qgroups assigned to the qgroup.