Motr
M0
|
Data Structures | |
struct | storage_devs_wait |
struct | m0_storage_dev |
struct | m0_storage_devs |
struct | m0_storage_space |
Enumerations | |
enum | m0_storage_dev_type { M0_STORAGE_DEV_TYPE_LINUX = 1, M0_STORAGE_DEV_TYPE_AD } |
This module provides functionality to work with storage devices used by IO service. It is intended to be used to attach/detach storage devices dynamically and query them for some information (i.e. used/free space).
Backing store domain and BE segment for storage devices are provided by user.
Structure m0_storage_devs contains list of storage devices used by IO service and intended to be the one and only place to hold such a list for IO service.
Functions provided by this module do not take any locks internally. User should lock m0_storage_devs structure on demand using m0_storage_devs_lock(), m0_storage_devs_unlock() functions.
enum m0_storage_dev_type |
Enumerator | |
---|---|
M0_STORAGE_DEV_TYPE_LINUX | |
M0_STORAGE_DEV_TYPE_AD |
Definition at line 65 of file storage_dev.h.
|
static |
Definition at line 193 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_attach | ( | struct m0_storage_dev * | dev, |
struct m0_storage_devs * | devs | ||
) |
Attaches storage device to the devs list.
Definition at line 633 of file storage_dev.c.
Definition at line 169 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_clink_del | ( | struct m0_clink * | link | ) |
Definition at line 176 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_destroy | ( | struct m0_storage_dev * | dev | ) |
Destroys storage device object.
Finalises (but doesn't destroy) the underlying stob domain.
Definition at line 603 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_detach | ( | struct m0_storage_dev * | dev | ) |
Detaches storage device.
In fact, this function releases a reference to the storage device which is detached when all references are released. On detach the storage device is destroyed implicitly. m0_storage_devs structure which contains the storage device must be locked.
Definition at line 652 of file storage_dev.c.
M0_INTERNAL int m0_storage_dev_format | ( | struct m0_storage_dev * | dev, |
uint64_t | cid | ||
) |
Formats storage device.
Not implemented yet.
Definition at line 767 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_get | ( | struct m0_storage_dev * | dev | ) |
Obtains reference to the storage device.
Definition at line 466 of file storage_dev.c.
M0_INTERNAL int m0_storage_dev_new | ( | struct m0_storage_devs * | devs, |
uint64_t | cid, | ||
const char * | path, | ||
uint64_t | size, | ||
struct m0_conf_sdev * | sdev, | ||
bool | force, | ||
struct m0_storage_dev ** | dev | ||
) |
Allocates and initialises new storage device.
Creates backing store stob in domain provided in m0_storage_devs_init. Also creates AD stob domain for storage device.
Definition at line 576 of file storage_dev.c.
M0_INTERNAL int m0_storage_dev_new_by_conf | ( | struct m0_storage_devs * | devs, |
struct m0_conf_sdev * | sdev, | ||
bool | force, | ||
struct m0_storage_dev ** | dev | ||
) |
Initialises device using information from configuration object.
Extracts device parameters and executes m0_storage_dev_new.
Definition at line 590 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_put | ( | struct m0_storage_dev * | dev | ) |
Releases reference to the storage device.
m0_storage_devs structure which contains the storage device must be locked, because this function can lead to execution of device detach.
Definition at line 471 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_space | ( | struct m0_storage_dev * | dev, |
struct m0_storage_space * | space | ||
) |
Obtains information about free space of the device.
Definition at line 674 of file storage_dev.c.
M0_INTERNAL int m0_storage_dev_stob_create | ( | struct m0_storage_devs * | devs, |
struct m0_stob_id * | sid, | ||
struct m0_dtx * | dtx | ||
) |
Creates a stob if it doesn't exist.
This function is synchronised with possible storage device detach operation.
Definition at line 810 of file storage_dev.c.
M0_INTERNAL int m0_storage_dev_stob_destroy | ( | struct m0_storage_devs * | devs, |
struct m0_stob * | stob, | ||
struct m0_dtx * | dtx | ||
) |
Destroys stob and releases reference to the respective storage device.
Definition at line 836 of file storage_dev.c.
M0_INTERNAL int m0_storage_dev_stob_find | ( | struct m0_storage_devs * | devs, |
struct m0_stob_id * | sid, | ||
struct m0_stob ** | stob | ||
) |
Finds and locates a stob which belongs to a storage device from the devs. On success acquires reference to the stob and respective storage device.
Definition at line 868 of file storage_dev.c.
M0_INTERNAL void m0_storage_dev_stob_put | ( | struct m0_storage_devs * | devs, |
struct m0_stob * | stob | ||
) |
Releases reference to the stob and respective storage device.
Definition at line 912 of file storage_dev.c.
M0_INTERNAL void m0_storage_devs_detach_all | ( | struct m0_storage_devs * | devs | ) |
Synchronously detaches all storage devices.
Definition at line 743 of file storage_dev.c.
M0_INTERNAL int m0_storage_devs_fdatasync | ( | struct m0_storage_devs * | devs | ) |
Does fdatasync on all stobs in storage devices.
Definition at line 802 of file storage_dev.c.
M0_INTERNAL struct m0_storage_dev * m0_storage_devs_find_by_cid | ( | struct m0_storage_devs * | devs, |
uint64_t | cid | ||
) |
Finds storage device by its cid.
Definition at line 152 of file storage_dev.c.
M0_INTERNAL struct m0_storage_dev * m0_storage_devs_find_by_dom | ( | struct m0_storage_devs * | devs, |
struct m0_stob_domain * | dom | ||
) |
Finds storage device by its AD stob domain.
Definition at line 161 of file storage_dev.c.
M0_INTERNAL void m0_storage_devs_fini | ( | struct m0_storage_devs * | devs | ) |
Finalises storage devices structure.
Definition at line 107 of file storage_dev.c.
M0_INTERNAL int m0_storage_devs_init | ( | struct m0_storage_devs * | devs, |
enum m0_storage_dev_type | type, | ||
struct m0_be_seg * | be_seg, | ||
struct m0_stob_domain * | bstore_dom, | ||
struct m0_reqh * | reqh | ||
) |
Initialises storage devices structure.
Backing store domain should be already created and initialised.
Definition at line 83 of file storage_dev.c.
M0_INTERNAL void m0_storage_devs_lock | ( | struct m0_storage_devs * | devs | ) |
Locks storage devices structure.
Definition at line 71 of file storage_dev.c.
M0_INTERNAL void m0_storage_devs_locks_disable | ( | struct m0_storage_devs * | devs | ) |
Disable sdev locks. Use case: 1+0+0 configuration.
Definition at line 145 of file storage_dev.c.
M0_INTERNAL void m0_storage_devs_unlock | ( | struct m0_storage_devs * | devs | ) |
Unlocks storage devices structure.
Definition at line 77 of file storage_dev.c.
M0_INTERNAL void m0_storage_devs_use_directio | ( | struct m0_storage_devs * | devs, |
bool | directio | ||
) |
Enables or disables direct I/O for linuxstobs.
Definition at line 134 of file storage_dev.c.
M0_TL_DECLARE | ( | storage_dev | , |
M0_EXTERN | , | ||
struct m0_storage_dev | |||
) |
M0_TL_DEFINE | ( | storage_dev | , |
M0_INTERNAL | , | ||
struct m0_storage_dev | |||
) |
M0_TL_DESCR_DECLARE | ( | storage_dev | , |
M0_EXTERN | |||
) |
M0_TL_DESCR_DEFINE | ( | storage_dev | , |
"storage_dev" | , | ||
M0_INTERNAL | , | ||
struct m0_storage_dev | , | ||
isd_linkage | , | ||
isd_magic | , | ||
M0_STORAGE_DEV_MAGIC | , | ||
M0_STORAGE_DEV_HEAD_MAGIC | |||
) |
tlist descriptor for list of m0_storage_dev objects placed in m0_storage_devs::sds_devices list using isd_linkage.
|
static |
Definition at line 776 of file storage_dev.c.
|
static |
Definition at line 382 of file storage_dev.c.
|
static |
Definition at line 476 of file storage_dev.c.
|
static |
Definition at line 452 of file storage_dev.c.
|
static |
Definition at line 182 of file storage_dev.c.
|
static |
Definition at line 277 of file storage_dev.c.
|
static |
Definition at line 207 of file storage_dev.c.
|
static |
Definition at line 335 of file storage_dev.c.
|
static |
Definition at line 303 of file storage_dev.c.
|
static |
Definition at line 734 of file storage_dev.c.
|
static |
Definition at line 66 of file storage_dev.c.