libstorage-ng
Loading...
Searching...
No Matches
storage::BtrfsQgroup Class Reference

Class to represent a qgroup of a btrfs filesystem. More...

#include <BtrfsQgroup.h>

Inheritance diagram for storage::BtrfsQgroup:
[legend]
Collaboration diagram for storage::BtrfsQgroup:
[legend]

Public Types

using id_t = std::pair<unsigned int, unsigned long long>
 Type for a btrfs qgroup id.
 

Public Member Functions

Btrfsget_btrfs ()
 Get the btrfs filesystem this qgroup belongs to.
 
const Btrfsget_btrfs () const
 Get the btrfs filesystem this qgroup belongs to.
 
id_t get_id () const
 Get the id of the qgroup.
 
unsigned long long get_referenced () const
 Get the referenced size of the qgroup.
 
unsigned long long get_exclusive () const
 Get the exclusive size of the qgroup.
 
bool has_referenced_limit () const
 Return whether the qgroup has a limit for the referenced size.
 
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.
 
void clear_referenced_limit ()
 Clear the limit for the referenced size of the qgroup.
 
bool has_exclusive_limit () const
 Return whether the qgroup has a limit for the exclusive size.
 
unsigned long long get_exclusive_limit () const
 Return the limit for the exclusive size of the qgroup.
 
void set_exclusive_limit (unsigned long long exclusive_limit)
 Set the limit for the exclusive size of the qgroup.
 
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.
 
void assign (BtrfsQgroup *btrfs_qgroup)
 Assign btrfs_qgroup to the qgroup.
 
void unassign (BtrfsQgroup *btrfs_qgroup)
 Unassign btrfs_qgroup from the qgroup.
 
std::vector< BtrfsQgroup * > get_assigned_btrfs_qgroups ()
 Get all qgroups assigned to the qgroup.
 
std::vector< const BtrfsQgroup * > get_assigned_btrfs_qgroups () const
 Get all qgroups assigned to the qgroup.
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
virtual BtrfsQgroupclone () const override
 
 BtrfsQgroup (Impl *impl)
 
- Public Member Functions inherited from storage::Device
sid_t get_sid () const
 Return the storage id (sid) of the device.
 
bool operator== (const Device &rhs) const
 
bool operator!= (const Device &rhs) const
 
Devicecopy_to_devicegraph (Devicegraph *devicegraph) const
 Copies the device to the devicegraph.
 
bool exists_in_devicegraph (const Devicegraph *devicegraph) const
 Checks if the device exists in the devicegraph.
 
bool exists_in_probed () const
 Checks if the device exists in the probed devicegraph.
 
bool exists_in_staging () const
 Checks if the device exists in the staging devicegraph.
 
bool exists_in_system () const
 Checks if the device exists in the system devicegraph.
 
std::string get_displayname () const
 
ResizeInfo detect_resize_info () const
 Detect the resize info of the device.
 
bool has_children () const
 
size_t num_children () const
 
bool has_parents () const
 
size_t num_parents () const
 
std::vector< Device * > get_children ()
 
std::vector< const Device * > get_children () const
 
std::vector< Device * > get_children (View view)
 Get all children of the device.
 
std::vector< const Device * > get_children (View view) const
 Get all children of the device.
 
std::vector< Device * > get_parents ()
 
std::vector< const Device * > get_parents () const
 
std::vector< Device * > get_parents (View view)
 Get all parents of the device.
 
std::vector< const Device * > get_parents (View view) const
 Get all parents of the device.
 
std::vector< Device * > get_siblings (bool itself)
 
std::vector< const Device * > get_siblings (bool itself) const
 
std::vector< Device * > get_descendants (bool itself)
 
std::vector< const Device * > get_descendants (bool itself) const
 
std::vector< Device * > get_descendants (bool itself, View view)
 
std::vector< const Device * > get_descendants (bool itself, View view) const
 
std::vector< Device * > get_ancestors (bool itself)
 
std::vector< const Device * > get_ancestors (bool itself) const
 
std::vector< Device * > get_leaves (bool itself)
 
std::vector< const Device * > get_leaves (bool itself) const
 
std::vector< Device * > get_roots (bool itself)
 
std::vector< const Device * > get_roots (bool itself) const
 
std::vector< Holder * > get_in_holders ()
 
std::vector< const Holder * > get_in_holders () const
 
std::vector< Holder * > get_out_holders ()
 
std::vector< const Holder * > get_out_holders () const
 
void remove_descendants () ST_DEPRECATED
 
void remove_descendants (View view)
 Remove all descendants of the device.
 
const std::map< std::string, std::string > & get_userdata () const
 Return the userdata of the device.
 
void set_userdata (const std::map< std::string, std::string > &userdata)
 Set the userdata of the device.
 
std::string get_name_sort_key () const
 Get a sort-key based on the device name.
 
Devicegraphget_devicegraph ()
 Return the devicegraph the device belongs to.
 
const Devicegraphget_devicegraph () const
 Return the devicegraph the device belongs to.
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
void save (xmlNode *node) const ST_DEPRECATED
 

Static Public Member Functions

static BtrfsQgroupcreate (Devicegraph *devicegraph, const id_t &id)
 
static BtrfsQgroupload (Devicegraph *devicegraph, const xmlNode *node)
 
- Static Public Member Functions inherited from storage::Device
static std::vector< Device * > get_all (Devicegraph *devicegraph)
 Get all Devices.
 
static std::vector< const Device * > get_all (const Devicegraph *devicegraph)
 Get all Devices.
 
static bool compare_by_sid (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by sid.
 
static bool compare_by_name (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by name.
 

Additional Inherited Members

- Protected Member Functions inherited from storage::Device
 Device (Impl *impl)
 
void create (Devicegraph *devicegraph) ST_DEPRECATED
 Create a device in the devicegraph.
 
void load (Devicegraph *devicegraph) ST_DEPRECATED
 

Detailed Description

Class to represent a qgroup of a btrfs filesystem.

Not included in the classic view.

See also
Btrfs

Member Typedef Documentation

◆ id_t

using storage::BtrfsQgroup::id_t = std::pair<unsigned int, unsigned long long>

Type for a btrfs qgroup id.

The first value is the level, the second one the id.

btrfs will only use 16 bits of the level and 48 bits of the id.

Member Function Documentation

◆ assign()

void storage::BtrfsQgroup::assign ( BtrfsQgroup * btrfs_qgroup)

Assign btrfs_qgroup to the qgroup.

Exceptions
Exception

◆ clone()

virtual BtrfsQgroup * storage::BtrfsQgroup::clone ( ) const
overridevirtual

Implements storage::Device.

◆ create()

static BtrfsQgroup * storage::BtrfsQgroup::create ( Devicegraph * devicegraph,
const id_t & id )
static

◆ get_assigned_btrfs_qgroups()

std::vector< const BtrfsQgroup * > storage::BtrfsQgroup::get_assigned_btrfs_qgroups ( ) const

Get all qgroups assigned to the qgroup.

◆ get_btrfs()

const Btrfs * storage::BtrfsQgroup::get_btrfs ( ) const

Get the btrfs filesystem this qgroup belongs to.

◆ get_exclusive_limit()

unsigned long long storage::BtrfsQgroup::get_exclusive_limit ( ) const

Return the limit for the exclusive size of the qgroup.

Exceptions
Exception

◆ get_referenced_limit()

unsigned long long storage::BtrfsQgroup::get_referenced_limit ( ) const

Return the limit for the referenced size of the qgroup.

Exceptions
Exception

◆ unassign()

void storage::BtrfsQgroup::unassign ( BtrfsQgroup * btrfs_qgroup)

Unassign btrfs_qgroup from the qgroup.

Exceptions
Exception

The documentation for this class was generated from the following file: