Motr
M0
|
#include <cob.h>
Data Fields | |
struct m0_cob_domain * | co_dom |
struct m0_stob * | co_stob |
struct m0_ref | co_ref |
uint64_t | co_flags |
struct m0_file | co_file |
struct m0_cob_nskey * | co_nskey |
struct m0_cob_oikey | co_oikey |
struct m0_cob_nsrec | co_nsrec |
struct m0_cob_fabrec * | co_fabrec |
struct m0_cob_omgrec | co_omgrec |
In-memory representation of a component object.
m0_cob is an in-memory structure, populated from database tables on demand. m0_cob is not cached for long time (except for root) and is only used as a temporary handle of database structures for the sake of handiness. This means, we don't need to bother with locking as every time we pass cob to some function this is new instance of it.
The exposed methods to get a new instance of cob are:
The cobs returned by these methods are always populated.
Not populated cob is only exposed with m0_cob_alloc() method, which is used by request handler and (possibly) others. Such a cob is used as an input parameter to functions mentioned above.
Users use m0_cob_get/put to hold/release references; a cob may be destroyed on the last put, or it may be cached for some time (just like root cob is).
A m0_cob serves several purposes:
Liveness A m0_cob may be freed when the reference count drops to 0.
Caching and concurrency Cobs are not cached by cob domain, neither by cob API users. Rationale is the following: