uint64_t min_size,
uint64_t size,
PExtentVector& extents) = 0;
+ /** Reports amount of space that can be transferred to BlueFS.
+ * This gives either current state, when alloc_size is currently used
+ * BlueFS's size, or simulation when alloc_size is different.
+ * @params
+ * alloc_size - allocation unit size to check
+ */
+ virtual size_t available_freespace(uint64_t alloc_size) = 0;
};
class BlueFS {
vector<IOContext*> ioc; ///< IOContexts for bdevs
vector<interval_set<uint64_t> > block_all; ///< extents in bdev we own
vector<Allocator*> alloc; ///< allocators for bdevs
+ vector<uint64_t> alloc_size; ///< alloc size for each device
vector<interval_set<uint64_t>> pending_release; ///< extents to release
BlockDevice::aio_callback_t discard_cb[3]; //discard callbacks for each dev
BlueFSDeviceExpander* slow_dev_expander = nullptr;
+ class SocketHook;
+ SocketHook* asok_hook = nullptr;
+
void _init_logger();
void _shutdown_logger();
void _update_logger_stats();
void _drop_link(FileRef f);
int _get_slow_device_id() { return bdev[BDEV_SLOW] ? BDEV_SLOW : BDEV_DB; }
+ const char* get_device_name(unsigned id);
int _expand_slow_device(uint64_t min_size, PExtentVector& extents);
int _allocate(uint8_t bdev, uint64_t len,
bluefs_fnode_t* node);
void collect_metadata(map<string,string> *pm, unsigned skip_bdev_id);
void get_devices(set<string> *ls);
+ uint64_t get_alloc_size(int id) {
+ return alloc_size[id];
+ }
int fsck();
int device_migrate_to_new(