Motr  M0
Component objects

Data Structures

struct  m0_cob_domain_id
 
struct  m0_cob_domain
 
struct  m0_cob_attr
 
struct  m0_cob_nskey
 
struct  m0_cob_nsrec
 
struct  m0_cob_oikey
 
struct  m0_cob_fabkey
 
struct  m0_cob_fabrec
 
struct  m0_cob_omgkey
 
struct  m0_cob_omgrec
 
struct  m0_cob_eakey
 
struct  m0_cob_earec
 
struct  m0_cob_bckey
 
struct  m0_cob_bcrec
 
struct  m0_cob
 
struct  m0_dirent
 
struct  m0_rdpg
 
struct  m0_cob_iterator
 
struct  m0_cob_ea_iterator
 
struct  m0_cob_bc_iterator
 

Macros

#define MKFS_ROOT_SIZE   4096
 
#define MKFS_ROOT_BLKSIZE   4096
 
#define MKFS_ROOT_BLOCKS   16
 
#define M0_COB_ALL
 

Enumerations

enum  { M0_COB_NAME_MAX = 256, M0_COB_EA_MAX = 4096 }
 
enum  cob_table_optype { COB_TABLE_DELETE, COB_TABLE_UPDATE, COB_TABLE_INSERT }
 
enum  cob_table_kvtype {
  COB_KVTYPE_OMG, COB_KVTYPE_FAB, COB_KVTYPE_FEA, COB_KVTYPE_NS,
  COB_KVTYPE_OI, COB_KVTYPE_BC
}
 
enum  { M0_MDS_COB_ID_START = 0, M0_IOS_COB_ID_START = 1000 }
 
enum  m0_cob_domain_format_version { M0_COB_DOMAIN_FORMAT_VERSION_1 = 1, M0_COB_DOMAIN_FORMAT_VERSION = M0_COB_DOMAIN_FORMAT_VERSION_1 }
 
enum  m0_cob_valid_flags {
  M0_COB_ATIME = 1 << 0, M0_COB_MTIME = 1 << 1, M0_COB_CTIME = 1 << 2, M0_COB_SIZE = 1 << 3,
  M0_COB_MODE = 1 << 4, M0_COB_UID = 1 << 5, M0_COB_GID = 1 << 6, M0_COB_BLOCKS = 1 << 7,
  M0_COB_TYPE = 1 << 8, M0_COB_FLAGS = 1 << 9, M0_COB_NLINK = 1 << 10, M0_COB_RDEV = 1 << 11,
  M0_COB_BLKSIZE = 1 << 12, M0_COB_LID = 1 << 13, M0_COB_PVER = 1 << 14
}
 
enum  m0_cob_nsrec_format_version { M0_COB_NSREC_FORMAT_VERSION_1 = 1, M0_COB_NSREC_FORMAT_VERSION = M0_COB_NSREC_FORMAT_VERSION_1 }
 
enum  m0_cob_flags {
  M0_CA_NSKEY = (1 << 0), M0_CA_NSKEY_FREE = (1 << 1), M0_CA_NSREC = (1 << 2), M0_CA_FABREC = (1 << 3),
  M0_CA_OMGREC = (1 << 4), M0_CA_LAYOUT = (1 << 5), M0_CA_BCREC = (1 << 6)
}
 

Functions

static int cob0_init (struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
 
static void cob0_fini (struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
 
M0_INTERNAL int m0_cob_nskey_cmp (const struct m0_cob_nskey *k0, const struct m0_cob_nskey *k1)
 
M0_INTERNAL size_t m0_cob_nskey_size (const struct m0_cob_nskey *cnk)
 
M0_INTERNAL int m0_cob_eakey_make (struct m0_cob_eakey **keyh, const struct m0_fid *fid, const char *name, size_t namelen)
 
static int m0_cob_max_eakey_make (struct m0_cob_eakey **keyh, const struct m0_fid *fid, const char *name, int namelen)
 
M0_INTERNAL int m0_cob_eakey_cmp (const struct m0_cob_eakey *k0, const struct m0_cob_eakey *k1)
 
M0_INTERNAL size_t m0_cob_eakey_size (const struct m0_cob_eakey *cek)
 
static size_t m0_cob_earec_size (const struct m0_cob_earec *rec)
 
M0_INTERNAL size_t m0_cob_max_earec_size (void)
 
static size_t m0_cob_max_eakey_size (void)
 
static size_t m0_cob_fabrec_size (const struct m0_cob_fabrec *rec)
 
static size_t m0_cob_max_fabrec_size (void)
 
static int m0_cob_max_fabrec_make (struct m0_cob_fabrec **rech)
 
static int m0_cob_max_nskey_make (struct m0_cob_nskey **keyh, const struct m0_fid *pfid, const char *name, int namelen)
 
static size_t m0_cob_max_nskey_size (void)
 
static int ns_cmp (const void *key0, const void *key1)
 
static m0_bcount_t ns_ksize (const void *key)
 
static m0_bcount_t ns_vsize (const void *val)
 
static size_t m0_cob_bckey_size (void)
 
static size_t m0_cob_bcrec_size (void)
 
static m0_bcount_t bc_ksize (const void *key)
 
static m0_bcount_t bc_vsize (const void *val)
 
static int m0_cob_bckey_make (struct m0_cob_bckey **keyh, const struct m0_fid *pver_fid, uint64_t user_id)
 
M0_INTERNAL int m0_cob_bckey_cmp (const struct m0_cob_bckey *k0, const struct m0_cob_bckey *k1)
 
static int bc_cmp (const void *key0, const void *key1)
 
static int oi_cmp (const void *key0, const void *key1)
 
static m0_bcount_t oi_ksize (const void *key)
 
static int fb_cmp (const void *key0, const void *key1)
 
static m0_bcount_t fb_ksize (const void *key)
 
static m0_bcount_t fb_vsize (const void *val)
 
static int ea_cmp (const void *key0, const void *key1)
 
static m0_bcount_t ea_ksize (const void *key)
 
static m0_bcount_t ea_vsize (const void *val)
 
static int omg_cmp (const void *key0, const void *key1)
 
static m0_bcount_t omg_ksize (const void *key)
 
static m0_bcount_t omg_vsize (const void *val)
 
static M0_UNUSED char * cob_dom_id_make (char *buf, const struct m0_cob_domain_id *id, const char *prefix)
 
int m0_cob_domain_init (struct m0_cob_domain *dom, struct m0_be_seg *seg)
 
void m0_cob_domain_fini (struct m0_cob_domain *dom)
 
static void cob_domain_id2str (char **s, const struct m0_cob_domain_id *cdid)
 
M0_INTERNAL int m0_cob_domain_credit_add (struct m0_cob_domain *dom, struct m0_be_domain *bedom, struct m0_be_seg *seg, const struct m0_cob_domain_id *cdid, struct m0_be_tx_credit *cred)
 
M0_INTERNAL int m0_cob_domain_create_prepared (struct m0_cob_domain **out, struct m0_sm_group *grp, const struct m0_cob_domain_id *cdid, struct m0_be_domain *bedom, struct m0_be_seg *seg, struct m0_be_tx *tx)
 
int m0_cob_domain_create (struct m0_cob_domain **dom, struct m0_sm_group *grp, const struct m0_cob_domain_id *cdid, struct m0_be_domain *bedom, struct m0_be_seg *seg)
 
int m0_cob_domain_destroy (struct m0_cob_domain *dom, struct m0_sm_group *grp, struct m0_be_domain *bedom)
 
static int cob_table_delete (struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_buf *key)
 
static int cob_table_update (struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_buf *key, struct m0_buf *val)
 
static int cob_table_insert (struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_buf *key, struct m0_buf *val)
 
static int cob_table_lookup (struct m0_be_btree *tree, struct m0_buf *key, struct m0_buf *out)
 
M0_INTERNAL int m0_cob_domain_mkfs (struct m0_cob_domain *dom, const struct m0_fid *rootfid, struct m0_be_tx *tx)
 
static void cob_free_cb (struct m0_ref *ref)
 
M0_INTERNAL void m0_cob_init (struct m0_cob_domain *dom, struct m0_cob *cob)
 
static void cob_fini (struct m0_cob *cob)
 
static int cob_ns_lookup (struct m0_cob *cob)
 
static int cob_oi_lookup (struct m0_cob *cob)
 
static int cob_fab_lookup (struct m0_cob *cob)
 
static int cob_omg_lookup (struct m0_cob *cob)
 
static int cob_get_fabomg (struct m0_cob *cob, uint64_t flags)
 
M0_INTERNAL int m0_cob_lookup (struct m0_cob_domain *dom, struct m0_cob_nskey *nskey, uint64_t flags, struct m0_cob **out)
 
M0_INTERNAL int m0_cob_locate (struct m0_cob_domain *dom, struct m0_cob_oikey *oikey, uint64_t flags, struct m0_cob **out)
 
static bool m0_cob_is_valid (struct m0_cob *cob)
 
M0_INTERNAL int m0_cob_create (struct m0_cob *cob, struct m0_cob_nskey *nskey, struct m0_cob_nsrec *nsrec, struct m0_cob_fabrec *fabrec, struct m0_cob_omgrec *omgrec, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_delete (struct m0_cob *cob, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_delete_put (struct m0_cob *cob, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_update (struct m0_cob *cob, struct m0_cob_nsrec *nsrec, struct m0_cob_fabrec *fabrec, struct m0_cob_omgrec *omgrec, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_name_add (struct m0_cob *cob, struct m0_cob_nskey *nskey, struct m0_cob_nsrec *nsrec, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_name_del (struct m0_cob *cob, struct m0_cob_nskey *nskey, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_name_update (struct m0_cob *cob, struct m0_cob_nskey *srckey, struct m0_cob_nskey *tgtkey, struct m0_be_tx *tx)
 
M0_INTERNAL void m0_cob_nsrec_init (struct m0_cob_nsrec *nsrec)
 
M0_INTERNAL int m0_cob_ea_get (struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *out, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_ea_set (struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *earec, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_ea_del (struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_be_tx *tx)
 
static void cob_table_tx_credit (struct m0_be_btree *tree, enum cob_table_optype t_optype, enum cob_table_kvtype t_kvtype, struct m0_be_tx_credit *accum)
 
struct m0_cob_domain_id M0_XCA_DOMAIN (be)
 

Variables

struct m0_be_0type m0_be_cob0
 
static const struct m0_be_btree_kv_ops cob_ns_ops
 
static const struct m0_be_btree_kv_ops cob_bc_ops
 
static const struct m0_be_btree_kv_ops cob_oi_ops
 
static const struct m0_be_btree_kv_ops cob_fab_ops
 
static const struct m0_be_btree_kv_ops cob_ea_ops
 
static const struct m0_be_btree_kv_ops cob_omg_ops
 
uint64_t id
 
uint64_t id
 
struct m0_format_header cd_header
 
struct m0_cob_domain_id cd_id
 
struct m0_format_footer cd_footer
 
struct m0_be_btree cd_object_index
 
struct m0_be_btree cd_namespace
 
struct m0_be_btree cd_fileattr_basic
 
struct m0_be_btree cd_fileattr_omg
 
struct m0_be_btree cd_fileattr_ea
 
struct m0_be_btree cd_bytecount
 
struct m0_be_rwlock cd_lock
 
struct m0_format_header cd_header
 
struct m0_cob_domain_id cd_id
 
struct m0_format_footer cd_footer
 
struct m0_be_btree cd_object_index
 
struct m0_be_btree cd_namespace
 
struct m0_be_btree cd_fileattr_basic
 
struct m0_be_btree cd_fileattr_omg
 
struct m0_be_btree cd_fileattr_ea
 
struct m0_be_btree cd_bytecount
 
struct m0_be_rwlock cd_lock
 
enum m0_cob_domain_format_version M0_XCA_DOMAIN
 
struct m0_fid ca_pfid
 
struct m0_fid ca_tfid
 
struct m0_fid ca_pver
 
uint32_t ca_valid
 
uint32_t ca_mode
 
uint32_t ca_uid
 
uint32_t ca_gid
 
uint64_t ca_atime
 
uint64_t ca_mtime
 
uint64_t ca_ctime
 
uint64_t ca_rdev
 
uint32_t ca_nlink
 
uint64_t ca_size
 
uint64_t ca_blksize
 
uint64_t ca_blocks
 
uint64_t ca_version
 
uint64_t ca_lid
 
struct m0_buf ca_name
 
struct m0_buf ca_link
 
struct m0_buf ca_eakey
 
struct m0_buf ca_eaval
 
struct m0_fid cnk_pfid
 
struct m0_bitstring cnk_name
 
struct m0_fid cnk_pfid
 
struct m0_bitstring cnk_name
 
struct m0_format_header cnr_header
 
struct m0_fid cnr_fid
 
uint32_t cnr_linkno
 
uint32_t cnr_nlink
 
uint32_t cnr_cntr
 
char cnr_pad [4]
 
uint64_t cnr_omgid
 
uint64_t cnr_size
 
uint64_t cnr_bytecount
 
uint64_t cnr_blksize
 
uint64_t cnr_blocks
 
uint64_t cnr_atime
 
uint64_t cnr_mtime
 
uint64_t cnr_ctime
 
uint64_t cnr_lid
 
struct m0_fid cnr_pver
 
struct m0_format_footer cnr_footer
 
struct m0_format_header cnr_header
 
struct m0_fid cnr_fid
 
uint32_t cnr_linkno
 
uint32_t cnr_nlink
 
uint32_t cnr_cntr
 
char cnr_pad [4]
 
uint64_t cnr_omgid
 
uint64_t cnr_size
 
uint64_t cnr_bytecount
 
uint64_t cnr_blksize
 
uint64_t cnr_blocks
 
uint64_t cnr_atime
 
uint64_t cnr_mtime
 
uint64_t cnr_ctime
 
uint64_t cnr_lid
 
struct m0_fid cnr_pver
 
struct m0_format_footer cnr_footer
 
struct m0_fid cok_fid
 
uint32_t cok_linkno
 
struct m0_fid cok_fid
 
uint32_t cok_linkno
 
struct m0_fid cfb_fid
 
struct m0_fid cfb_fid
 
struct m0_fid cfb_pver
 
uint64_t cfb_version
 
uint64_t cfb_layoutid
 
uint32_t cfb_linklen
 
char cfb_link [0]
 
struct m0_fid cfb_pver
 
uint64_t cfb_version
 
uint64_t cfb_layoutid
 
uint32_t cfb_linklen
 
char cfb_link [0]
 
uint64_t cok_omgid
 
uint64_t cok_omgid
 
uint32_t cor_uid
 
uint32_t cor_mode
 
uint32_t cor_gid
 
uint32_t cor_uid
 
uint32_t cor_mode
 
uint32_t cor_gid
 
struct m0_fid cek_fid
 
struct m0_bitstring cek_name
 
struct m0_fid cek_fid
 
struct m0_bitstring cek_name
 
uint32_t cer_size
 
char cer_body [0]
 
uint32_t cer_size
 
char cer_body [0]
 
struct m0_fid cbk_pfid
 
uint64_t cbk_user_id
 
struct m0_fid cbk_pfid
 
uint64_t cbk_user_id
 
uint64_t cbr_bytecount
 
uint64_t cbr_cob_objects
 
uint64_t cbr_bytecount
 
uint64_t cbr_cob_objects
 
struct m0_cob_domainco_dom
 
struct m0_stobco_stob
 
struct m0_ref co_ref
 
uint64_t co_flags
 
struct m0_file co_file
 
struct m0_cob_nskeyco_nskey
 
struct m0_cob_oikey co_oikey
 
struct m0_cob_nsrec co_nsrec
 
struct m0_cob_fabrecco_fabrec
 
struct m0_cob_omgrec co_omgrec
 
uint32_t d_namelen
 
uint32_t d_reclen
 
char d_name [0]
 
struct m0_bitstringr_pos
 
struct m0_buf r_buf
 
struct m0_bitstringr_end
 
struct m0_cobci_cob
 
struct m0_be_btree_cursor ci_cursor
 
struct m0_cob_nskeyci_key
 
struct m0_cobci_cob
 
struct m0_be_btree_cursor ci_cursor
 
struct m0_cob_eakeyci_key
 
struct m0_cob_earecci_rec
 
struct m0_cobci_cob
 
struct m0_be_btree_cursor ci_cursor
 
struct m0_cob_bckeyci_key
 
struct m0_cob_bcrecci_rec
 

as a start position.

Init cob iterator on passed and

enum  m0_cob_op {
  M0_COB_OP_DOMAIN_MKFS, M0_COB_OP_LOOKUP, M0_COB_OP_LOCATE, M0_COB_OP_CREATE,
  M0_COB_OP_DELETE, M0_COB_OP_TRUNCATE, M0_COB_OP_DELETE_PUT, M0_COB_OP_UPDATE,
  M0_COB_OP_FEA_SET, M0_COB_OP_FEA_DEL, M0_COB_OP_NAME_ADD, M0_COB_OP_NAME_DEL,
  M0_COB_OP_NAME_UPDATE, M0_COB_OP_BYTECOUNT_SET, M0_COB_OP_BYTECOUNT_DEL, M0_COB_OP_BYTECOUNT_UPDATE
}
 
enum  m0_cob_type { M0_COB_IO, M0_COB_MD }
 
const struct m0_fid_type m0_cob_fid_type
 
enum m0_cob_op M0_XCA_ENUM
 
const struct m0_fid_type m0_cob_fid_type
 
M0_INTERNAL const struct m0_fidm0_cob_fid (const struct m0_cob *cob)
 
M0_INTERNAL int m0_cob_mod_init (void)
 
M0_INTERNAL void m0_cob_mod_fini (void)
 
M0_INTERNAL void m0_cob_oikey_make (struct m0_cob_oikey *oikey, const struct m0_fid *fid, int linkno)
 
M0_INTERNAL int m0_cob_nskey_make (struct m0_cob_nskey **keyh, const struct m0_fid *pfid, const char *name, size_t namelen)
 
M0_INTERNAL int m0_cob_fabrec_make (struct m0_cob_fabrec **rech, const char *link, size_t linklen)
 
M0_INTERNAL int m0_cob_bc_iterator_init (struct m0_cob *cob, struct m0_cob_bc_iterator *it, const struct m0_fid *pver_fid, uint64_t user_id)
 
M0_INTERNAL int m0_cob_bc_iterator_get (struct m0_cob_bc_iterator *it)
 
M0_INTERNAL int m0_cob_bc_iterator_next (struct m0_cob_bc_iterator *it)
 
M0_INTERNAL void m0_cob_bc_iterator_fini (struct m0_cob_bc_iterator *it)
 
M0_INTERNAL int m0_cob_bc_entries_dump (struct m0_cob_domain *cdom, struct m0_buf **out_keys, struct m0_buf **out_recs, uint32_t *out_count)
 
M0_INTERNAL void m0_cob_get (struct m0_cob *cob)
 
M0_INTERNAL void m0_cob_put (struct m0_cob *cob)
 
M0_INTERNAL int m0_cob_alloc (struct m0_cob_domain *dom, struct m0_cob **out)
 
M0_INTERNAL int m0_cob_bc_lookup (struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_rec)
 
M0_INTERNAL int m0_cob_bc_insert (struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_val, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_bc_update (struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_val, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_iterator_init (struct m0_cob *cob, struct m0_cob_iterator *it, struct m0_bitstring *name)
 
M0_INTERNAL void m0_cob_iterator_fini (struct m0_cob_iterator *it)
 
M0_INTERNAL int m0_cob_iterator_get (struct m0_cob_iterator *it)
 
M0_INTERNAL int m0_cob_iterator_next (struct m0_cob_iterator *it)
 
M0_INTERNAL int m0_cob_ea_iterator_init (struct m0_cob *cob, struct m0_cob_ea_iterator *it, struct m0_bitstring *name)
 
M0_INTERNAL int m0_cob_ea_iterator_get (struct m0_cob_ea_iterator *it)
 
M0_INTERNAL int m0_cob_ea_iterator_next (struct m0_cob_ea_iterator *it)
 
M0_INTERNAL void m0_cob_ea_iterator_fini (struct m0_cob_ea_iterator *it)
 
M0_INTERNAL int m0_cob_alloc_omgid (struct m0_cob_domain *dom, uint64_t *omgid)
 
M0_INTERNAL int m0_cob_setattr (struct m0_cob *cob, struct m0_cob_attr *attr, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_cob_size_update (struct m0_cob *cob, uint64_t size, struct m0_be_tx *tx)
 
M0_INTERNAL void m0_cob_tx_credit (struct m0_cob_domain *dom, enum m0_cob_op optype, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_cob_ea_get_credit (struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *out, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_cob_ea_set_credit (struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *earec, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_cob_ea_del_credit (struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_cob_ea_iterator_init_credit (struct m0_cob *cob, struct m0_cob_ea_iterator *it, struct m0_bitstring *name, struct m0_be_tx_credit *accum)
 

Detailed Description

A Component object is a metadata layer that holds metadata information. It references a single storage object and contains metadata describing the object. The metadata is stored in database tables. A M0 Global Object (i.e. file) is made up of a collection of Component Objects (stripes).

Component object metadata includes:

Metadata organization:

COB uses four db tables for storing the following pieces of information:

For traditional file systems' namespace we need two tables: name space and object index. These tables are used as following:

Suppose that there is a file F that has got three names:

"a/f0", "b/f1", "c/f2"

Then namespace will have the following records:

(a.fid, "f0") -> (F stat data, 0) (b.fid, "f1") -> (F, 1) (c.fid, "f2") -> (F, 2)

where, in first record, we have "DB key" constructed of f0's parent fid (the directory fid) and "f0", the filename itself. The namespace record contains the fid of file "f0" together with with its stat data, plus the link number for this name.

Here "stat data" means that this record contains file attributes that usually extracted by stat utility or ls -la.

First name stores the stat data (basic file system attributes) and has link number zero.

All the other records have keys constructed from their parent fid and child name ("f1", "f2"), and the record contains only file fid and link number that this record describes.

When the first file name is deleted, the stat data is migrated to another name record of the file (if any). This will be shown below.

The object index contains records:

(F, 0) -> (a.fid, "f0") (F, 1) -> (b.fid, "f1") (F, 2) -> (c.fid, "f2")

where the key is constructed of file fid and its link number. The record contains the parent fid plus the file name. That is, the object index enumerates all the names that a file has. As we have already noted, the object index table values have the same format as namespace keys and may be used for getting namespace data and cob object itself using object's fid.

When doing "rm a/f0" we need to kill 1 namespace and 1 object index record. That is, we need a key containing (a.fid, "f0"). Using this key we can find its position in namespace table and delete the record. But before killing it, we need to check if this record stores the stat data and whether we should move it to another hardlink filename. If ->m0_cob_nsrec::cnr_nlink > 0 this means that it is stat data record and there are other hardlinks for the file, so stat data should be moved. To find out where to move stat data quickly, we just do lookup in the object index for the next linkno of the file:

(F, 0 + 1) -> (b.fid, "f1")

Now we can use its record as a key for namespace table and move stat data to its record.

Now kill the record in the object index.

Stat data could be located in namespace table by using the very first record in object index table, which will be (F, 1) now. We still can initialize object index key with linkno=0 to find it and rely on database cursor which returns the first record in the table with the least linkno available.

We are done with unlink operation. Of course for cases when killing name that does not hold stat data, algorithm is much simpler. We just need to kill one record in name, find and update stat data record in namespace table (decremented nlink should be updated in the store), and kill one record in object index.

File attributes that are stored in separate tables may also be easily accessed using key constructed of F, where F is file fid.

Rationale:

Hard-links are rare, make common case fast by placing attributes in the file's directory entry, make readdir fast by moving other attributes out.

Corner cases:

Rename and unlink need to move file attributes from zero name.

Special case:

Using cob api for ioservice to create data objects is special case. The main difference is that, parent fid (in nskey) and child fid (in nsrec) are the same.

Cob iterator.

In order to iterate over all names that "dir" cob contains, cob iterator is used. It is simple cursor based API, that contains four methods:

‘cob’ and ‘name’ parameters, passed to m0_cob_iterator_init(), specify initial position of the iterator. Then iterator moves with m0_cob_iterator_next() method over namespace table until end of table is reached or a record with another parent fid is found.

Once iterator is not needed, it is finalized by m0_cob_iterator_fini().

See also
m0_mdstore_readdir() for example of using iterator.

Mkfs.

Cob cannot be used before m0_cob_domain_mkfs() is called. For details consult with m0_cob_domain_mkfs()

This function creates the following structures [records? objects?] in cob tables:

Mdstore based cobs cannot be used properly without mkfs done. All unit tests that access cob and also all modules using cobs should do m0_cob_domain_mkfs() on startup.

Macro Definition Documentation

◆ M0_COB_ALL

#define M0_COB_ALL
Value:

Definition at line 352 of file cob.h.

◆ MKFS_ROOT_BLKSIZE

#define MKFS_ROOT_BLKSIZE   4096

Definition at line 939 of file cob.c.

◆ MKFS_ROOT_BLOCKS

#define MKFS_ROOT_BLOCKS   16

Definition at line 940 of file cob.c.

◆ MKFS_ROOT_SIZE

#define MKFS_ROOT_SIZE   4096

Definition at line 938 of file cob.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_COB_NAME_MAX 
M0_COB_EA_MAX 

Definition at line 67 of file cob.c.

◆ anonymous enum

anonymous enum
Enumerator
M0_MDS_COB_ID_START 
M0_IOS_COB_ID_START 

Definition at line 228 of file cob.h.

◆ cob_table_kvtype

Enumerator
COB_KVTYPE_OMG 
COB_KVTYPE_FAB 
COB_KVTYPE_FEA 
COB_KVTYPE_NS 
COB_KVTYPE_OI 
COB_KVTYPE_BC 

Definition at line 2213 of file cob.c.

◆ cob_table_optype

Enumerator
COB_TABLE_DELETE 
COB_TABLE_UPDATE 
COB_TABLE_INSERT 

Definition at line 2207 of file cob.c.

◆ m0_cob_domain_format_version

Enumerator
M0_COB_DOMAIN_FORMAT_VERSION_1 
M0_COB_DOMAIN_FORMAT_VERSION 

Current version, should point to the latest version present

Definition at line 279 of file cob.h.

◆ m0_cob_flags

Cob flags and valid attributes.

Enumerator
M0_CA_NSKEY 

nskey in cob is up-to-date

M0_CA_NSKEY_FREE 

cob will dealloc the nskey

M0_CA_NSREC 

nsrec in cob is up-to-date

M0_CA_FABREC 

fabrec in cob is up-to-date

M0_CA_OMGREC 

omgrec in cob is up-to-date

M0_CA_LAYOUT 

layout in cob is up-to-date

M0_CA_BCREC 

bytecount in cob is up-to-date

Definition at line 645 of file cob.h.

◆ m0_cob_nsrec_format_version

Enumerator
M0_COB_NSREC_FORMAT_VERSION_1 
M0_COB_NSREC_FORMAT_VERSION 

Current version, should point to the latest version present

Definition at line 442 of file cob.h.

◆ m0_cob_op

enum m0_cob_op
Enumerator
M0_COB_OP_DOMAIN_MKFS 
M0_COB_OP_LOOKUP 
M0_COB_OP_LOCATE 
M0_COB_OP_CREATE 
M0_COB_OP_DELETE 
M0_COB_OP_TRUNCATE 
M0_COB_OP_DELETE_PUT 
M0_COB_OP_UPDATE 
M0_COB_OP_FEA_SET 
M0_COB_OP_FEA_DEL 
M0_COB_OP_NAME_ADD 
M0_COB_OP_NAME_DEL 
M0_COB_OP_NAME_UPDATE 
M0_COB_OP_BYTECOUNT_SET 
M0_COB_OP_BYTECOUNT_DEL 
M0_COB_OP_BYTECOUNT_UPDATE 

Definition at line 1068 of file cob.h.

◆ m0_cob_type

Enumerator
M0_COB_IO 
M0_COB_MD 

Definition at line 1124 of file cob.h.

◆ m0_cob_valid_flags

Flags for cob attributes.

Enumerator
M0_COB_ATIME 
M0_COB_MTIME 
M0_COB_CTIME 
M0_COB_SIZE 
M0_COB_MODE 
M0_COB_UID 
M0_COB_GID 
M0_COB_BLOCKS 
M0_COB_TYPE 
M0_COB_FLAGS 
M0_COB_NLINK 
M0_COB_RDEV 
M0_COB_BLKSIZE 
M0_COB_LID 
M0_COB_PVER 

Definition at line 334 of file cob.h.

Function Documentation

◆ bc_cmp()

static int bc_cmp ( const void *  key0,
const void *  key1 
)
static

Bytecount table comparator.

Definition at line 414 of file cob.c.

Here is the call graph for this function:

◆ bc_ksize()

static m0_bcount_t bc_ksize ( const void *  key)
static

Definition at line 371 of file cob.c.

◆ bc_vsize()

static m0_bcount_t bc_vsize ( const void *  val)
static

Definition at line 376 of file cob.c.

◆ cob0_fini()

static void cob0_fini ( struct m0_be_domain dom,
const char *  suffix,
const struct m0_buf data 
)
static

Definition at line 104 of file cob.c.

Here is the call graph for this function:

◆ cob0_init()

static int cob0_init ( struct m0_be_domain dom,
const char *  suffix,
const struct m0_buf data 
)
static

Definition at line 72 of file cob.c.

Here is the call graph for this function:

◆ cob_dom_id_make()

static M0_UNUSED char* cob_dom_id_make ( char *  buf,
const struct m0_cob_domain_id id,
const char *  prefix 
)
static

Definition at line 695 of file cob.c.

◆ cob_domain_id2str()

static void cob_domain_id2str ( char **  s,
const struct m0_cob_domain_id cdid 
)
static

Definition at line 737 of file cob.c.

Here is the caller graph for this function:

◆ cob_fab_lookup()

static int cob_fab_lookup ( struct m0_cob cob)
static

Search for a record in the fileattr_basic table.

See also
cob_ns_lookup
cob_oi_lookup

Definition at line 1292 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_fini()

static void cob_fini ( struct m0_cob cob)
static

Definition at line 1070 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_free_cb()

static void cob_free_cb ( struct m0_ref ref)
static

Return cob memory to the pool

Definition at line 1081 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_get_fabomg()

static int cob_get_fabomg ( struct m0_cob cob,
uint64_t  flags 
)
static

Load fab and omg records according with flags.

Definition at line 1350 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_ns_lookup()

static int cob_ns_lookup ( struct m0_cob cob)
static

Search for a record in the namespace table

If the lookup fails, we return error and co_flags accurately reflects the missing fields.

See also
cob_oi_lookup

Definition at line 1191 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_oi_lookup()

static int cob_oi_lookup ( struct m0_cob cob)
static

Search for a record in the object index table. Most likely we want stat data for a given fid, so let's do that as well.

See also
cob_ns_lookup

Definition at line 1219 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_omg_lookup()

static int cob_omg_lookup ( struct m0_cob cob)
static

Search for a record in the fileattr_omg table.

See also
cob_fab_lookup

Definition at line 1323 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_table_delete()

static int cob_table_delete ( struct m0_be_btree tree,
struct m0_be_tx tx,
struct m0_buf key 
)
static

Definition at line 942 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_table_insert()

static int cob_table_insert ( struct m0_be_btree tree,
struct m0_be_tx tx,
struct m0_buf key,
struct m0_buf val 
)
static

Definition at line 958 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_table_lookup()

static int cob_table_lookup ( struct m0_be_btree tree,
struct m0_buf key,
struct m0_buf out 
)
static

Definition at line 966 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cob_table_tx_credit()

static void cob_table_tx_credit ( struct m0_be_btree tree,
enum cob_table_optype  t_optype,
enum cob_table_kvtype  t_kvtype,
struct m0_be_tx_credit accum 
)
static

Definition at line 2222 of file cob.c.

Here is the call graph for this function:

◆ cob_table_update()

static int cob_table_update ( struct m0_be_btree tree,
struct m0_be_tx tx,
struct m0_buf key,
struct m0_buf val 
)
static

Definition at line 950 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ea_cmp()

static int ea_cmp ( const void *  key0,
const void *  key1 
)
static

Extended attributes table definition

Definition at line 646 of file cob.c.

Here is the call graph for this function:

◆ ea_ksize()

static m0_bcount_t ea_ksize ( const void *  key)
static

Definition at line 651 of file cob.c.

Here is the call graph for this function:

◆ ea_vsize()

static m0_bcount_t ea_vsize ( const void *  val)
static

Definition at line 656 of file cob.c.

Here is the call graph for this function:

◆ fb_cmp()

static int fb_cmp ( const void *  key0,
const void *  key1 
)
static

File attributes table definition

Definition at line 615 of file cob.c.

Here is the call graph for this function:

◆ fb_ksize()

static m0_bcount_t fb_ksize ( const void *  key)
static

Definition at line 626 of file cob.c.

◆ fb_vsize()

static m0_bcount_t fb_vsize ( const void *  val)
static

Definition at line 631 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_alloc()

M0_INTERNAL int m0_cob_alloc ( struct m0_cob_domain dom,
struct m0_cob **  out 
)

Allocate a new cob on passed .

Definition at line 1100 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_alloc_omgid()

M0_INTERNAL int m0_cob_alloc_omgid ( struct m0_cob_domain dom,
uint64_t *  omgid 
)

Try to allocate new omgid using omg table and terminator record. Save allocated id in if not NULL.

Definition at line 1634 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_entries_dump()

M0_INTERNAL int m0_cob_bc_entries_dump ( struct m0_cob_domain cdom,
struct m0_buf **  out_keys,
struct m0_buf **  out_recs,
uint32_t *  out_count 
)

Returns all the entries in the bytecount btree in the form of Key and record buffers. This function uses bytecount iterator internally to traverse the btree.

Key buffer contains all the keys in a contigious sequence of memory pointed by out_keys::b_addr. An individual key can be accessed by traversing the memory in chunks of sizeof(struct m0_cob_bckey).

Similar logic applies to record buffer.

Precondition
out_keys == NULL
out_recs == NULL
Parameters
cdomcob domain where the bytecount btree resides.
out_keysout parameter buffer which gets populated by keys.
out_recsout parameter buffer which gets populated by records.
out_countout parameter with number of entries in the btree.
Return values
0Success.
-errnoOther error.

TODO: Iterate over the btree only once, store the key-vals in a list while iterating over the btree the 1st time.

Definition at line 496 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_insert()

M0_INTERNAL int m0_cob_bc_insert ( struct m0_cob cob,
struct m0_cob_bckey bc_key,
struct m0_cob_bcrec bc_val,
struct m0_be_tx tx 
)

Inserts a record in the bytecount table If the insert fails, we return error.

Parameters
cobcob btree to store byte count.
bc_keypool version fid and user_id.
bc_recbyte count for the given pool version.
txbe transaction handle.
Return values
0success
-errnoother error.

Definition at line 1140 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_iterator_fini()

M0_INTERNAL void m0_cob_bc_iterator_fini ( struct m0_cob_bc_iterator it)

Finish cob bc iterator.

Definition at line 489 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_iterator_get()

M0_INTERNAL int m0_cob_bc_iterator_get ( struct m0_cob_bc_iterator it)

Retrieve the key values from the current position in table according with properties and stores it in the iterator structure.

Return values
0Success.
-ENOENTSpecified position not found in table.
-errnoOther error.

Definition at line 443 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_iterator_init()

M0_INTERNAL int m0_cob_bc_iterator_init ( struct m0_cob cob,
struct m0_cob_bc_iterator it,
const struct m0_fid pver_fid,
uint64_t  user_id 
)

Initialize iterator on the byte count btree with , as the start position.

Parameters
cobbtree to iterate over.
ititerator.
pver_fidpool version fid, start position of the iterator.
user_idid of user, start position of the iterator.
Return values
-ENOMEMout of memory.
-errnoother error.

Definition at line 420 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_iterator_next()

M0_INTERNAL int m0_cob_bc_iterator_next ( struct m0_cob_bc_iterator it)

Position to next key in a bc table.

Return values
0Success.
-ENOENTNo more keys in byte count table.
-errnoOther error.

Definition at line 467 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_lookup()

M0_INTERNAL int m0_cob_bc_lookup ( struct m0_cob cob,
struct m0_cob_bckey bc_key,
struct m0_cob_bcrec bc_rec 
)

Search for a record in the bytecount table and fills struct m0_cob_bcrec if key is found. If the lookup fails, we return error and co_flags accurately reflects the missing fields.

Parameters
cobcob btree to store byte count.
bc_keypool version fid and user_id.
bc_recout paramter, byte count for the given pool version.
Return values
0success
-ENOENTrecord not found.
-errnoother error.

Definition at line 1120 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bc_update()

M0_INTERNAL int m0_cob_bc_update ( struct m0_cob cob,
struct m0_cob_bckey bc_key,
struct m0_cob_bcrec bc_val,
struct m0_be_tx tx 
)

Updates a record in the bytecount table If the update fails, it returns error.

Parameters
cobcob btree to store byte count.
bc_keypool version fid and user_id.
bc_recbyte count for the given pool version.
txbe transaction handle.
Return values
0success
-errnoother error.

Definition at line 1161 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bckey_cmp()

M0_INTERNAL int m0_cob_bckey_cmp ( const struct m0_cob_bckey k0,
const struct m0_cob_bckey k1 
)

Definition at line 399 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bckey_make()

static int m0_cob_bckey_make ( struct m0_cob_bckey **  keyh,
const struct m0_fid pver_fid,
uint64_t  user_id 
)
static

Make bytecount key for iterator. Allocate space for key.

Definition at line 384 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_bckey_size()

static size_t m0_cob_bckey_size ( void  )
static

Returns struct m0_cob_bckey size.

Definition at line 358 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_bcrec_size()

static size_t m0_cob_bcrec_size ( void  )
static

Returns struct m0_cob_bcrec size.

Definition at line 366 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_create()

M0_INTERNAL int m0_cob_create ( struct m0_cob cob,
struct m0_cob_nskey nskey,
struct m0_cob_nsrec nsrec,
struct m0_cob_fabrec fabrec,
struct m0_cob_omgrec omgrec,
struct m0_be_tx tx 
)

Add a cob to the namespace.

This doesn't create a new storage object; just creates metadata table entries for it to enable namespace and oi lookup.

Parameters
cobcob instance allocated with m0_cob_alloc()
nskeynamespace key made with m0_cob_nskey_make()
nsrecnamespace record with all attributes set
fabrecbasic attributes record
omgrecowner/mode/group record
txtransaction handle

Definition at line 1681 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_delete()

M0_INTERNAL int m0_cob_delete ( struct m0_cob cob,
struct m0_be_tx tx 
)

Delete name with stat data, entry in object index and all file attributes from fab, omg, etc., tables.

Parameters
cobthis cob will be deleted
txdb transaction to use

Note, that m0_cob_delete() does not decrement cob's reference counter. Use m0_cob_delete_put() to have the counter decremented.

See also
m0_cob_delete_put()

Definition at line 1789 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_delete_put()

M0_INTERNAL int m0_cob_delete_put ( struct m0_cob cob,
struct m0_be_tx tx 
)

Deletes and puts cob.

See also
m0_cob_delete(), m0_cob_put()

Definition at line 1853 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_domain_create()

int m0_cob_domain_create ( struct m0_cob_domain **  dom,
struct m0_sm_group grp,
const struct m0_cob_domain_id cdid,
struct m0_be_domain bedom,
struct m0_be_seg seg 
)

Creates and initialises COB domain.

Definition at line 840 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_domain_create_prepared()

M0_INTERNAL int m0_cob_domain_create_prepared ( struct m0_cob_domain **  out,
struct m0_sm_group grp,
const struct m0_cob_domain_id cdid,
struct m0_be_domain bedom,
struct m0_be_seg seg,
struct m0_be_tx tx 
)

Definition at line 763 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_domain_credit_add()

M0_INTERNAL int m0_cob_domain_credit_add ( struct m0_cob_domain dom,
struct m0_be_domain bedom,
struct m0_be_seg seg,
const struct m0_cob_domain_id cdid,
struct m0_be_tx_credit cred 
)

Definition at line 742 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_domain_destroy()

int m0_cob_domain_destroy ( struct m0_cob_domain dom,
struct m0_sm_group grp,
struct m0_be_domain bedom 
)

Finalises and destroys COB domain. The dom's memory is released here and must not be accessed after this.

Definition at line 871 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_domain_fini()

void m0_cob_domain_fini ( struct m0_cob_domain dom)

Definition at line 726 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_domain_init()

int m0_cob_domain_init ( struct m0_cob_domain dom,
struct m0_be_seg seg 
)

Set up a new cob domain

Tables are identified by the domain id, which must be set before calling this function.

Definition at line 708 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_domain_mkfs()

M0_INTERNAL int m0_cob_domain_mkfs ( struct m0_cob_domain dom,
const struct m0_fid rootfid,
struct m0_be_tx tx 
)

Create initial files system structures, such as: entire storage root, root cob for sessions and root cob for hierarchy. Latter is only one of them visible to user on client.

Prepare storage before using. Create root cob for session objects and root for files hierarchy.

Create terminator omgid record with id == ~0ULL.

Create root cob where all namespace is stored.

Definition at line 980 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_ea_del()

M0_INTERNAL int m0_cob_ea_del ( struct m0_cob cob,
struct m0_cob_eakey eakey,
struct m0_be_tx tx 
)

Del a record in the extended attributes table

Definition at line 2193 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_ea_del_credit()

M0_INTERNAL void m0_cob_ea_del_credit ( struct m0_cob cob,
struct m0_cob_eakey eakey,
struct m0_be_tx_credit accum 
)

XXX not yet implemented

Definition at line 2372 of file cob.c.

◆ m0_cob_ea_get()

M0_INTERNAL int m0_cob_ea_get ( struct m0_cob cob,
struct m0_cob_eakey eakey,
struct m0_cob_earec out,
struct m0_be_tx tx 
)

Search for a record to the extended attributes table

Definition at line 2155 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_ea_get_credit()

M0_INTERNAL void m0_cob_ea_get_credit ( struct m0_cob cob,
struct m0_cob_eakey eakey,
struct m0_cob_earec out,
struct m0_be_tx_credit accum 
)

XXX not yet implemented

Definition at line 2356 of file cob.c.

◆ m0_cob_ea_iterator_fini()

M0_INTERNAL void m0_cob_ea_iterator_fini ( struct m0_cob_ea_iterator it)

Finish cob ea iterator.

Definition at line 1620 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_ea_iterator_get()

M0_INTERNAL int m0_cob_ea_iterator_get ( struct m0_cob_ea_iterator it)

Position in table according with properties.

Return values
0Success.
-ENOENTSpecified position not found in table.
-errnoOther error.

Check if we are stil inside the object bounds. Assert and key copy can be done only in this case.

Definition at line 1565 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_ea_iterator_init()

M0_INTERNAL int m0_cob_ea_iterator_init ( struct m0_cob cob,
struct m0_cob_ea_iterator it,
struct m0_bitstring name 
)

Definition at line 1539 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_ea_iterator_init_credit()

M0_INTERNAL void m0_cob_ea_iterator_init_credit ( struct m0_cob cob,
struct m0_cob_ea_iterator it,
struct m0_bitstring name,
struct m0_be_tx_credit accum 
)

XXX not yet implemented

Definition at line 2379 of file cob.c.

◆ m0_cob_ea_iterator_next()

M0_INTERNAL int m0_cob_ea_iterator_next ( struct m0_cob_ea_iterator it)

Position to next name in a ea table.

Return values
0Success.
-ENOENTNext name is not found in ea table.
-errnoOther error.

Check if we are stil inside the object bounds. Assert and key copy can be done only in this case.

Definition at line 1593 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_ea_set()

M0_INTERNAL int m0_cob_ea_set ( struct m0_cob cob,
struct m0_cob_eakey eakey,
struct m0_cob_earec earec,
struct m0_be_tx tx 
)

Add a record to the extended attributes table. If key already exists then kill the old record.

Definition at line 2171 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_ea_set_credit()

M0_INTERNAL void m0_cob_ea_set_credit ( struct m0_cob cob,
struct m0_cob_eakey eakey,
struct m0_cob_earec earec,
struct m0_be_tx_credit accum 
)

XXX not yet implemented

Definition at line 2364 of file cob.c.

◆ m0_cob_eakey_cmp()

M0_INTERNAL int m0_cob_eakey_cmp ( const struct m0_cob_eakey k0,
const struct m0_cob_eakey k1 
)

Definition at line 215 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_eakey_make()

M0_INTERNAL int m0_cob_eakey_make ( struct m0_cob_eakey **  keyh,
const struct m0_fid fid,
const char *  name,
size_t  namelen 
)

Create ea table key from passed file fid and ea name.

Definition at line 181 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_eakey_size()

M0_INTERNAL size_t m0_cob_eakey_size ( const struct m0_cob_eakey cek)

Definition at line 227 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_earec_size()

static size_t m0_cob_earec_size ( const struct m0_cob_earec rec)
static

Definition at line 233 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_fabrec_make()

M0_INTERNAL int m0_cob_fabrec_make ( struct m0_cob_fabrec **  rech,
const char *  link,
size_t  linklen 
)

Allocate fabrec record according with and setup record fields.

Definition at line 262 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_fabrec_size()

static size_t m0_cob_fabrec_size ( const struct m0_cob_fabrec rec)
static

Fabrec size taking into account symlink length.

Definition at line 257 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_fid()

M0_INTERNAL const struct m0_fid * m0_cob_fid ( const struct m0_cob cob)

Definition at line 122 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_get()

M0_INTERNAL void m0_cob_get ( struct m0_cob obj)

Acquires an additional reference on the object.

See also
m0_cob_put()

Definition at line 1090 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_init()

M0_INTERNAL void m0_cob_init ( struct m0_cob_domain dom,
struct m0_cob cob 
)

Initialises cob instance with cob domain.

Parameters
domios/mds cob domain.
cobcob instance.
Todo:
Get di type from configuration.

Definition at line 1057 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_is_valid()

static bool m0_cob_is_valid ( struct m0_cob cob)
static

For assertions only.

Definition at line 1629 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_iterator_fini()

M0_INTERNAL void m0_cob_iterator_fini ( struct m0_cob_iterator it)

Finish cob iterator.

Definition at line 1477 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_iterator_get()

M0_INTERNAL int m0_cob_iterator_get ( struct m0_cob_iterator it)

Position in table according with properties.

Return values
0Success.
-ENOENTSpecified position not found in table.
-errnoOther error.

Check if we are stil inside the object bounds. Assert and key copy can be done only in this case.

Definition at line 1483 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_iterator_init()

M0_INTERNAL int m0_cob_iterator_init ( struct m0_cob cob,
struct m0_cob_iterator it,
struct m0_bitstring name 
)

Definition at line 1457 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_iterator_next()

M0_INTERNAL int m0_cob_iterator_next ( struct m0_cob_iterator it)

Position to next name in a dir cob.

Return values
0Success.
-ENOENTNext name not found in directory.
-errnoOther error.

Check if we are stil inside the object bounds. Assert and key copy can be done only in this case.

Definition at line 1512 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_locate()

M0_INTERNAL int m0_cob_locate ( struct m0_cob_domain dom,
struct m0_cob_oikey oikey,
uint64_t  flags,
struct m0_cob **  out 
)

Locate cob by object index key.

Create a new cob and populate it with the contents of the a record; i.e. the filename. This also lookups for all attributes, that is, fab, omg, etc., according to flags.

Parameters
domcob domain to use
oikeyoikey (fid) to lookup
flagsflags specifying what parts of cob to populate
outresulting cob is store here
txdb transaction to be used
See also
m0_cob_lookup

Definition at line 1407 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_lookup()

M0_INTERNAL int m0_cob_lookup ( struct m0_cob_domain dom,
struct m0_cob_nskey nskey,
uint64_t  flags,
struct m0_cob **  out 
)

Lookup a filename in the namespace table.

Allocate a new cob and populate it with the contents of the namespace record; i.e. the stat data and fid. This function also looks up fab and omg tables, depending on "need" flag.

Parameters
domcob domain to use
nskeyname to lookup
flagsflags specifying what parts of cob to populate
outresulting cob is store here
txdb transaction to be used
See also
m0_cob_locate

Definition at line 1371 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_max_eakey_make()

static int m0_cob_max_eakey_make ( struct m0_cob_eakey **  keyh,
const struct m0_fid fid,
const char *  name,
int  namelen 
)
static

Make eakey for iterator. Allocate space for maximal possible name.

Definition at line 199 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_max_eakey_size()

static size_t m0_cob_max_eakey_size ( void  )
static

Maximal possible eakey size.

Definition at line 249 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_max_earec_size()

M0_INTERNAL size_t m0_cob_max_earec_size ( void  )

Maximal possible earec size.

Max possible size of earec.

Definition at line 241 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_max_fabrec_make()

static int m0_cob_max_fabrec_make ( struct m0_cob_fabrec **  rech)
static

Allocate memory for maximal possible size of fabrec.

Definition at line 288 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_max_fabrec_size()

static size_t m0_cob_max_fabrec_size ( void  )
static

Maximal possible fabrec size.

Definition at line 280 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_max_nskey_make()

static int m0_cob_max_nskey_make ( struct m0_cob_nskey **  keyh,
const struct m0_fid pfid,
const char *  name,
int  namelen 
)
static

Make nskey for iterator. Allocate space for maximal possible name.

Definition at line 303 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_max_nskey_size()

static size_t m0_cob_max_nskey_size ( void  )
static

Key size for iterator in which case we don't know exact length of key and want to allocate it for worst case scenario, that is, for max possible name len.

Definition at line 324 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_mod_fini()

M0_INTERNAL void m0_cob_mod_fini ( void  )

Module finalizer.

Definition at line 135 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_mod_init()

M0_INTERNAL int m0_cob_mod_init ( void  )

Module initializer.

Definition at line 129 of file cob.c.

Here is the call graph for this function:

◆ m0_cob_name_add()

M0_INTERNAL int m0_cob_name_add ( struct m0_cob cob,
struct m0_cob_nskey nskey,
struct m0_cob_nsrec nsrec,
struct m0_be_tx tx 
)

Add name to namespace and object index.

Parameters
cobstat data (zero name) cob;
nskeynew name to add to the file;
nsrecnsrec that will be added;
txtransaction handle.

Definition at line 1924 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_name_del()

M0_INTERNAL int m0_cob_name_del ( struct m0_cob cob,
struct m0_cob_nskey nskey,
struct m0_be_tx tx 
)

Delete name from namespace and object index.

Parameters
cobstat data (zero name) cob;
nskeyname to kill (may be the name of statdata);
txtransaction handle.

Definition at line 1966 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_name_update()

M0_INTERNAL int m0_cob_name_update ( struct m0_cob cob,
struct m0_cob_nskey srckey,
struct m0_cob_nskey tgtkey,
struct m0_be_tx tx 
)

Rename old record with new record.

Parameters
cobstat data (zero name) cob;
srckeysource name;
tgtkeytarget name;
txtransaction handle

Definition at line 2004 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_nskey_cmp()

M0_INTERNAL int m0_cob_nskey_cmp ( const struct m0_cob_nskey k0,
const struct m0_cob_nskey k1 
)

Compare two keys. Return: k0 > k1: +1, k0 < k1: -1, 0 - otherwise.

Definition at line 163 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_nskey_make()

M0_INTERNAL int m0_cob_nskey_make ( struct m0_cob_nskey **  keyh,
const struct m0_fid pfid,
const char *  name,
size_t  namelen 
)

Create namespace table key for ns table manipulation. It contains parent fid and child name.

Definition at line 148 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_nskey_size()

M0_INTERNAL size_t m0_cob_nskey_size ( const struct m0_cob_nskey cnk)

Definition at line 175 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_nsrec_init()

M0_INTERNAL void m0_cob_nsrec_init ( struct m0_cob_nsrec nsrec)

Definition at line 2058 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_oikey_make()

M0_INTERNAL void m0_cob_oikey_make ( struct m0_cob_oikey oikey,
const struct m0_fid fid,
int  linkno 
)

Create object index key that is used for operations on object index table. It consists of object fid an linkno depending on what record we want to find.

Definition at line 141 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_put()

M0_INTERNAL void m0_cob_put ( struct m0_cob obj)

Releases a reference on the object.

When the last reference is released, the object can either return to the cache or can be immediately destroyed.

See also
m0_cob_get(), m0_cob_delete_put()

Definition at line 1095 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_setattr()

M0_INTERNAL int m0_cob_setattr ( struct m0_cob cob,
struct m0_cob_attr attr,
struct m0_be_tx tx 
)

Sets cob attributes to those present in attr.

Parameters
cobcob for which attributes will be changed
attrattributes to be loaded into a cob
txbe transaction to be used

Definition at line 2068 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_size_update()

M0_INTERNAL int m0_cob_size_update ( struct m0_cob cob,
uint64_t  size,
struct m0_be_tx tx 
)

Definition at line 2144 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cob_tx_credit()

M0_INTERNAL void m0_cob_tx_credit ( struct m0_cob_domain dom,
enum m0_cob_op  optype,
struct m0_be_tx_credit accum 
)

Definition at line 2281 of file cob.c.

Here is the caller graph for this function:

◆ m0_cob_update()

M0_INTERNAL int m0_cob_update ( struct m0_cob cob,
struct m0_cob_nsrec nsrec,
struct m0_cob_fabrec fabrec,
struct m0_cob_omgrec omgrec,
struct m0_be_tx tx 
)

Update file attributes of passed cob with , and fields.

Parameters
cobcob store updates to
nsrecnew nsrec to store to cob
fabrecfab record to store or null
omgrecomg record to store or null
txdb transaction to be used

Definition at line 1860 of file cob.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ M0_XCA_DOMAIN()

struct m0_cob_domain_id M0_XCA_DOMAIN ( be  )

◆ ns_cmp()

static int ns_cmp ( const void *  key0,
const void *  key1 
)
static

Namespace table definition.

Definition at line 332 of file cob.c.

Here is the call graph for this function:

◆ ns_ksize()

static m0_bcount_t ns_ksize ( const void *  key)
static

Definition at line 338 of file cob.c.

Here is the call graph for this function:

◆ ns_vsize()

static m0_bcount_t ns_vsize ( const void *  val)
static

Definition at line 343 of file cob.c.

◆ oi_cmp()

static int oi_cmp ( const void *  key0,
const void *  key1 
)
static

Object index table definition.

Definition at line 587 of file cob.c.

Here is the call graph for this function:

◆ oi_ksize()

static m0_bcount_t oi_ksize ( const void *  key)
static

Definition at line 600 of file cob.c.

◆ omg_cmp()

static int omg_cmp ( const void *  key0,
const void *  key1 
)
static

Omg table definition.

Definition at line 671 of file cob.c.

◆ omg_ksize()

static m0_bcount_t omg_ksize ( const void *  key)
static

Definition at line 678 of file cob.c.

◆ omg_vsize()

static m0_bcount_t omg_vsize ( const void *  val)
static

Definition at line 683 of file cob.c.

Variable Documentation

◆ ca_atime

uint64_t ca_atime

time of last access.

Definition at line 371 of file cob.h.

◆ ca_blksize

uint64_t ca_blksize

blocksize for filesystem I/O.

Definition at line 377 of file cob.h.

◆ ca_blocks

uint64_t ca_blocks

number of blocks allocated.

Definition at line 378 of file cob.h.

◆ ca_ctime

uint64_t ca_ctime

time of last status change.

Definition at line 373 of file cob.h.

◆ ca_eakey

struct m0_buf ca_eakey

xattr name

Definition at line 383 of file cob.h.

◆ ca_eaval

struct m0_buf ca_eaval

xattr value

Definition at line 384 of file cob.h.

◆ ca_gid

uint32_t ca_gid

group ID of owner.

Definition at line 370 of file cob.h.

◆ ca_lid

uint64_t ca_lid

layout id

Definition at line 380 of file cob.h.

◆ ca_link

struct m0_buf ca_link

symlink body

Definition at line 382 of file cob.h.

◆ ca_mode

uint32_t ca_mode

protection.

Definition at line 368 of file cob.h.

◆ ca_mtime

uint64_t ca_mtime

time of last modification.

Definition at line 372 of file cob.h.

◆ ca_name

struct m0_buf ca_name

object name

Definition at line 381 of file cob.h.

◆ ca_nlink

uint32_t ca_nlink

number of hard links.

Definition at line 375 of file cob.h.

◆ ca_pfid

struct m0_fid ca_pfid

parent fid

Definition at line 364 of file cob.h.

◆ ca_pver

struct m0_fid ca_pver

cob pool version

Definition at line 366 of file cob.h.

◆ ca_rdev

uint64_t ca_rdev

devid for special devices

Definition at line 374 of file cob.h.

◆ ca_size

uint64_t ca_size

total size, in bytes.

Definition at line 376 of file cob.h.

◆ ca_tfid

struct m0_fid ca_tfid

object fid

Definition at line 365 of file cob.h.

◆ ca_uid

uint32_t ca_uid

user ID of owner.

Definition at line 369 of file cob.h.

◆ ca_valid

uint32_t ca_valid

valid bits (enum m0_cob_valid_flags)

Definition at line 367 of file cob.h.

◆ ca_version

uint64_t ca_version

object version

Definition at line 379 of file cob.h.

◆ cbk_pfid [1/2]

struct m0_fid cbk_pfid

Pool ver fid

Definition at line 516 of file cob.h.

◆ cbk_pfid [2/2]

struct m0_fid cbk_pfid

Pool ver fid

Definition at line 454 of file cob.h.

◆ cbk_user_id [1/2]

uint64_t cbk_user_id

User id

Definition at line 455 of file cob.h.

◆ cbk_user_id [2/2]

uint64_t cbk_user_id

User id

Definition at line 517 of file cob.h.

◆ cbr_bytecount [1/2]

uint64_t cbr_bytecount

Byte count

Definition at line 454 of file cob.h.

◆ cbr_bytecount [2/2]

uint64_t cbr_bytecount

Byte count

Definition at line 522 of file cob.h.

◆ cbr_cob_objects [1/2]

uint64_t cbr_cob_objects

Cob object count

Definition at line 455 of file cob.h.

◆ cbr_cob_objects [2/2]

uint64_t cbr_cob_objects

Cob object count

Definition at line 523 of file cob.h.

◆ cd_bytecount [1/2]

struct m0_be_btree cd_bytecount

Definition at line 275 of file cob.h.

◆ cd_bytecount [2/2]

struct m0_be_btree cd_bytecount

Definition at line 2392 of file cob.h.

◆ cd_fileattr_basic [1/2]

struct m0_be_btree cd_fileattr_basic

Definition at line 272 of file cob.h.

◆ cd_fileattr_basic [2/2]

struct m0_be_btree cd_fileattr_basic

Definition at line 2389 of file cob.h.

◆ cd_fileattr_ea [1/2]

struct m0_be_btree cd_fileattr_ea

Definition at line 274 of file cob.h.

◆ cd_fileattr_ea [2/2]

struct m0_be_btree cd_fileattr_ea

Definition at line 2391 of file cob.h.

◆ cd_fileattr_omg [1/2]

struct m0_be_btree cd_fileattr_omg

Definition at line 273 of file cob.h.

◆ cd_fileattr_omg [2/2]

struct m0_be_btree cd_fileattr_omg

Definition at line 2390 of file cob.h.

◆ cd_footer [1/2]

struct m0_format_footer cd_footer

Definition at line 265 of file cob.h.

◆ cd_footer [2/2]

struct m0_format_footer cd_footer

Definition at line 2382 of file cob.h.

◆ cd_header [1/2]

struct m0_format_header cd_header

Definition at line 2380 of file cob.h.

◆ cd_header [2/2]

struct m0_format_header cd_header

Definition at line 263 of file cob.h.

◆ cd_id [1/2]

struct m0_cob_domain_id cd_id

Definition at line 2381 of file cob.h.

◆ cd_id [2/2]

struct m0_cob_domain_id cd_id

Definition at line 264 of file cob.h.

◆ cd_lock [1/2]

struct m0_be_rwlock cd_lock

Definition at line 276 of file cob.h.

◆ cd_lock [2/2]

struct m0_be_rwlock cd_lock

Definition at line 2393 of file cob.h.

◆ cd_namespace [1/2]

struct m0_be_btree cd_namespace

Definition at line 2388 of file cob.h.

◆ cd_namespace [2/2]

struct m0_be_btree cd_namespace

Definition at line 271 of file cob.h.

◆ cd_object_index [1/2]

struct m0_be_btree cd_object_index

Definition at line 2387 of file cob.h.

◆ cd_object_index [2/2]

struct m0_be_btree cd_object_index

Definition at line 270 of file cob.h.

◆ cek_fid [1/2]

struct m0_fid cek_fid

EA owner fid

Definition at line 504 of file cob.h.

◆ cek_fid [2/2]

struct m0_fid cek_fid

EA owner fid

Definition at line 454 of file cob.h.

◆ cek_name [1/2]

struct m0_bitstring cek_name

EA name

Definition at line 505 of file cob.h.

◆ cek_name [2/2]

struct m0_bitstring cek_name

EA name

Definition at line 455 of file cob.h.

◆ cer_body [1/2]

char cer_body[0]

EA body

Definition at line 455 of file cob.h.

◆ cer_body [2/2]

char cer_body[0]

EA body

Definition at line 511 of file cob.h.

◆ cer_size [1/2]

uint32_t cer_size

EA len

Definition at line 454 of file cob.h.

◆ cer_size [2/2]

uint32_t cer_size

EA len

Definition at line 510 of file cob.h.

◆ cfb_fid [1/2]

struct m0_fid cfb_fid

Definition at line 474 of file cob.h.

◆ cfb_fid [2/2]

struct m0_fid cfb_fid

Definition at line 454 of file cob.h.

◆ cfb_layoutid [1/2]

uint64_t cfb_layoutid

reference to layout

Definition at line 456 of file cob.h.

◆ cfb_layoutid [2/2]

uint64_t cfb_layoutid

reference to layout

Definition at line 480 of file cob.h.

◆ cfb_link [1/2]

char cfb_link[0]

symlink body

Definition at line 458 of file cob.h.

◆ cfb_link [2/2]

char cfb_link[0]

symlink body

Definition at line 482 of file cob.h.

◆ cfb_linklen [1/2]

uint32_t cfb_linklen

symlink len if any

Definition at line 457 of file cob.h.

◆ cfb_linklen [2/2]

uint32_t cfb_linklen

symlink len if any

Definition at line 481 of file cob.h.

◆ cfb_pver [1/2]

struct m0_fid cfb_pver

pool version fid

Definition at line 478 of file cob.h.

◆ cfb_pver [2/2]

struct m0_fid cfb_pver

pool version fid

Definition at line 454 of file cob.h.

◆ cfb_version [1/2]

uint64_t cfb_version

version from last fop

Definition at line 455 of file cob.h.

◆ cfb_version [2/2]

uint64_t cfb_version

version from last fop

Definition at line 479 of file cob.h.

◆ ci_cob [1/3]

struct m0_cob* ci_cob

the cob we iterate

Definition at line 617 of file cob.h.

◆ ci_cob [2/3]

struct m0_cob* ci_cob

the cob we iterate

Definition at line 626 of file cob.h.

◆ ci_cob [3/3]

struct m0_cob* ci_cob

the cob we iterate

Definition at line 636 of file cob.h.

◆ ci_cursor [1/3]

struct m0_be_btree_cursor ci_cursor

cob iterator cursor

Definition at line 618 of file cob.h.

◆ ci_cursor [2/3]

struct m0_be_btree_cursor ci_cursor

cob iterator cursor

Definition at line 627 of file cob.h.

◆ ci_cursor [3/3]

struct m0_be_btree_cursor ci_cursor

cob iterator cursor

Definition at line 637 of file cob.h.

◆ ci_key [1/3]

struct m0_cob_nskey* ci_key

current iterator pos

Definition at line 619 of file cob.h.

◆ ci_key [2/3]

struct m0_cob_eakey* ci_key

current iterator pos

Definition at line 628 of file cob.h.

◆ ci_key [3/3]

struct m0_cob_bckey* ci_key

current iterator pos

Definition at line 638 of file cob.h.

◆ ci_rec [1/2]

struct m0_cob_earec* ci_rec

current iterator rec

Definition at line 629 of file cob.h.

◆ ci_rec [2/2]

struct m0_cob_bcrec* ci_rec

current iterator rec

Definition at line 639 of file cob.h.

◆ cnk_name [1/2]

struct m0_bitstring cnk_name

Definition at line 392 of file cob.h.

◆ cnk_name [2/2]

struct m0_bitstring cnk_name

Definition at line 329 of file cob.h.

◆ cnk_pfid [1/2]

struct m0_fid cnk_pfid

Definition at line 391 of file cob.h.

◆ cnk_pfid [2/2]

struct m0_fid cnk_pfid

Definition at line 328 of file cob.h.

◆ cnr_atime [1/2]

uint64_t cnr_atime

time of last access

Definition at line 426 of file cob.h.

◆ cnr_atime [2/2]

uint64_t cnr_atime

time of last access

Definition at line 434 of file cob.h.

◆ cnr_blksize [1/2]

uint64_t cnr_blksize

blocksize for filesystem I/O

Definition at line 424 of file cob.h.

◆ cnr_blksize [2/2]

uint64_t cnr_blksize

blocksize for filesystem I/O

Definition at line 432 of file cob.h.

◆ cnr_blocks [1/2]

uint64_t cnr_blocks

number of blocks allocated

Definition at line 425 of file cob.h.

◆ cnr_blocks [2/2]

uint64_t cnr_blocks

number of blocks allocated

Definition at line 433 of file cob.h.

◆ cnr_bytecount [1/2]

uint64_t cnr_bytecount

bytecount in this cob

Definition at line 423 of file cob.h.

◆ cnr_bytecount [2/2]

uint64_t cnr_bytecount

bytecount in this cob

Definition at line 431 of file cob.h.

◆ cnr_cntr [1/2]

uint32_t cnr_cntr

linkno allocation counter

Definition at line 419 of file cob.h.

◆ cnr_cntr [2/2]

uint32_t cnr_cntr

linkno allocation counter

Definition at line 427 of file cob.h.

◆ cnr_ctime [1/2]

uint64_t cnr_ctime

time of last status change

Definition at line 428 of file cob.h.

◆ cnr_ctime [2/2]

uint64_t cnr_ctime

time of last status change

Definition at line 436 of file cob.h.

◆ cnr_fid [1/2]

struct m0_fid cnr_fid

object fid

Definition at line 419 of file cob.h.

◆ cnr_fid [2/2]

struct m0_fid cnr_fid

object fid

Definition at line 411 of file cob.h.

◆ cnr_footer [1/2]

struct m0_format_footer cnr_footer

Definition at line 431 of file cob.h.

◆ cnr_footer [2/2]

struct m0_format_footer cnr_footer

Definition at line 439 of file cob.h.

◆ cnr_header [1/2]

struct m0_format_header cnr_header

Definition at line 418 of file cob.h.

◆ cnr_header [2/2]

struct m0_format_header cnr_header

Definition at line 410 of file cob.h.

◆ cnr_lid [1/2]

uint64_t cnr_lid

layout id

Definition at line 429 of file cob.h.

◆ cnr_lid [2/2]

uint64_t cnr_lid

layout id

Definition at line 437 of file cob.h.

◆ cnr_linkno [1/2]

uint32_t cnr_linkno

number of link for the name

Definition at line 412 of file cob.h.

◆ cnr_linkno [2/2]

uint32_t cnr_linkno

number of link for the name

Definition at line 420 of file cob.h.

◆ cnr_mtime [1/2]

uint64_t cnr_mtime

time of last modification

Definition at line 427 of file cob.h.

◆ cnr_mtime [2/2]

uint64_t cnr_mtime

time of last modification

Definition at line 435 of file cob.h.

◆ cnr_nlink [1/2]

uint32_t cnr_nlink

The following fields are only important for 0-nsrec, that is, stat data. For other records, only two fields above are valid.number of hard links

Definition at line 418 of file cob.h.

◆ cnr_nlink [2/2]

uint32_t cnr_nlink

The following fields are only important for 0-nsrec, that is, stat data. For other records, only two fields above are valid.number of hard links

Definition at line 426 of file cob.h.

◆ cnr_omgid [1/2]

uint64_t cnr_omgid

uid/gid/mode slot reference

Definition at line 421 of file cob.h.

◆ cnr_omgid [2/2]

uint64_t cnr_omgid

uid/gid/mode slot reference

Definition at line 429 of file cob.h.

◆ cnr_pad [1/2]

char cnr_pad[4]

Definition at line 420 of file cob.h.

◆ cnr_pad [2/2]

char cnr_pad[4]

Definition at line 428 of file cob.h.

◆ cnr_pver [1/2]

struct m0_fid cnr_pver

cob pool version

Definition at line 430 of file cob.h.

◆ cnr_pver [2/2]

struct m0_fid cnr_pver

cob pool version

Definition at line 438 of file cob.h.

◆ cnr_size [1/2]

uint64_t cnr_size

total size, in bytes

Definition at line 422 of file cob.h.

◆ cnr_size [2/2]

uint64_t cnr_size

total size, in bytes

Definition at line 430 of file cob.h.

◆ co_dom

struct m0_cob_domain* co_dom

Definition at line 582 of file cob.h.

◆ co_fabrec

struct m0_cob_fabrec* co_fabrec

fileattr_basic data (acl...)

Definition at line 591 of file cob.h.

◆ co_file

struct m0_file co_file

File containig fid which is reference to the nsrec fid

Definition at line 586 of file cob.h.

◆ co_flags

uint64_t co_flags
See also
enum m0_cob_valid_flags

Definition at line 585 of file cob.h.

◆ co_nskey

struct m0_cob_nskey* co_nskey

cob statdata nskey

Definition at line 588 of file cob.h.

◆ co_nsrec

struct m0_cob_nsrec co_nsrec

object fid, basic stat data

Definition at line 590 of file cob.h.

◆ co_oikey

struct m0_cob_oikey co_oikey

object fid, linkno

Definition at line 589 of file cob.h.

◆ co_omgrec

struct m0_cob_omgrec co_omgrec

permission data

Definition at line 592 of file cob.h.

◆ co_ref

struct m0_ref co_ref

refcounter for caching cobs

Definition at line 584 of file cob.h.

◆ co_stob

struct m0_stob* co_stob

underlying storage object

Definition at line 583 of file cob.h.

◆ cob_bc_ops

const struct m0_be_btree_kv_ops cob_bc_ops
static
Initial value:
= {
.ko_ksize = bc_ksize,
.ko_vsize = bc_vsize,
.ko_compare = bc_cmp
}
static m0_bcount_t bc_ksize(const void *key)
Definition: cob.c:371
static m0_bcount_t bc_vsize(const void *val)
Definition: cob.c:376
static int bc_cmp(const void *key0, const void *key1)
Definition: cob.c:414

Definition at line 577 of file cob.c.

◆ cob_ea_ops

const struct m0_be_btree_kv_ops cob_ea_ops
static
Initial value:
= {
.ko_ksize = ea_ksize,
.ko_vsize = ea_vsize,
.ko_compare = ea_cmp
}
static int ea_cmp(const void *key0, const void *key1)
Definition: cob.c:646
static m0_bcount_t ea_vsize(const void *val)
Definition: cob.c:656
static m0_bcount_t ea_ksize(const void *key)
Definition: cob.c:651

Definition at line 661 of file cob.c.

◆ cob_fab_ops

const struct m0_be_btree_kv_ops cob_fab_ops
static
Initial value:
= {
.ko_ksize = fb_ksize,
.ko_vsize = fb_vsize,
.ko_compare = fb_cmp
}
static m0_bcount_t fb_ksize(const void *key)
Definition: cob.c:626
static m0_bcount_t fb_vsize(const void *val)
Definition: cob.c:631
static int fb_cmp(const void *key0, const void *key1)
Definition: cob.c:615

Definition at line 636 of file cob.c.

◆ cob_ns_ops

const struct m0_be_btree_kv_ops cob_ns_ops
static
Initial value:
= {
.ko_ksize = ns_ksize,
.ko_vsize = ns_vsize,
.ko_compare = ns_cmp
}
static m0_bcount_t ns_vsize(const void *val)
Definition: cob.c:343
static m0_bcount_t ns_ksize(const void *key)
Definition: cob.c:338
static int ns_cmp(const void *key0, const void *key1)
Definition: cob.c:332

Definition at line 348 of file cob.c.

◆ cob_oi_ops

const struct m0_be_btree_kv_ops cob_oi_ops
static
Initial value:
= {
.ko_ksize = oi_ksize,
.ko_vsize = ns_ksize,
.ko_compare = oi_cmp
}
static m0_bcount_t oi_ksize(const void *key)
Definition: cob.c:600
static int oi_cmp(const void *key0, const void *key1)
Definition: cob.c:587
static m0_bcount_t ns_ksize(const void *key)
Definition: cob.c:338

Definition at line 605 of file cob.c.

◆ cob_omg_ops

const struct m0_be_btree_kv_ops cob_omg_ops
static
Initial value:
= {
.ko_ksize = omg_ksize,
.ko_vsize = omg_vsize,
.ko_compare = omg_cmp
}
static m0_bcount_t omg_vsize(const void *val)
Definition: cob.c:683
static int omg_cmp(const void *key0, const void *key1)
Definition: cob.c:671
static m0_bcount_t omg_ksize(const void *key)
Definition: cob.c:678

Definition at line 688 of file cob.c.

◆ cok_fid [1/2]

struct m0_fid cok_fid

Definition at line 457 of file cob.h.

◆ cok_fid [2/2]

struct m0_fid cok_fid

Definition at line 454 of file cob.h.

◆ cok_linkno [1/2]

uint32_t cok_linkno

hardlink ordinal index

Definition at line 455 of file cob.h.

◆ cok_linkno [2/2]

uint32_t cok_linkno

hardlink ordinal index

Definition at line 458 of file cob.h.

◆ cok_omgid [1/2]

uint64_t cok_omgid

omg id ref

Definition at line 454 of file cob.h.

◆ cok_omgid [2/2]

uint64_t cok_omgid

omg id ref

Definition at line 490 of file cob.h.

◆ cor_gid [1/2]

uint32_t cor_gid

group ID of owner

Definition at line 456 of file cob.h.

◆ cor_gid [2/2]

uint32_t cor_gid

group ID of owner

Definition at line 499 of file cob.h.

◆ cor_mode [1/2]

uint32_t cor_mode

protection

Definition at line 455 of file cob.h.

◆ cor_mode [2/2]

uint32_t cor_mode

protection

Definition at line 498 of file cob.h.

◆ cor_uid [1/2]

uint32_t cor_uid

user ID of owner

Definition at line 454 of file cob.h.

◆ cor_uid [2/2]

uint32_t cor_uid

user ID of owner

Definition at line 497 of file cob.h.

◆ d_name

char d_name[0]

Definition at line 601 of file cob.h.

◆ d_namelen

uint32_t d_namelen

Definition at line 599 of file cob.h.

◆ d_reclen

uint32_t d_reclen

Definition at line 600 of file cob.h.

◆ id [1/2]

uint64_t id

Definition at line 240 of file cob.h.

◆ id [2/2]

uint64_t id

Definition at line 2380 of file cob.h.

◆ m0_be_cob0

struct m0_be_0type m0_be_cob0
Initial value:
= {
.b0_name = "M0_BE:COB",
.b0_init = cob0_init,
.b0_fini = cob0_fini,
}
static int cob0_init(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
Definition: cob.c:72
static void cob0_fini(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
Definition: cob.c:104

Definition at line 111 of file cob.c.

◆ m0_cob_fid_type [1/2]

const struct m0_fid_type m0_cob_fid_type
Initial value:
= {
.ft_id = 'C',
.ft_name = "cob fid"
}

Definition at line 117 of file cob.c.

◆ m0_cob_fid_type [2/2]

const struct m0_fid_type m0_cob_fid_type

Definition at line 1129 of file cob.h.

◆ M0_XCA_DOMAIN

struct m0_cob M0_XCA_DOMAIN

◆ M0_XCA_ENUM

enum m0_cob_op M0_XCA_ENUM

◆ r_buf

struct m0_buf r_buf

Definition at line 609 of file cob.h.

◆ r_end

struct m0_bitstring* r_end

Definition at line 610 of file cob.h.

◆ r_pos

struct m0_bitstring* r_pos

Definition at line 608 of file cob.h.