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;
Class to represent a qgroup of a btrfs filesystem.
Definition BtrfsQgroup.h:45
void assign(BtrfsQgroup *btrfs_qgroup)
Assign btrfs_qgroup to the qgroup.
unsigned long long get_referenced_limit() const
Return the limit for the referenced size of the qgroup.
void set_referenced_limit(unsigned long long referenced_limit)
Set the limit for the referenced size of the qgroup.
std::pair< unsigned int, unsigned long long > id_t
Type for a btrfs qgroup id.
Definition BtrfsQgroup.h:54
unsigned long long get_referenced() const
Get the referenced size of the qgroup.
void clear_referenced_limit()
Clear the limit for the referenced size of the qgroup.
void set_exclusive_limit(unsigned long long exclusive_limit)
Set the limit for the exclusive size of the qgroup.
bool has_referenced_limit() const
Return whether the qgroup has a limit for the referenced size.
std::vector< const BtrfsQgroup * > get_assigned_btrfs_qgroups() const
Get all qgroups assigned to the qgroup.
const Btrfs * get_btrfs() const
Get the btrfs filesystem this qgroup belongs to.
Btrfs * get_btrfs()
Get the btrfs filesystem this qgroup belongs to.
static BtrfsQgroup * create(Devicegraph *devicegraph, const id_t &id)
std::vector< BtrfsQgroup * > get_assigned_btrfs_qgroups()
Get all qgroups assigned to the qgroup.
unsigned long long get_exclusive_limit() const
Return the limit for the exclusive size of the qgroup.
bool has_exclusive_limit() const
Return whether the qgroup has a limit for the exclusive size.
void clear_exclusive_limit()
Clear the limit for the exclusive size of the qgroup.
bool is_assigned(const BtrfsQgroup *btrfs_qgroup) const
Return whether the btrfs_qgroup is assigned to the qgroup.
unsigned long long get_exclusive() const
Get the exclusive size of the qgroup.
id_t get_id() const
Get the id of the qgroup.
void unassign(BtrfsQgroup *btrfs_qgroup)
Unassign btrfs_qgroup from the qgroup.
Class to represent a btrfs filesystem https://en.wikipedia.org/wiki/Btrfs in the devicegraph.
Definition Btrfs.h:80
An abstract base class for storage devices.
Definition Device.h:82
The main container of the libstorage-ng.
Definition Devicegraph.h:170
The storage namespace.
Definition Actiongraph.h:40
bool is_btrfs_qgroup(const Device *device)
Checks whether device points to a Btrfs.
BtrfsQgroup * to_btrfs_qgroup(Device *device)
Converts pointer to Device to pointer to Btrfs.