Motr  M0
m0_stob Struct Reference

#include <stob.h>

Collaboration diagram for m0_stob:
Collaboration graph

Data Fields

const struct m0_stob_opsso_ops
 
struct m0_stob_domainso_domain
 
struct m0_stob_id so_id
 
enum m0_stob_state so_state
 
uint64_t so_ref
 
struct m0_chan so_ref_chan
 
struct m0_mutex so_ref_mutex
 
struct m0_tlink so_cache_linkage
 
uint64_t so_cache_magic
 
void * so_private
 

Detailed Description

In-memory representation of a storage object.

Description.

m0_stob serves multiple purposes:

- it acts as a placeholder in storage object identifiers name-space. For
  example, locks can be taken on it;

- it acts as a handle for the underlying storage object. IO and meta-data
  operations can be directed to the storage object by calling functions
  on m0_stob;

- it caches certain storage object attributes in memory.

Accordingly, m0_stob can be in one of the states described by enum m0_stob_state. Compare these m0_stob roles with the socket interface (bind, connect, etc.)

Maintenance of stob lifetime is responsibility of stob implementation.

Stob operations vectors (so_ops) can differ for stobs within the same domain. Consequently, so_ops is assigned by stob creation interface and depends on stob type implementation.

Stob id is unique within a domain but not across cluster. User chooses ids and is responsible for the uniqeness within their domain. Stob id is represented by struct m0_stob_id and consists of:

- Stob domain fid;
- Stob fid.

Stob fid has the following structure:

*           8 bits                            120 bits
*   +----------------------+----------------------------------------------+
*   |     stob type id     |                  stob key                    |
*   +----------------------+----------------------------------------------+
* 

Note: stob type id is not the same as stob domain type id. It's made to make possible to distinguish stob fids from stob domain fids.

Reference counting semantics.

m0_stob_find(), m0_stob_find_by_key(), m0_stob_lookup() and m0_stob_lookup_by_key() always acquire reference to a m0_stob implicitly. m0_stob_get() and m0_stob_put() work with references explicity. The rest interface functions don't change reference count of an m0_stob.

Definition at line 163 of file stob.h.

Field Documentation

◆ so_cache_linkage

struct m0_tlink so_cache_linkage

Definition at line 173 of file stob.h.

◆ so_cache_magic

uint64_t so_cache_magic

Definition at line 174 of file stob.h.

◆ so_domain

struct m0_stob_domain* so_domain

Definition at line 165 of file stob.h.

◆ so_id

struct m0_stob_id so_id

Definition at line 166 of file stob.h.

◆ so_ops

const struct m0_stob_ops* so_ops

Definition at line 164 of file stob.h.

◆ so_private

void* so_private

Definition at line 175 of file stob.h.

◆ so_ref

uint64_t so_ref

Definition at line 168 of file stob.h.

◆ so_ref_chan

struct m0_chan so_ref_chan

Channel where drop in ref count for the stob is signalled.

Definition at line 170 of file stob.h.

◆ so_ref_mutex

struct m0_mutex so_ref_mutex

Definition at line 172 of file stob.h.

◆ so_state

enum m0_stob_state so_state

Definition at line 167 of file stob.h.


The documentation for this struct was generated from the following file: