Motr
M0
|
Data Structures | |
struct | m0_statfs |
struct | m0_mdstore |
Macros | |
#define | M0_MD_MAX_NAME_LEN 256 |
Typedefs | |
typedef enum m0_mdstore_locate_flags | m0_mdstore_locate_flags_t |
Enumerations | |
enum | m0_mdstore_locate_flags { M0_MD_LOCATE_STORED = 1 << 0, M0_MD_LOCATE_OPENED = 1 << 1, M0_MD_LOCATE_ORPHAN = 1 << 2 } |
Functions | |
M0_INTERNAL int | m0_mdstore_statfs (struct m0_mdstore *md, struct m0_statfs *statfs) |
M0_INTERNAL int | m0_mdstore_init (struct m0_mdstore *md, struct m0_be_seg *db, bool init_root) |
M0_INTERNAL void | m0_mdstore_fini (struct m0_mdstore *md) |
M0_INTERNAL int | m0_mdstore_create (struct m0_mdstore *md, struct m0_sm_group *grp, struct m0_cob_domain_id *id, struct m0_be_domain *bedom, struct m0_be_seg *db) |
M0_INTERNAL int | m0_mdstore_destroy (struct m0_mdstore *md, struct m0_sm_group *grp, struct m0_be_domain *bedom) |
Variables | |
uint64_t | sf_type |
uint32_t | sf_bsize |
uint64_t | sf_blocks |
uint64_t | sf_bfree |
uint64_t | sf_bavail |
uint64_t | sf_files |
uint64_t | sf_ffree |
uint32_t | sf_namelen |
struct m0_fid | sf_root |
struct m0_cob_domain * | md_dom |
struct m0_cob * | md_root |
. Input | |
Handle unlink operation described by and cob is so called statdata cob and returned by m0_cob_locate(). Error code is returned in error case or zero otherwise. | |
M0_INTERNAL int | m0_mdstore_link (struct m0_mdstore *md, struct m0_fid *pfid, struct m0_cob *cob, struct m0_buf *name, struct m0_be_tx *tx) |
M0_INTERNAL int | m0_mdstore_unlink (struct m0_mdstore *md, struct m0_fid *pfid, struct m0_cob *cob, struct m0_buf *name, struct m0_be_tx *tx) |
M0_INTERNAL int | m0_mdstore_rename (struct m0_mdstore *md, struct m0_fid *pfid_tgt, struct m0_fid *pfid_src, struct m0_cob *cob_tgt, struct m0_cob *cob_src, struct m0_buf *tname, struct m0_buf *sname, struct m0_be_tx *tx) |
M0_INTERNAL int | m0_mdstore_fcreate (struct m0_mdstore *md, struct m0_fid *pfid, struct m0_cob_attr *attr, struct m0_cob **out, struct m0_be_tx *tx) |
M0_INTERNAL int | m0_mdstore_open (struct m0_mdstore *md, struct m0_cob *cob, m0_mdstore_locate_flags_t flags, struct m0_be_tx *tx) |
M0_INTERNAL int | m0_mdstore_close (struct m0_mdstore *md, struct m0_cob *cob, struct m0_be_tx *tx) |
M0_INTERNAL int | m0_mdstore_setattr (struct m0_mdstore *md, struct m0_cob *cob, struct m0_cob_attr *attr, struct m0_be_tx *tx) |
M0_INTERNAL int | m0_mdstore_getattr (struct m0_mdstore *md, struct m0_cob *cob, struct m0_cob_attr *attr) |
M0_INTERNAL int | m0_mdstore_readdir (struct m0_mdstore *md, struct m0_cob *cob, struct m0_rdpg *rdpg) |
M0_INTERNAL int | m0_mdstore_locate (struct m0_mdstore *md, const struct m0_fid *fid, struct m0_cob **cob, int flags) |
M0_INTERNAL int | m0_mdstore_lookup (struct m0_mdstore *md, struct m0_fid *pfid, struct m0_buf *name, struct m0_cob **cob) |
M0_INTERNAL int | m0_mdstore_path (struct m0_mdstore *md, struct m0_fid *fid, char **path) |
M0_INTERNAL void | m0_mdstore_create_credit (struct m0_mdstore *md, struct m0_be_tx_credit *accum) |
M0_INTERNAL void | m0_mdstore_link_credit (struct m0_mdstore *md, struct m0_be_tx_credit *accum) |
M0_INTERNAL void | m0_mdstore_unlink_credit (struct m0_mdstore *md, struct m0_be_tx_credit *accum) |
M0_INTERNAL void | m0_mdstore_rename_credit (struct m0_mdstore *md, struct m0_be_tx_credit *accum) |
M0_INTERNAL void | m0_mdstore_setattr_credit (struct m0_mdstore *md, struct m0_be_tx_credit *accum) |
M0_INTERNAL int | m0_mdstore_mod_init (void) |
M0_INTERNAL void | m0_mdstore_mod_fini (void) |
#define M0_MD_MAX_NAME_LEN 256 |
typedef enum m0_mdstore_locate_flags m0_mdstore_locate_flags_t |
Flags supplied to m0_mdstore_locate() to point out where a cob should be found: on store, in opened files table or orhans table.
Enumerator | |
---|---|
M0_MD_LOCATE_STORED | Find cob on store. |
M0_MD_LOCATE_OPENED | Find cob in opened cobs table. |
M0_MD_LOCATE_ORPHAN | Find cob in orphans table. |
M0_INTERNAL int m0_mdstore_close | ( | struct m0_mdstore * | md, |
struct m0_cob * | cob, | ||
struct m0_be_tx * | tx | ||
) |
Handle close operation on . Input is so called statdata cob and returned by m0_cob_locate().
Error code is returned in error case or zero otherwise.
Definition at line 536 of file mdstore.c.
M0_INTERNAL int m0_mdstore_create | ( | struct m0_mdstore * | md, |
struct m0_sm_group * | grp, | ||
struct m0_cob_domain_id * | id, | ||
struct m0_be_domain * | bedom, | ||
struct m0_be_seg * | db | ||
) |
M0_INTERNAL void m0_mdstore_create_credit | ( | struct m0_mdstore * | md, |
struct m0_be_tx_credit * | accum | ||
) |
M0_INTERNAL int m0_mdstore_destroy | ( | struct m0_mdstore * | md, |
struct m0_sm_group * | grp, | ||
struct m0_be_domain * | bedom | ||
) |
M0_INTERNAL int m0_mdstore_fcreate | ( | struct m0_mdstore * | md, |
struct m0_fid * | pfid, | ||
struct m0_cob_attr * | attr, | ||
struct m0_cob ** | out, | ||
struct m0_be_tx * | tx | ||
) |
Handle create operation described by on . Input is returned by m0_cob_alloc().
Error code is returned in error case or zero otherwise.
Increment cnr_nlink of parent directory.
Definition at line 209 of file mdstore.c.
M0_INTERNAL void m0_mdstore_fini | ( | struct m0_mdstore * | md | ) |
M0_INTERNAL int m0_mdstore_getattr | ( | struct m0_mdstore * | md, |
struct m0_cob * | cob, | ||
struct m0_cob_attr * | attr | ||
) |
Get attributes of into passed . Input is so called statdata cob and returned by m0_cob_locate().
Error code is returned in error case or zero otherwise.
Definition at line 642 of file mdstore.c.
M0_INTERNAL int m0_mdstore_init | ( | struct m0_mdstore * | md, |
struct m0_be_seg * | db, | ||
bool | init_root | ||
) |
M0_INTERNAL int m0_mdstore_link | ( | struct m0_mdstore * | md, |
struct m0_fid * | pfid, | ||
struct m0_cob * | cob, | ||
struct m0_buf * | name, | ||
struct m0_be_tx * | tx | ||
) |
M0_INTERNAL void m0_mdstore_link_credit | ( | struct m0_mdstore * | md, |
struct m0_be_tx_credit * | accum | ||
) |
M0_INTERNAL int m0_mdstore_locate | ( | struct m0_mdstore * | md, |
const struct m0_fid * | fid, | ||
struct m0_cob ** | cob, | ||
int | flags | ||
) |
M0_INTERNAL int m0_mdstore_lookup | ( | struct m0_mdstore * | md, |
struct m0_fid * | pfid, | ||
struct m0_buf * | name, | ||
struct m0_cob ** | cob | ||
) |
Find cob by parent fid and name.
Finds cob by name and store its pointer to passed .
In order to handle possible obf-like names like this: (cat /mnt/motr/.motr/1:5), parent fid is checked and special action is taken to extract fid components from file name in obf case. Then m0_cob_locate() is used to find cob by fid rather than by name.
Definition at line 863 of file mdstore.c.
M0_INTERNAL int m0_mdstore_open | ( | struct m0_mdstore * | md, |
struct m0_cob * | cob, | ||
m0_mdstore_locate_flags_t | flags, | ||
struct m0_be_tx * | tx | ||
) |
Handle open operation described by on . Input is so called statdata cob and returned by m0_cob_locate(). Error code is returned in error case or zero otherwise.
Definition at line 525 of file mdstore.c.
M0_INTERNAL int m0_mdstore_path | ( | struct m0_mdstore * | md, |
struct m0_fid * | fid, | ||
char ** | path | ||
) |
Get path by . Path is allocated by m0_alloc() on success and path is saved there. When it is not longer needed it may be freed with m0_free().
Definition at line 900 of file mdstore.c.
M0_INTERNAL int m0_mdstore_readdir | ( | struct m0_mdstore * | md, |
struct m0_cob * | cob, | ||
struct m0_rdpg * | rdpg | ||
) |
Handle readdir operation described by on . Input is so called statdata cob and returned by m0_cob_locate().
Error code is returned in error case or something >= 0 otherwise.
Definition at line 705 of file mdstore.c.
M0_INTERNAL int m0_mdstore_rename | ( | struct m0_mdstore * | md, |
struct m0_fid * | pfid_tgt, | ||
struct m0_fid * | pfid_src, | ||
struct m0_cob * | cob_tgt, | ||
struct m0_cob * | cob_src, | ||
struct m0_buf * | tname, | ||
struct m0_buf * | sname, | ||
struct m0_be_tx * | tx | ||
) |
Handle rename operation described by params. Input cobs are statdata cobs and returned by m0_cob_locate(). Rest of the arguments are self explanatory.
Error code is returned in error case or zero otherwise.
Definition at line 560 of file mdstore.c.
M0_INTERNAL void m0_mdstore_rename_credit | ( | struct m0_mdstore * | md, |
struct m0_be_tx_credit * | accum | ||
) |
M0_INTERNAL int m0_mdstore_setattr | ( | struct m0_mdstore * | md, |
struct m0_cob * | cob, | ||
struct m0_cob_attr * | attr, | ||
struct m0_be_tx * | tx | ||
) |
Handle setattr operation described by on . Input is so called statdata cob and returned by m0_cob_locate().
Error code is returned in error case or zero otherwise.
Definition at line 632 of file mdstore.c.
M0_INTERNAL void m0_mdstore_setattr_credit | ( | struct m0_mdstore * | md, |
struct m0_be_tx_credit * | accum | ||
) |
M0_INTERNAL int m0_mdstore_statfs | ( | struct m0_mdstore * | md, |
struct m0_statfs * | statfs | ||
) |
Populate with storage data such as free files, etc.
We need statfs mostly to provide mdstore root fid to m0t1fs at this point. It is not yet clear what else info should be returned where it can be retrieved from. Hence return zeros so far.
Definition at line 55 of file mdstore.c.
M0_INTERNAL int m0_mdstore_unlink | ( | struct m0_mdstore * | md, |
struct m0_fid * | pfid, | ||
struct m0_cob * | cob, | ||
struct m0_buf * | name, | ||
struct m0_be_tx * | tx | ||
) |
M0_INTERNAL void m0_mdstore_unlink_credit | ( | struct m0_mdstore * | md, |
struct m0_be_tx_credit * | accum | ||
) |
struct m0_cob_domain* md_dom |