Motr
M0
|
Go to the source code of this file.
Data Structures | |
struct | m0hsm_options |
Macros | |
#define | __MOTR_HSM_M0HSM_API_H__ |
#define | HSM_TIER_MAX (UINT8_MAX - 1) |
Enumerations | |
enum | hsm_log_level { LOG_NONE = 0, LOG_ERROR, LOG_INFO, LOG_VERB, LOG_DEBUG } |
enum | { MAX_M0_BUFSZ = 128*1024*1024 } |
enum | hsm_cp_flags { HSM_MOVE = (1 << 0), HSM_KEEP_OLD_VERS = (1 << 1), HSM_WRITE_TO_DEST = (1 << 2) } |
enum | hsm_rls_flags { HSM_KEEP_LATEST = (1 << 0) } |
Functions | |
int | m0hsm_init (struct m0_client *instance, struct m0_realm *uber_realm, const struct m0hsm_options *options) |
int | m0hsm_create (struct m0_uint128 id, struct m0_obj *obj, uint8_t tier_idx, bool keep_open) |
int | m0hsm_pwrite (struct m0_obj *obj, void *buf, size_t len, off_t off) |
int | m0hsm_set_write_tier (struct m0_uint128 id, uint8_t tier_idx) |
int | m0hsm_copy (struct m0_uint128 obj_id, uint8_t src_tier_idx, uint8_t tgt_tier_idx, off_t offset, size_t length, enum hsm_cp_flags flags) |
int | m0hsm_release (struct m0_uint128 obj_id, uint8_t tier_idx, off_t offset, size_t length, enum hsm_rls_flags flags) |
int | m0hsm_stage (struct m0_uint128 obj_id, uint8_t target_tier, off_t offset, size_t length, enum hsm_cp_flags flags) |
int | m0hsm_archive (struct m0_uint128 obj_id, uint8_t target_tier, off_t offset, size_t length, enum hsm_cp_flags flags) |
int | m0hsm_multi_release (struct m0_uint128 obj_id, uint8_t max_tier, off_t offset, size_t length, enum hsm_rls_flags flags) |
int | m0hsm_dump (FILE *stream, struct m0_uint128 id, bool details) |
#define __MOTR_HSM_M0HSM_API_H__ |
Definition at line 28 of file m0hsm_api.h.
#define HSM_TIER_MAX (UINT8_MAX - 1) |
Max allowed tier index (UINT8_MAX is reserved for internal use)
Definition at line 65 of file m0hsm_api.h.
anonymous enum |
enum hsm_cp_flags |
copy options
Definition at line 111 of file m0hsm_api.h.
enum hsm_log_level |
level of HSM traces
Enumerator | |
---|---|
LOG_NONE | |
LOG_ERROR | |
LOG_INFO | |
LOG_VERB | |
LOG_DEBUG |
Definition at line 42 of file m0hsm_api.h.
enum hsm_rls_flags |
release options
Definition at line 146 of file m0hsm_api.h.
int m0hsm_archive | ( | struct m0_uint128 | obj_id, |
uint8_t | target_tier, | ||
off_t | offset, | ||
size_t | length, | ||
enum hsm_cp_flags | flags | ||
) |
Request to archive data to a slower tier.
obj_id | Id of the object to be archived. |
targer_tier | Target tier index (0 is the top tier). |
offset | Start offset of the region to be staged. |
length | Size of the region to be staged. |
flags | Set of OR'ed hsm_cp_flags. |
Definition at line 2831 of file m0hsm_api.c.
int m0hsm_copy | ( | struct m0_uint128 | obj_id, |
uint8_t | src_tier_idx, | ||
uint8_t | tgt_tier_idx, | ||
off_t | offset, | ||
size_t | length, | ||
enum hsm_cp_flags | flags | ||
) |
Copy a region of an object from one tier to another. This is transparent to applications if they use the I/O calls defined above (m0hsm_create/pread/pwrite).
obj_id | Id of the object to be copied. |
src_tier_idx | Source tier index (0 is the top tier). |
tgt_tier_idx | Target tier index (0 is the top tier). |
offset | Start offset of the region to be copied. |
length | Size of the region to be copied. |
flags | Set of OR'ed hsm_cp_flags. |
Definition at line 2715 of file m0hsm_api.c.
int m0hsm_create | ( | struct m0_uint128 | id, |
struct m0_obj * | obj, | ||
uint8_t | tier_idx, | ||
bool | keep_open | ||
) |
Create an object to be managed by HSM.
id | Identifier of the object to be created. |
obj | Pointer to the created object. |
tier_idx | Index of the target tier (0 is the top tier). |
keep_open | Keep the object entity opened. |
Definition at line 1571 of file m0hsm_api.c.
int m0hsm_dump | ( | FILE * | stream, |
struct m0_uint128 | id, | ||
bool | details | ||
) |
Dump HSM information about a composite object.
stream | FILE* to write information to. |
id | Identifier of the object to dump. |
details | If true dump all details, else print brief output. |
Definition at line 875 of file m0hsm_api.c.
int m0hsm_init | ( | struct m0_client * | instance, |
struct m0_realm * | uber_realm, | ||
const struct m0hsm_options * | options | ||
) |
Initialize HSM API.
options | HSM options. NULL to keep defaults. |
Definition at line 166 of file m0hsm_api.c.
int m0hsm_multi_release | ( | struct m0_uint128 | obj_id, |
uint8_t | max_tier, | ||
off_t | offset, | ||
size_t | length, | ||
enum hsm_rls_flags | flags | ||
) |
Release a region of an object from multiple tiers. All data in tiers up to max_tier are released.
obj_id | Id of the object to be archived. |
targer_tier | Target tier index (0 is the top tier). |
offset | Start offset of the region to be staged. |
length | Size of the region to be staged. |
flags | Set of OR'ed hsm_rls_flags. |
Definition at line 2499 of file m0hsm_api.c.
int m0hsm_pwrite | ( | struct m0_obj * | obj, |
void * | buf, | ||
size_t | len, | ||
off_t | off | ||
) |
[WORKAROUND CALL] This call fixes a miss in composite layout management i.e. create a associated read extent when a data is written.
Write data to an object. Object's entity must be opened prior to calling this. offset and length must respect usual m0 requirements of alignment (PAGE_SIZE minimum).
obj | Object to write data to. |
iov | Data buffer. |
off | Start offset. |
Definition at line 1968 of file m0hsm_api.c.
int m0hsm_release | ( | struct m0_uint128 | obj_id, |
uint8_t | tier_idx, | ||
off_t | offset, | ||
size_t | length, | ||
enum hsm_rls_flags | flags | ||
) |
Release a region of an object from the given tier.
obj_id | Id of the object to be released. |
tier_idx | Tier to drop the data from. |
offset | Start offset of the region to be released. |
length | Size of the region to be released. |
flags | Set of OR'ed hsm_rls_flags. |
Definition at line 2493 of file m0hsm_api.c.
int m0hsm_set_write_tier | ( | struct m0_uint128 | id, |
uint8_t | tier_idx | ||
) |
Selects the target tier for next write operations. This does not move existing data.
obj | Object for which we want to change the write tier. |
Definition at line 1224 of file m0hsm_api.c.
int m0hsm_stage | ( | struct m0_uint128 | obj_id, |
uint8_t | target_tier, | ||
off_t | offset, | ||
size_t | length, | ||
enum hsm_cp_flags | flags | ||
) |
Request to stage data to a faster tier.
obj_id | Id of the object to be staged. |
targer_tier | Target tier index (0 is the top tier). |
offset | Start offset of the region to be staged. |
length | Size of the region to be staged. |
flags | HSM_WRITE_TO_DEST if next write operations should also be directed to the same fast tier (intensive writes expected). |
Definition at line 2773 of file m0hsm_api.c.