23 #ifndef STORAGE_BCACHE_H 24 #define STORAGE_BCACHE_H 27 #include "storage/Devices/Partitionable.h" 28 #include "storage/Devices/Device.h" 29 #include "storage/Devicegraph.h" 30 #include "storage/Utils/Swig.h" 51 WRITETHROUGH, WRITEBACK, WRITEAROUND, NONE
71 unsigned int get_number()
const;
200 const Impl& get_impl()
const;
202 virtual Bcache* clone()
const override;
211 bool is_bcache(
const Device* device);
void remove_bcache_cset()
Removes association with a caching set.
static std::vector< Bcache * > get_all(Devicegraph *devicegraph)
Get all bcaches.
static std::string find_free_name(const Devicegraph *devicegraph)
Find a free name for a bcache.
const BlkDevice * get_backing_device() const
Get the BlkDevice used as backing device.
static bool compare_by_number(const Bcache *lhs, const Bcache *rhs)
Compare (less than) two bcaches by number.
const BlkDevice * get_blk_device() const ST_DEPRECATED
Get the BlkDevice used as backing device.
BcacheType
Bcache types.
Definition: Bcache.h:42
A bcache device.
Definition: Bcache.h:61
bool has_bcache_cset() const
Returns true if a caching set is attached.
static void reassign_numbers(Devicegraph *devicegraph)
Fix the numeric ids of bcache devices so that there are no holes in the id sequence for in-memory bca...
The master container of the libstorage.
Definition: Devicegraph.h:153
An abstract Block Device.
Definition: BlkDevice.h:44
unsigned get_writeback_percent() const
Returns percent of writeback dirty pages.
const BcacheCset * get_bcache_cset() const
Get the caching set associated with this bcache device.
An abstract base class of storage devices, and a vertex in the Devicegraph.
Definition: Device.h:75
A bcache cache set.
Definition: BcacheCset.h:41
Bcache * to_bcache(Device *device)
Converts pointer to Device to pointer to Bcache.
unsigned long long get_sequential_cutoff() const
Returns size of sequential_cutoff attribute.
Definition: Partitionable.h:39
The storage namespace.
Definition: Actiongraph.h:37
static Bcache * find_by_name(Devicegraph *devicegraph, const std::string &name)
Find a bcache by its name.
void set_cache_mode(CacheMode mode)
Sets cache mode attribute.
void add_bcache_cset(BcacheCset *bcache_cset)
Associates a caching set to the bcache.
CacheMode
The Cache mode attribute.
Definition: Bcache.h:50
CacheMode get_cache_mode() const
Returns cache mode attribute.