24#ifndef STORAGE_BTRFS_H
25#define STORAGE_BTRFS_H
28#include "storage/Devicegraph.h"
29#include "storage/Filesystems/BlkFilesystem.h"
30#include "storage/Filesystems/BtrfsQgroup.h"
47 UNKNOWN, DEFAULT, SINGLE, DUP, RAID0, RAID1, RAID5, RAID6, RAID10, RAID1C3, RAID1C4
273 bool get_configure_snapper()
const;
274 void set_configure_snapper(
bool configure);
281 const Impl& get_impl()
const;
283 virtual Btrfs* clone()
const override;
An abstract Block Device.
Definition: BlkDevice.h:49
Definition: BlkFilesystem.h:43
Class to represent a qgroup of a btrfs filesystem.
Definition: BtrfsQgroup.h:45
std::pair< unsigned int, unsigned long long > id_t
Type for a btrfs qgroup id.
Definition: BtrfsQgroup.h:54
Class to represent a btrfs subvolume in the devicegraph.
Definition: BtrfsSubvolume.h:44
Class to represent a btrfs filesystem https://en.wikipedia.org/wiki/Btrfs in the devicegraph.
Definition: Btrfs.h:80
const BtrfsQgroup * find_btrfs_qgroup_by_id(const BtrfsQgroup::id_t &id) const
Find a btrfs qgroup of the btrfs by its id.
BtrfsRaidLevel get_metadata_raid_level() const
Get the metadata RAID level.
static std::vector< const Btrfs * > get_all(const Devicegraph *devicegraph)
Get all Btrfses.
const BtrfsSubvolume * get_top_level_btrfs_subvolume() const
Get the top-level subvolume.
void set_metadata_raid_level(BtrfsRaidLevel metadata_raid_level)
Set the metadata RAID level.
void remove_device(BlkDevice *blk_device)
Remove a block device from the btrfs.
void set_quota(bool quota)
Enable or disable quota for the btrfs.
const BtrfsSubvolume * find_btrfs_subvolume_by_path(const std::string &path) const
Find a btrfs subvolume of the btrfs by its path.
BtrfsQgroup * find_btrfs_qgroup_by_id(const BtrfsQgroup::id_t &id)
Find a btrfs qgroup of the btrfs by its id.
std::vector< BtrfsQgroup * > get_btrfs_qgroups()
Get all btrfs qgroups of the btrfs.
const BtrfsSubvolume * get_default_btrfs_subvolume() const
Get the default subvolume.
static Btrfs * create(Devicegraph *devicegraph)
Create a device of type Btrfs.
bool has_quota() const
Return whether quota is enabled for the btrfs.
BtrfsRaidLevel get_data_raid_level() const
Get the data RAID level.
std::vector< const BtrfsSubvolume * > get_btrfs_subvolumes() const
Get all subvolumes of the btrfs.
BtrfsQgroup * create_btrfs_qgroup(const BtrfsQgroup::id_t &id)
Create a new btrfs qgroup on the btrfs.
void set_default_btrfs_subvolume(BtrfsSubvolume *btrfs_subvolume) const
Set the default subvolume.
static std::vector< Btrfs * > get_all(Devicegraph *devicegraph)
Get all Btrfses.
FilesystemUser * add_device(BlkDevice *blk_device)
Add a block device to the btrfs.
std::vector< BtrfsRaidLevel > get_allowed_data_raid_levels() const
Get the allowed data RAID levels for the btrfs.
BtrfsSubvolume * get_default_btrfs_subvolume()
Get the default subvolume.
BtrfsSubvolume * get_top_level_btrfs_subvolume()
Get the top-level subvolume.
std::vector< BtrfsRaidLevel > get_allowed_metadata_raid_levels() const
Get the allowed metadata RAID levels for the btrfs.
void set_data_raid_level(BtrfsRaidLevel data_raid_level)
Set the data RAID level.
BtrfsSubvolume * find_btrfs_subvolume_by_path(const std::string &path)
Find a btrfs subvolume of the btrfs by its path.
std::vector< const BtrfsQgroup * > get_btrfs_qgroups() const
Get all btrfs qgroups of the btrfs.
std::vector< BtrfsSubvolume * > get_btrfs_subvolumes()
Get all subvolumes of the btrfs.
Definition: Devicegraph.h:50
An abstract base class for storage devices.
Definition: Device.h:82
The main container of the libstorage-ng.
Definition: Devicegraph.h:170
Holder from BlkDevice to a BlkFilesystem.
Definition: FilesystemUser.h:39
The storage namespace.
Definition: Actiongraph.h:40
BtrfsRaidLevel
Btrfs RAID levels (aka profiles) used for metadata and data.
Definition: Btrfs.h:46
bool is_btrfs(const Device *device)
Checks whether device points to a Btrfs.
Btrfs * to_btrfs(Device *device)
Converts pointer to Device to pointer to Btrfs.
std::string get_btrfs_raid_level_name(BtrfsRaidLevel btrfs_raid_level)
Convert the btrfs RAID level btrfs_raid_level to a string.