Motr  M0
Storage object

Data Structures

struct  m0_stob_cache
 
struct  m0_stob_domain
 
struct  m0_stob_domain_ops
 
struct  m0_stob_io
 
struct  m0_stob_io_op
 
struct  m0_stob_ioq_error
 
struct  m0_stob_module
 
struct  m0_stob_ad_module
 
struct  m0_stob_id
 
struct  m0_stob
 
struct  m0_stob_ops
 
struct  m0_stob_types
 
struct  m0_stob_type
 
struct  m0_stob_type_ops
 
struct  mock_balloc
 

Macros

#define STOB_ID_F   "{" FID_F "," FID_F "}"
 
#define STOB_ID_P(si)   FID_P(&(si)->si_domain_fid), FID_P(&(si)->si_fid)
 
#define AD_CS_SZ   16
 
#define AD_ADIEU_CS_SZ   16
 

Typedefs

typedef void(* m0_stob_cache_eviction_cb_t) (struct m0_stob_cache *cache, struct m0_stob *stob)
 

Enumerations

enum  m0_avi_stob_io_labels {
  M0_AVI_STOB_IO_LAUNCH = M0_AVI_STOB_RANGE_START + 1, M0_AVI_STOB_IO_PREPARE, M0_AVI_STOB_IO_END, M0_AVI_STOB_IOQ,
  M0_AVI_STOB_IOQ_TICK, M0_AVI_STOB_IOQ_INFLIGHT, M0_AVI_STOB_IOQ_QUEUED, M0_AVI_STOB_IOQ_GOT,
  M0_AVI_STOB_IO_REQ, M0_AVI_STOB_IO_ATTR_UVEC_NR, M0_AVI_STOB_IO_ATTR_UVEC_COUNT, M0_AVI_STOB_IO_ATTR_UVEC_BYTES
}
 
enum  m0_addb2_stio_req_labels {
  M0_AVI_IO_LAUNCH, M0_AVI_AD_PREPARE, M0_AVI_AD_WR_PREPARE, M0_AVI_AD_BALLOC_START,
  M0_AVI_AD_BALLOC_END, M0_AVI_AD_LAUNCH, M0_AVI_AD_SORT_START, M0_AVI_AD_SORT_END,
  M0_AVI_AD_ENDIO, M0_AVI_LIO_LAUNCH, M0_AVI_LIO_ENDIO
}
 
enum  { M0_STOB_CACHE_MAX_SIZE = 0x10 }
 
enum  { M0_LEVEL_STOB }
 
enum  m0_stob_state { CSS_UNKNOWN, CSS_EXISTS, CSS_NOENT, CSS_DELETE }
 
enum  { NR = 4, MIN_BUF_SIZE = 4096, MIN_BUF_SIZE_IN_BLOCKS = 4, SEG_SIZE = 1 << 24 }
 
enum  { UB_ITER = 100 }
 
enum  { NR = 4, NR_SORT = 256, MIN_BUF_SIZE = 4096, MIN_BUF_SIZE_IN_BLOCKS = 4 }
 
enum  { M0_STOB_UT_DOMAIN_KEY = 0x01, M0_STOB_UT_STOB_KEY = 0x02 }
 
enum  { UB_ITER = 100, UB_ITER_SORT = 100000 }
 

Functions

M0_INTERNAL int m0_stob_cache_init (struct m0_stob_cache *cache, uint64_t idle_size, m0_stob_cache_eviction_cb_t eviction_cb)
 
M0_INTERNAL void m0_stob_cache_fini (struct m0_stob_cache *cache)
 
M0_INTERNAL bool m0_stob_cache__invariant (const struct m0_stob_cache *cache)
 
M0_INTERNAL void m0_stob_cache_add (struct m0_stob_cache *cache, struct m0_stob *stob)
 
M0_INTERNAL void m0_stob_cache_idle (struct m0_stob_cache *cache, struct m0_stob *stob)
 
M0_INTERNAL struct m0_stobm0_stob_cache_lookup (struct m0_stob_cache *cache, const struct m0_fid *stob_fid)
 
M0_INTERNAL void m0_stob_cache_purge (struct m0_stob_cache *cache, int nr)
 
M0_INTERNAL void m0_stob_cache_lock (struct m0_stob_cache *cache)
 
M0_INTERNAL void m0_stob_cache_unlock (struct m0_stob_cache *cache)
 
M0_INTERNAL bool m0_stob_cache_is_locked (const struct m0_stob_cache *cache)
 
M0_INTERNAL bool m0_stob_cache_is_not_locked (const struct m0_stob_cache *cache)
 
M0_INTERNAL void m0_stob_cache__print (struct m0_stob_cache *cache)
 
static int stob_domain_type (const char *location, struct m0_stob_type **type)
 
static char * stob_domain_location_data (const char *location)
 
static void stob_domain_cache_evict_cb (struct m0_stob_cache *cache, struct m0_stob *stob)
 
static int stob_domain_create (struct m0_stob_type *type, const char *location_data, uint64_t dom_key, const char *str_cfg_create)
 
static int stob_domain_init (struct m0_stob_type *type, const char *location_data, const char *str_cfg_init, struct m0_stob_domain **out)
 
static int stob_domain_init_create (const char *location, const char *str_cfg_init, uint64_t dom_key, const char *str_cfg_create, struct m0_stob_domain **out, bool init)
 
M0_INTERNAL int m0_stob_domain_init (const char *location, const char *str_cfg_init, struct m0_stob_domain **out)
 
M0_INTERNAL void m0_stob_domain_fini (struct m0_stob_domain *dom)
 
M0_INTERNAL int m0_stob_domain_create (const char *location, const char *str_cfg_init, uint64_t dom_key, const char *str_cfg_create, struct m0_stob_domain **out)
 
M0_INTERNAL int m0_stob_domain_destroy (struct m0_stob_domain *dom)
 
M0_INTERNAL int m0_stob_domain_destroy_location (const char *location)
 
M0_INTERNAL int m0_stob_domain_create_or_init (const char *location, const char *str_cfg_init, uint64_t dom_key, const char *str_cfg_create, struct m0_stob_domain **out)
 
M0_INTERNAL struct m0_stob_domainm0_stob_domain_find (const struct m0_fid *dom_id)
 
M0_INTERNAL struct m0_stob_domainm0_stob_domain_find_by_location (const char *location)
 
M0_INTERNAL struct m0_stob_domainm0_stob_domain_find_by_stob_id (const struct m0_stob_id *stob_id)
 
M0_INTERNAL const struct m0_fidm0_stob_domain_id_get (const struct m0_stob_domain *dom)
 
M0_INTERNAL const char * m0_stob_domain_location_get (const struct m0_stob_domain *dom)
 
M0_INTERNAL void m0_stob_domain__id_set (struct m0_stob_domain *dom, struct m0_fid *dom_id)
 
M0_INTERNAL uint8_t m0_stob_domain__type_id (const struct m0_fid *dom_id)
 
M0_INTERNAL uint64_t m0_stob_domain__dom_key (const struct m0_fid *dom_id)
 
M0_INTERNAL void m0_stob_domain__dom_id_make (struct m0_fid *dom_id, uint8_t type_id, uint64_t dom_container, uint64_t dom_key)
 
M0_INTERNAL bool m0_stob_domain__invariant (struct m0_stob_domain *dom)
 
M0_INTERNAL bool m0_stob_domain__dom_key_is_valid (uint64_t dom_key)
 
M0_INTERNAL bool m0_stob_domain_is_of_type (const struct m0_stob_domain *dom, const struct m0_stob_type *dt)
 
M0_INTERNAL struct m0_stob_cachem0_stob_domain__cache (struct m0_stob_domain *dom)
 
M0_INTERNAL struct m0_stobm0_stob_domain__stob_alloc (struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
 
M0_INTERNAL void m0_stob_domain__stob_free (struct m0_stob_domain *dom, struct m0_stob *stob)
 
static void m0_stob_io_private_fini (struct m0_stob_io *io)
 
static void stob_io_addb2_add_and_push (uint64_t id, struct m0_stob_io *io, struct m0_stob *obj)
 
static bool stob_io_invariant (struct m0_stob_io *io, struct m0_stob *obj, enum m0_stob_io_state state)
 
static void stob_io_fill (struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope, enum m0_stob_io_state state, bool count_update)
 
struct m0_stob_ioq_error M0_XCA_DOMAIN (rpc)
 
M0_INTERNAL struct m0_stob_modulem0_stob_module__get (void)
 
M0_INTERNAL int m0_stob_find_by_key (struct m0_stob_domain *dom, const struct m0_fid *stob_fid, struct m0_stob **out)
 
M0_INTERNAL int m0_stob_find (const struct m0_stob_id *id, struct m0_stob **out)
 
M0_INTERNAL int m0_stob_lookup_by_key (struct m0_stob_domain *dom, const struct m0_fid *stob_fid, struct m0_stob **out)
 
M0_INTERNAL int m0_stob_lookup (const struct m0_stob_id *id, struct m0_stob **out)
 
M0_INTERNAL int m0_stob_locate (struct m0_stob *stob)
 
M0_INTERNAL void m0_stob_create_credit (struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
 
M0_INTERNAL int m0_stob_create (struct m0_stob *stob, struct m0_dtx *dtx, const char *str_cfg)
 
M0_INTERNAL void m0_stob_destroy_credit (struct m0_stob *stob, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_stob_delete_mark (struct m0_stob *stob)
 
M0_INTERNAL int m0_stob_destroy (struct m0_stob *stob, struct m0_dtx *dtx)
 
M0_INTERNAL int m0_stob_punch_credit (struct m0_stob *stob, struct m0_indexvec *want, struct m0_indexvec *got, struct m0_be_tx_credit *accum)
 
M0_INTERNAL int m0_stob_punch (struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
 
M0_INTERNAL uint64_t m0_stob_dom_id_get (struct m0_stob *stob)
 
M0_INTERNAL const struct m0_stob_idm0_stob_id_get (struct m0_stob *stob)
 
M0_INTERNAL const struct m0_fidm0_stob_fid_get (struct m0_stob *stob)
 
M0_INTERNAL uint64_t m0_stob_id_dom_id_get (const struct m0_stob_id *stob_id)
 
M0_INTERNAL enum m0_stob_state m0_stob_state_get (struct m0_stob *stob)
 
M0_INTERNAL uint32_t m0_stob_block_shift (struct m0_stob *stob)
 
M0_INTERNAL void m0_stob_get (struct m0_stob *stob)
 
M0_INTERNAL void m0_stob_put (struct m0_stob *stob)
 
M0_INTERNAL void m0_stob__id_set (struct m0_stob *stob, const struct m0_fid *stob_fid)
 
M0_INTERNAL void m0_stob__cache_evict (struct m0_stob *stob)
 
M0_INTERNAL void m0_stob__state_set (struct m0_stob *stob, enum m0_stob_state state)
 
M0_INTERNAL struct m0_stob_domainm0_stob_dom_get (struct m0_stob *stob)
 
M0_INTERNAL void m0_stob_id_make (uint64_t container, uint64_t key, const struct m0_fid *dom_id, struct m0_stob_id *stob_id)
 
M0_INTERNAL bool m0_stob_id_eq (const struct m0_stob_id *stob_id0, const struct m0_stob_id *stob_id1)
 
M0_INTERNAL int m0_stob_fd (struct m0_stob *stob)
 
M0_INTERNAL int m0_stob_mod_init (void)
 
M0_INTERNAL void m0_stob_mod_fini (void)
 
struct m0_stob_id M0_XCA_DOMAIN (be|rpc)
 
 M0_TL_DESCR_DEFINE (domains, "stob domains", static, struct m0_stob_domain, sd_domain_linkage, sd_magic, M0_STOB_DOMAINS_MAGIC, M0_STOB_DOMAINS_HEAD_MAGIC)
 
 M0_TL_DEFINE (domains, static, struct m0_stob_domain)
 
 M0_TL_DESCR_DEFINE (types, "stob types", static, struct m0_stob_type, st_type_linkage, st_magic, M0_STOB_TYPES_MAGIC, M0_STOB_TYPES_HEAD_MAGIC)
 
 M0_TL_DEFINE (types, static, struct m0_stob_type)
 
static int stob_type_copy (const struct m0_stob_type *type, struct m0_stob_type **copy)
 
static void stob_types_destroy_list (struct m0_stob_types *types)
 
static struct m0_stob_typesstob_types_get (void)
 
M0_INTERNAL int m0_stob_types_init (void)
 
M0_INTERNAL void m0_stob_types_fini (void)
 
M0_INTERNAL struct m0_stob_typem0_stob_type_by_dom_id (const struct m0_fid *id)
 
M0_INTERNAL struct m0_stob_typem0_stob_type_by_name (const char *name)
 
M0_INTERNAL uint8_t m0_stob_type_id_by_name (const char *name)
 
M0_INTERNAL void m0_stob_type_register (struct m0_stob_type *type)
 
M0_INTERNAL void m0_stob_type_deregister (struct m0_stob_type *type)
 
M0_INTERNAL uint8_t m0_stob_type_id_get (const struct m0_stob_type *type)
 
M0_INTERNAL const char * m0_stob_type_name_get (struct m0_stob_type *type)
 
M0_INTERNAL void m0_stob_type__dom_add (struct m0_stob_type *type, struct m0_stob_domain *dom)
 
M0_INTERNAL void m0_stob_type__dom_del (struct m0_stob_type *type, struct m0_stob_domain *dom)
 
M0_INTERNAL struct m0_stob_domainm0_stob_type__dom_find (struct m0_stob_type *type, const struct m0_fid *dom_id)
 
M0_INTERNAL struct m0_stob_domainm0_stob_type__dom_find_by_location (struct m0_stob_type *type, const char *location)
 
void m0_stob_ut_ad_init (struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg, bool use_small_credits)
 
void m0_stob_ut_ad_fini (struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg)
 
static struct mock_ballocb2mock (struct m0_ad_balloc *ballroom)
 
static int mock_balloc_init (struct m0_ad_balloc *ballroom, struct m0_be_seg *seg, uint32_t bshift, m0_bindex_t container_size, m0_bcount_t groupsize, m0_bcount_t spare_reserve)
 
static void mock_balloc_fini (struct m0_ad_balloc *ballroom)
 
static int mock_balloc_alloc (struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_type)
 
static int mock_balloc_free (struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, struct m0_ext *ext)
 
static int malloc_reserve_extent (struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)
 
static void init_vecs ()
 
static int test_ad_init (bool use_small_credits)
 
static int test_ad_fini (void)
 
static void test_write (int nr, struct m0_dtx *tx)
 
static void test_read (int nr)
 
static void test_punch (int nr)
 
static void test_ad_rw_unordered ()
 
static void test_ad (void)
 
static void punch_test (void)
 
static void test_ad_undo (void)
 
void m0_stob_ut_adieu_ad (void)
 
static void ub_write (int i)
 
static void ub_read (int i)
 
static int ub_init (const char *opts M0_UNUSED)
 
static void ub_fini (void)
 
static int test_adieu_init (const char *location, const char *dom_cfg, const char *stob_cfg)
 
static void test_adieu_fini (void)
 
static void test_write (int i)
 
static void test_adieu (const char *path)
 
void m0_stob_ut_adieu_linux (void)
 
void m0_stob_ut_adieu_perf (void)
 
static void ub_iovec_init ()
 
static void ub_iovec_invert ()
 
static void ub_iovec_sort ()
 
static void ub_iovec_sort_invert ()
 

Variables

enum m0_avi_stob_io_labels M0_XCA_ENUM
 
struct m0_mutex sc_lock
 
struct m0_tl sc_busy
 
struct m0_tl sc_idle
 
uint64_t sc_idle_size
 
uint64_t sc_idle_used
 
m0_stob_cache_eviction_cb_t sc_eviction_cb
 
uint64_t sc_busy_hits
 
uint64_t sc_idle_hits
 
uint64_t sc_misses
 
uint64_t sc_evictions
 
enum m0_stob_io_opcode si_opcode
 
enum m0_stob_io_flags si_flags
 
struct m0_bufvec si_user
 
struct m0_indexvec si_stob
 
struct m0_chan si_wait
 
struct m0_mutex si_mutex
 
struct m0_stobsi_obj
 
const struct m0_stob_io_opsi_op
 
int32_t si_rc
 
m0_bcount_t si_count
 
enum m0_stob_io_state si_state
 
struct m0_dtxsi_tx
 
struct m0_io_scope * si_scope
 
void * si_stob_private
 
uint32_t si_stob_magic
 
struct m0_fol_fragsi_fol_frag
 
struct m0_bufvec si_battr
 
m0_time_t si_start
 
uint64_t si_id
 
struct m0_buf si_cksum
 
m0_bindex_t si_unit_sz
 
m0_bcount_t si_cksum_sz
 
m0_bcount_t si_cksum_nob_read
 
void(* sio_fini )(struct m0_stob_io *io)
 
int(* sio_launch )(struct m0_stob_io *io)
 
int(* sio_prepare )(struct m0_stob_io *io)
 
const struct m0_stob_type m0_stob_null_type
 
struct m0_stob M0_XCA_DOMAIN
 
static const struct m0_stob_typestob_types_reg []
 
static struct m0_stob_domaindom_back
 
static struct m0_stob_domaindom_fore
 
static struct m0_stobobj_back
 
static struct m0_stobobj_fore
 
static struct m0_stob_io io
 
static m0_bcount_t user_vc [NR]
 
static m0_bcount_t stob_vc [NR]
 
static char * user_buf [NR]
 
static char * user_cksm_buf [NR]
 
static char * read_buf [NR]
 
static char * read_cksm_buf [NR]
 
static char * zero_buf [NR]
 
static char * user_bufs [NR]
 
static char * read_bufs [NR]
 
static m0_bindex_t stob_vi [NR]
 
static struct m0_clink clink
 
static struct m0_dtx g_tx
 
struct m0_be_ut_backend ut_be
 
struct m0_be_ut_seg ut_seg
 
static uint32_t block_shift
 
static uint32_t buf_size
 
static const struct m0_ad_balloc_ops mock_balloc_ops
 
struct mock_balloc mb
 
struct m0_ub_set m0_ad_ub
 
static const char linux_location [] = "linuxstob:./__s"
 
static const char perf_location [] = "perfstob:./__s"
 
static struct m0_stob_domaindom
 
static struct m0_stobobj
 
static const char linux_path [] = "./__s/o/100000000000000:2"
 
static const char perf_path [] = "./__s/backstore/o/100000000000000:2"
 
static struct m0_stob_io io
 
static m0_bcount_t user_vec [NR]
 
static char * user_buf [NR]
 
static char * user_cksm_buf [NR]
 
static char * read_buf [NR]
 
static char * read_cksm_buf [NR]
 
static char * user_bufs [NR]
 
static char * read_bufs [NR]
 
static m0_bindex_t stob_vec [NR]
 
static struct m0_clink clink
 
static FILE * f
 
static uint32_t block_shift
 
static uint32_t buf_size
 
static m0_bcount_t user_vec1 [NR_SORT]
 
static char * user_bufs1 [NR_SORT]
 
static m0_bindex_t stob_vec1 [NR_SORT]
 
struct m0_ub_set m0_adieu_ub
 

adieu

Asynchronous Direct Io Extensible User interface (adieu) for storage objects.

Overview.

adieu is an interface for a non-blocking (asynchronous) 0-copy (direct) vectored IO against storage objects.

A user of this interface builds an IO operation description and queues it against a storage object. IO completion or failure notification is done by signalling a user supplied m0_chan. As usual, the user can either wait on the chan or register a call-back with it.

adieu supports scatter-gather type of IO operations (that is, vectored on both input and output data).

adieu can work both on local and remote storage objects. adieu IO operations are executed as part of a distributed transaction.

Functional specification.

Externally, adieu usage has the following phases:

- m0_bufvec registration. Some types of storage objects require that
  buffers from which IO is done are registered with its IO sub-system
  (examples: RDMA). This step is optional, IO from unregistered buffers
  should also be possible (albeit might incur additional data-copy).

- IO description creation. A IO operation description object m0_stob_io
  is initialised.

- IO operation is queued by a call to m0_stob_io_launch(). It is
  guaranteed that on a successful return from this call, a chan embedded
  into IO operation data-structure will be eventually signalled.

- An execution of a queued IO operation can be delayed for some time
  due to storage traffic control regulations, concurrency control,
  resource quotas or barriers.

- An IO operation is executed, possibly by splitting it into
  implementation defined fragments. A user can request an "prefixed
  fragments execution" mode (m0_stob_io_flags::SIF_PREFIX) constraining
  execution concurrency as to guarantee that after execution completion
  (with success or failure) a storage is updated as if some possibly
  empty prefix of the IO operation executed successfully (this is similar
  to the failure mode of POSIX write call). When prefixed fragments
  execution mode is not requested, an implementation is free to execute
  fragments in any order and with any degree of concurrency. Prefixed
  fragments execution mode request has no effect on read-only IO
  operations.

- When whole operation execution completes, a chan embedded into IO
  operation data-structure is signalled. It is guaranteed that no IO is
  outstanding at this moment and that adieu implementation won't touch
  either IO operation structure or associated data pages afterward.

- After analyzing IO result codes, a user is free to either de-allocate
  IO operation structure by calling m0_stob_io_fini() or use it to queue
  another IO operation potentially against different object.

Ordering and barriers.

The only guarantee about relative order of IO operations state transitions is that execution of any updating operation submitted before m0_stob_io_opcode::SIO_BARRIER operation completes before any updating operation submitted after the barrier starts executing. For the purpose of this definition, an updating operation is an operation of any valid type different from SIO_READ (i.e., barriers are updating operations).

A barrier operation completes when all operations submitted before it (including other barrier operations) complete.

Warning
Clarify the scope of a barrier: a single storage object, a storage object domain, a storage object type, all local storage objects or all objects in the system.

IO alignment and granularity.

Alignment is not "optimal IO size". This is a requirement rather than hint.

Block sizes are needed for the following reasons:

- to insulate stob IO layer from read-modify-write details;

- to allow IO to the portions of objects inaccessible through the
  flat 64-bit byte-granularity name-space.
Note
the scheme is very simplistic, enforcing the same unit of alignment and granularity. Sophistication could be added as necessary.

Result codes.

In addition to filling in data pages with the data (in a case read operation), adieu supplies two status codes on IO completion:

- <tt>m0_stob_io::si_rc</tt> is a return code of IO operation. 0 means
  success, any other possible value is negated errno;

- <tt>m0_stob_io::si_count</tt> is a number of blocks (as defined by
  m0_stob_op::sop_block_shift()) successfully transferred between data
  pages and the storage object. When IO is executed in prefixed
  fragments mode, exactly <tt>m0_stob_io::si_count</tt> blocks of the
  storage object, starting from the offset
  <tt>m0_stob_io::si_stob.ov_index[0]</tt> were transferred.

Data ownership.

Data pages are owned by adieu implementation from the moment of call to m0_stob_io_launch() until the chan is signalled. adieu users must not inspect or modify data during that time. An implementation is free to modify the data temporarily, un-map pages, etc. An implementation must not touch the data at any other time.

Liveness rules.

m0_stob_io can be freed once it is owned by an adieu user (see data ownership). It has no explicit reference counting, a user must add its own should m0_stob_io be shared between multiple threads.

The user must guarantee that the target storage object is pinned in memory while IO operation is owned by the implementation. An implementation is free to touch storage object while IO is in progress.

Similarly, the user must pin the transaction and IO scope while m0_stob_io is owned by the implementation.

Concurrency.

When m0_stob_io is owned by a user, the user is responsible for concurrency control.

Implementation guarantees that synchronous channel notification (through clink call-back) happens in the context not holding IO lock.

At the moment there are two types of storage object supporting adieu:

- Linux file system based one, using Linux libaio interfaces;

- AD stob type implements adieu on top of underlying backing store
  storage object.

State.

                   (O)(X)
                    |  ^
                    |  |
  m0_stob_io_init() |  | m0_stob_io_fini()
                    |  |
                    V  |
                  SIS_IDLE
                    |  ^
                    |  |
m0_stob_io_launch() |  | IO completion
                    |  |
                    V  |
                  SIS_BUSY
Todo:
A natural way to extend this design is to introduce additional SIS_PREPARED state and to split IO operation submission into two stages: (i) "preparation" stage that is entered once "IO geometry" is known (i.e., once m0_vec of data pages and m0_vec storage objects are known) and (ii) "queueing" stage that is entered when in addition to IO geometry, actual data pages are allocated. The motivating example for this refinement is a data server handling read or write RPC from a client. The RPC contains enough information to build IO vectors, while data arrive later through RDMA. To avoid dead-locks, it is crucial to avoid dynamic resource allocations (first of all, memory allocations) in data path after resources are consumed by RDMA. To this end, IO operation must be completely set up and ready for queueing before RMDA starts, i.e., before data pages are available.
enum  m0_stob_io_opcode {
  SIO_INVALID, SIO_READ, SIO_WRITE, SIO_BARRIER,
  SIO_SYNC
}
 
enum  m0_stob_io_state { SIS_ZERO = 0, SIS_IDLE, SIS_PREPARED, SIS_BUSY }
 
enum  m0_stob_io_flags { SIF_PREFIX = (1 << 0), SIF_NOHOLE = (1 << 1) }
 
M0_INTERNAL int m0_stob_io_private_setup (struct m0_stob_io *io, struct m0_stob *obj)
 
M0_INTERNAL void m0_stob_io_init (struct m0_stob_io *io)
 
M0_INTERNAL void m0_stob_io_fini (struct m0_stob_io *io)
 
M0_INTERNAL void m0_stob_io_credit (const struct m0_stob_io *io, const struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
 
M0_INTERNAL int m0_stob_io_prepare (struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
 
M0_INTERNAL int m0_stob_io_launch (struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
 
M0_INTERNAL int m0_stob_io_prepare_and_launch (struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
 
M0_INTERNAL bool m0_stob_io_user_is_valid (const struct m0_bufvec *user)
 
M0_INTERNAL bool m0_stob_io_stob_is_valid (const struct m0_indexvec *stob)
 
M0_INTERNAL int m0_stob_io_bufvec_launch (struct m0_stob *stob, struct m0_bufvec *bufvec, int op_code, m0_bindex_t offset)
 
M0_INTERNAL void * m0_stob_addr_pack (const void *buf, uint32_t shift)
 
M0_INTERNAL void * m0_stob_addr_open (const void *buf, uint32_t shift)
 
M0_INTERNAL void m0_stob_iovec_sort (struct m0_stob_io *stob)
 

Detailed Description

Todo:
more scalable object index instead of a list.

Storage object is a fundamental abstraction of M0. Storage objects offer a linear address space for data and may have redundancy and may have integrity data.

There are multiple types of storage objects, used for various purposes and providing various extensions of the basic storage object interface described below. Specifically, containers for data and meta-data are implemented as special types of storage objects.

See also
Storage object based on Linux specific file system

Macro Definition Documentation

◆ AD_ADIEU_CS_SZ

#define AD_ADIEU_CS_SZ   16

Definition at line 48 of file adieu.c.

◆ AD_CS_SZ

#define AD_CS_SZ   16

Definition at line 46 of file ad.c.

◆ STOB_ID_F

#define STOB_ID_F   "{" FID_F "," FID_F "}"

Definition at line 108 of file stob.h.

◆ STOB_ID_P

#define STOB_ID_P (   si)    FID_P(&(si)->si_domain_fid), FID_P(&(si)->si_fid)

Definition at line 109 of file stob.h.

Typedef Documentation

◆ m0_stob_cache_eviction_cb_t

typedef void(* m0_stob_cache_eviction_cb_t) (struct m0_stob_cache *cache, struct m0_stob *stob)

Definition at line 44 of file cache.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_STOB_CACHE_MAX_SIZE 

Maximum number of cached stobs that ain't held by any user and ain't finalised yet.

Note
0x10 may be too small value.
Todo:
make a parameter for stob domain.

Definition at line 43 of file domain.c.

◆ anonymous enum

anonymous enum

Levels of m0_stob_module::stm_module.

Enumerator
M0_LEVEL_STOB 

m0_stob_types_init() has been called.

Definition at line 37 of file module.h.

◆ anonymous enum

anonymous enum
Enumerator
NR 
MIN_BUF_SIZE 
MIN_BUF_SIZE_IN_BLOCKS 
SEG_SIZE 

Definition at line 48 of file ad.c.

◆ anonymous enum

anonymous enum
Enumerator
UB_ITER 

Definition at line 646 of file ad.c.

◆ anonymous enum

anonymous enum
Enumerator
NR 
NR_SORT 
MIN_BUF_SIZE 
MIN_BUF_SIZE_IN_BLOCKS 

Definition at line 50 of file adieu.c.

◆ anonymous enum

anonymous enum
Enumerator
M0_STOB_UT_DOMAIN_KEY 
M0_STOB_UT_STOB_KEY 

Definition at line 57 of file adieu.c.

◆ anonymous enum

anonymous enum
Enumerator
UB_ITER 
UB_ITER_SORT 

Definition at line 393 of file adieu.c.

◆ m0_addb2_stio_req_labels

Enumerator
M0_AVI_IO_LAUNCH 
M0_AVI_AD_PREPARE 
M0_AVI_AD_WR_PREPARE 
M0_AVI_AD_BALLOC_START 
M0_AVI_AD_BALLOC_END 
M0_AVI_AD_LAUNCH 
M0_AVI_AD_SORT_START 
M0_AVI_AD_SORT_END 
M0_AVI_AD_ENDIO 
M0_AVI_LIO_LAUNCH 
M0_AVI_LIO_ENDIO 

Definition at line 53 of file addb2.h.

◆ m0_avi_stob_io_labels

Enumerator
M0_AVI_STOB_IO_LAUNCH 
M0_AVI_STOB_IO_PREPARE 
M0_AVI_STOB_IO_END 
M0_AVI_STOB_IOQ 
M0_AVI_STOB_IOQ_TICK 
M0_AVI_STOB_IOQ_INFLIGHT 
M0_AVI_STOB_IOQ_QUEUED 
M0_AVI_STOB_IOQ_GOT 
M0_AVI_STOB_IO_REQ 
M0_AVI_STOB_IO_ATTR_UVEC_NR 
M0_AVI_STOB_IO_ATTR_UVEC_COUNT 
M0_AVI_STOB_IO_ATTR_UVEC_BYTES 

Definition at line 37 of file addb2.h.

◆ m0_stob_io_flags

Flags controlling the execution of IO operation.

Enumerator
SIF_PREFIX 

Execute operation in "prefixed fragments" mode.

It is called "prefixed" because in this mode it is guaranteed that some initial part of the operation is executed. For example, when writing N blocks at offset X, it is guaranteed that when operation completes, blocks in the extent [X, X+M] are written to. When operation completed successfully, M == N, otherwise, M might be less than N. That is, here "prefix" means the same as in "string prefix" (http://en.wikipedia.org/wiki/Prefix_(computer_science) ), because [X, X+M] is a prefix of [X, X+N] when M <= N.

SIF_NOHOLE 

Read operation should not see any holes. If a hole is met during read, return error instead.

Definition at line 261 of file io.h.

◆ m0_stob_io_opcode

Type of a storage object IO operation.

Todo:
implement barriers.
Enumerator
SIO_INVALID 
SIO_READ 
SIO_WRITE 
SIO_BARRIER 
SIO_SYNC 

Definition at line 227 of file io.h.

◆ m0_stob_io_state

State of adieu IO operation.

Enumerator
SIS_ZERO 

State used to detect un-initialised m0_stob_io.

SIS_IDLE 

User owns m0_stob_io and data pages. No IO is ongoing.

SIS_PREPARED 

Operation has been queued for execution by a call to m0_stob_io_prepare().

SIS_BUSY 

Operation has been queued for execution by a call to m0_stob_io_launch(), but hasn't yet been completed. adieu owns m0_stob_io and data pages.

Definition at line 238 of file io.h.

◆ m0_stob_state

m0_stob state specifying its relationship with the underlying storage object.

Todo:
add M0_ prefix.
Enumerator
CSS_UNKNOWN 

The state or existence of the underlying storage object are not known. m0_stob can be used as a placeholder in storage object identifiers name-space in this state.

CSS_EXISTS 

The underlying storage object is known to exist.

CSS_NOENT 

The underlying storage object is known to not exist.

CSS_DELETE 

The underlying storage object has been requested to be deleted.

Definition at line 81 of file stob.h.

Function Documentation

◆ b2mock()

static struct mock_balloc* b2mock ( struct m0_ad_balloc ballroom)
static

Definition at line 113 of file ad.c.

Here is the caller graph for this function:

◆ init_vecs()

static void init_vecs ( )
static

Definition at line 180 of file ad.c.

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

◆ m0_stob__cache_evict()

M0_INTERNAL void m0_stob__cache_evict ( struct m0_stob stob)

Definition at line 323 of file stob.c.

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

◆ m0_stob__id_set()

M0_INTERNAL void m0_stob__id_set ( struct m0_stob stob,
const struct m0_fid stob_fid 
)

Definition at line 315 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob__state_set()

M0_INTERNAL void m0_stob__state_set ( struct m0_stob stob,
enum m0_stob_state  state 
)

Definition at line 332 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_addr_open()

M0_INTERNAL void * m0_stob_addr_open ( const void *  buf,
uint32_t  shift 
)

Scales buffer address back from block-sized units.

See also
m0_stob_addr_pack()

Definition at line 302 of file io.c.

Here is the caller graph for this function:

◆ m0_stob_addr_pack()

M0_INTERNAL void * m0_stob_addr_pack ( const void *  buf,
uint32_t  shift 
)

Scales buffer address into block-sized units.

See also
m0_stob_addr_open()

Definition at line 293 of file io.c.

Here is the caller graph for this function:

◆ m0_stob_block_shift()

M0_INTERNAL uint32_t m0_stob_block_shift ( struct m0_stob stob)

Returns a power of two, which determines alignment required for the user buffers of stob IO requests against this object and IO granularity.

Definition at line 270 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_cache__invariant()

M0_INTERNAL bool m0_stob_cache__invariant ( const struct m0_stob_cache cache)

Stob cache invariant.

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 81 of file cache.c.

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

◆ m0_stob_cache__print()

M0_INTERNAL void m0_stob_cache__print ( struct m0_stob_cache cache)

Definition at line 205 of file cache.c.

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

◆ m0_stob_cache_add()

M0_INTERNAL void m0_stob_cache_add ( struct m0_stob_cache cache,
struct m0_stob stob 
)

Adds stob to the stob cache. Stob should be deleted from the stob cache using m0_stob_cache_idle().

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 120 of file cache.c.

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

◆ m0_stob_cache_fini()

M0_INTERNAL void m0_stob_cache_fini ( struct m0_stob_cache cache)

Definition at line 61 of file cache.c.

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

◆ m0_stob_cache_idle()

M0_INTERNAL void m0_stob_cache_idle ( struct m0_stob_cache cache,
struct m0_stob stob 
)

Deletes item from the stob cache.

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 129 of file cache.c.

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

◆ m0_stob_cache_init()

M0_INTERNAL int m0_stob_cache_init ( struct m0_stob_cache cache,
uint64_t  idle_size,
m0_stob_cache_eviction_cb_t  eviction_cb 
)

Initialises stob cache.

Parameters
cachestob cache
idle_sizeidle list maximum size

Definition at line 42 of file cache.c.

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

◆ m0_stob_cache_is_locked()

M0_INTERNAL bool m0_stob_cache_is_locked ( const struct m0_stob_cache cache)

Definition at line 195 of file cache.c.

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

◆ m0_stob_cache_is_not_locked()

M0_INTERNAL bool m0_stob_cache_is_not_locked ( const struct m0_stob_cache cache)

Definition at line 200 of file cache.c.

Here is the call graph for this function:

◆ m0_stob_cache_lock()

M0_INTERNAL void m0_stob_cache_lock ( struct m0_stob_cache cache)

Definition at line 185 of file cache.c.

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

◆ m0_stob_cache_lookup()

M0_INTERNAL struct m0_stob* m0_stob_cache_lookup ( struct m0_stob_cache cache,
const struct m0_fid stob_fid 
)

Finds item in the stob cache. Stob found should be deleted from the stob cache using m0_stob_cache_idle().

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 137 of file cache.c.

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

◆ m0_stob_cache_purge()

M0_INTERNAL void m0_stob_cache_purge ( struct m0_stob_cache cache,
int  nr 
)

Purges at most nr items from the idle stob cache.

Precondition
m0_stob_cache_is_not_locked(cache)
Postcondition
m0_stob_cache_is_not_locked(cache)

Definition at line 165 of file cache.c.

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

◆ m0_stob_cache_unlock()

M0_INTERNAL void m0_stob_cache_unlock ( struct m0_stob_cache cache)

Definition at line 190 of file cache.c.

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

◆ m0_stob_create()

M0_INTERNAL int m0_stob_create ( struct m0_stob stob,
struct m0_dtx dtx,
const char *  str_cfg 
)

Creates a storate object.

Parameters
stobPreviously allocated in-memory object.
Precondition
stob->so_state != CSS_UNKNOWN
stob->so_ref > 0
Postcondition
ergo(rc == 0, m0_stob_state_get(stob) == CSS_EXISTS))

Definition at line 154 of file stob.c.

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

◆ m0_stob_create_credit()

M0_INTERNAL void m0_stob_create_credit ( struct m0_stob_domain dom,
struct m0_be_tx_credit accum 
)

Calculates BE tx credit for m0_stob_create().

Definition at line 148 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_delete_mark()

M0_INTERNAL void m0_stob_delete_mark ( struct m0_stob stob)

Marks stob state as CSS_DELETE to indicate that it has been requested to be deleted. Once a stob's state is marked as CSS_DELETE:

  • If stob_ref > 1, the stob-delete FOM is made to wait on so_ref_chan channel
  • This waiting channel is signalled when the stob_ref drops to 1, e.g. by SNS copy-machine FOM when it is done with the copy operation
  • Copy-machine FOMs which may be created after 'stob-delete FOM is made to wait for so_ref drop to 1', exit right-away by releasing the so_ref
  • The ongoing copy-machine FOMs proceed as usual
  • Any copy-machine FOM when releases stob_ref, checks if the so_ref now is 1 and if there is any cob-delete FOM waiting on the so_ref_chan channel. If yes, it signals the so_ref_chan channel

Definition at line 193 of file stob.c.

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

◆ m0_stob_destroy()

M0_INTERNAL int m0_stob_destroy ( struct m0_stob stob,
struct m0_dtx dtx 
)

Definition at line 200 of file stob.c.

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

◆ m0_stob_destroy_credit()

M0_INTERNAL void m0_stob_destroy_credit ( struct m0_stob stob,
struct m0_be_tx_credit accum 
)

Calculates BE tx credit for m0_stob_destroy().

Definition at line 187 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_dom_get()

M0_INTERNAL struct m0_stob_domain * m0_stob_dom_get ( struct m0_stob stob)

Returns stob domain the stob belongs to.

Definition at line 338 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_dom_id_get()

M0_INTERNAL uint64_t m0_stob_dom_id_get ( struct m0_stob stob)

Returns stob domain id.

Definition at line 245 of file stob.c.

Here is the call graph for this function:

◆ m0_stob_domain__cache()

M0_INTERNAL struct m0_stob_cache * m0_stob_domain__cache ( struct m0_stob_domain dom)

Definition at line 46 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_domain__dom_id_make()

M0_INTERNAL void m0_stob_domain__dom_id_make ( struct m0_fid dom_id,
uint8_t  type_id,
uint64_t  dom_container,
uint64_t  dom_key 
)

Definition at line 327 of file domain.c.

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

◆ m0_stob_domain__dom_key()

M0_INTERNAL uint64_t m0_stob_domain__dom_key ( const struct m0_fid dom_id)

Extracts stob domain key from stob domain id.

Definition at line 322 of file domain.c.

Here is the caller graph for this function:

◆ m0_stob_domain__dom_key_is_valid()

M0_INTERNAL bool m0_stob_domain__dom_key_is_valid ( uint64_t  dom_key)

Checks if domain key is valid.

Definition at line 344 of file domain.c.

Here is the caller graph for this function:

◆ m0_stob_domain__id_set()

M0_INTERNAL void m0_stob_domain__id_set ( struct m0_stob_domain dom,
struct m0_fid dom_id 
)

Sets stob domain id.

Note
This function should be used from stob type implementation code only.

Definition at line 311 of file domain.c.

Here is the caller graph for this function:

◆ m0_stob_domain__invariant()

M0_INTERNAL bool m0_stob_domain__invariant ( struct m0_stob_domain dom)

Definition at line 335 of file domain.c.

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

◆ m0_stob_domain__stob_alloc()

M0_INTERNAL struct m0_stob * m0_stob_domain__stob_alloc ( struct m0_stob_domain dom,
const struct m0_fid stob_fid 
)

Definition at line 52 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_domain__stob_free()

M0_INTERNAL void m0_stob_domain__stob_free ( struct m0_stob_domain dom,
struct m0_stob stob 
)

Definition at line 58 of file stob.c.

◆ m0_stob_domain__type_id()

M0_INTERNAL uint8_t m0_stob_domain__type_id ( const struct m0_fid dom_id)

Extracts stob type id from stob domain id.

Definition at line 317 of file domain.c.

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

◆ m0_stob_domain_create()

M0_INTERNAL int m0_stob_domain_create ( const char *  location,
const char *  str_cfg_init,
uint64_t  dom_key,
const char *  str_cfg_create,
struct m0_stob_domain **  out 
)

Creates a stob domain.

This function has the functionality of m0_stob_domain_init() thereby dom must be finalised after successful m0_stob_domain_create() call.

See also
m0_stob_domain_create_or_init(), m0_stob_domain_destroy(), m0_stob_domain_init(), m0_stob_domain_fini().

Definition at line 217 of file domain.c.

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

◆ m0_stob_domain_create_or_init()

M0_INTERNAL int m0_stob_domain_create_or_init ( const char *  location,
const char *  str_cfg_init,
uint64_t  dom_key,
const char *  str_cfg_create,
struct m0_stob_domain **  out 
)

Initialises stob domain. Creates new domain if initialisation fails.

Note
dom_key and str_cfg_create parameters is completely ignored if stob domain initialisation succeeds. m0_stob_domain_create() is not called in this case.
Use this function if you don't care about reason of failure; otherwise m0_stob_domain_init() and m0_stob_domain_create() should be used instead.

Definition at line 262 of file domain.c.

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

◆ m0_stob_domain_destroy()

M0_INTERNAL int m0_stob_domain_destroy ( struct m0_stob_domain dom)

Destroys a stob domain.

This function has implicit m0_stob_domain_fini() functionality, so domain is always finalised after call to this function.

See also
m0_stob_domain_destroy_location()

Definition at line 227 of file domain.c.

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

◆ m0_stob_domain_destroy_location()

M0_INTERNAL int m0_stob_domain_destroy_location ( const char *  location)

Destroys a stob domain.

Stob domain shouldn't be in initialised state at the time of the call.

Notes:

  • it is possible to call this function again with the same location;
  • if this function fails then stob domain is left in some intermediate state: m0_stob_domain_init() can't be called for this domain, and m0_stob_domain_create() will return error;
  • the case when there is no such domain at specified is not considered as an error, 0 is returned.

Definition at line 242 of file domain.c.

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

◆ m0_stob_domain_find()

M0_INTERNAL struct m0_stob_domain * m0_stob_domain_find ( const struct m0_fid dom_id)

Searches domain with the given dom_id that was previously initialised with m0_stob_domain_init() or m0_stob_domain_create().

Definition at line 278 of file domain.c.

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

◆ m0_stob_domain_find_by_location()

M0_INTERNAL struct m0_stob_domain * m0_stob_domain_find_by_location ( const char *  location)

Searches domain with the given location.

Definition at line 284 of file domain.c.

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

◆ m0_stob_domain_find_by_stob_id()

M0_INTERNAL struct m0_stob_domain * m0_stob_domain_find_by_stob_id ( const struct m0_stob_id stob_id)

Searches domain with the given dom_id, extracted from stob id.

Definition at line 294 of file domain.c.

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

◆ m0_stob_domain_fini()

M0_INTERNAL void m0_stob_domain_fini ( struct m0_stob_domain dom)

Definition at line 204 of file domain.c.

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

◆ m0_stob_domain_id_get()

M0_INTERNAL const struct m0_fid * m0_stob_domain_id_get ( const struct m0_stob_domain dom)

Returns stob domain id.

Definition at line 300 of file domain.c.

Here is the caller graph for this function:

◆ m0_stob_domain_init()

M0_INTERNAL int m0_stob_domain_init ( const char *  location,
const char *  str_cfg_init,
struct m0_stob_domain **  out 
)

Initialises existing domain.

Definition at line 195 of file domain.c.

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

◆ m0_stob_domain_is_of_type()

M0_INTERNAL bool m0_stob_domain_is_of_type ( const struct m0_stob_domain dom,
const struct m0_stob_type dt 
)

Determines if stob domain hosts the stobs of given type.

Definition at line 349 of file domain.c.

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

◆ m0_stob_domain_location_get()

M0_INTERNAL const char * m0_stob_domain_location_get ( const struct m0_stob_domain dom)

Returns stob domain location.

Definition at line 306 of file domain.c.

Here is the caller graph for this function:

◆ m0_stob_fd()

M0_INTERNAL int m0_stob_fd ( struct m0_stob stob)

Returns file descriptor if stob implementation implies an underlying file object.

Definition at line 360 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_fid_get()

M0_INTERNAL const struct m0_fid * m0_stob_fid_get ( struct m0_stob stob)

Returns stob fid.

Definition at line 255 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_find()

M0_INTERNAL int m0_stob_find ( const struct m0_stob_id id,
struct m0_stob **  out 
)

Returns an in-memory representation for a stob with a given key, creating the former if necessary.

Resulting m0_stob can be in any state. m0_stob_find() neither fetches the object attributes from the storage nor checks for object's existence. This function is used to create a placeholder on which other functions (m0_stob_locate(), m0_stob_create(), locking functions, etc.) can be called.

On success, this function acquires a reference on the returned object.

Postcondition
equi(rc == 0, *out != NULL)

Definition at line 92 of file stob.c.

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

◆ m0_stob_find_by_key()

M0_INTERNAL int m0_stob_find_by_key ( struct m0_stob_domain dom,
const struct m0_fid stob_fid,
struct m0_stob **  out 
)
Todo:
move allocation out of cache lock if needed

Definition at line 65 of file stob.c.

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

◆ m0_stob_get()

M0_INTERNAL void m0_stob_get ( struct m0_stob stob)

Acquires an additional reference on the stob.

Precondition
stob->so_ref > 1

Definition at line 275 of file stob.c.

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

◆ m0_stob_id_dom_id_get()

M0_INTERNAL uint64_t m0_stob_id_dom_id_get ( const struct m0_stob_id stob_id)

Returns stob domain id from a stob id.

Definition at line 260 of file stob.c.

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

◆ m0_stob_id_eq()

M0_INTERNAL bool m0_stob_id_eq ( const struct m0_stob_id stob_id0,
const struct m0_stob_id stob_id1 
)

Definition at line 352 of file stob.c.

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

◆ m0_stob_id_get()

M0_INTERNAL const struct m0_stob_id * m0_stob_id_get ( struct m0_stob stob)

Returns stob id.

Definition at line 250 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_id_make()

M0_INTERNAL void m0_stob_id_make ( uint64_t  container,
uint64_t  key,
const struct m0_fid dom_id,
struct m0_stob_id stob_id 
)

Makes stob id from domain id and stob key.

Definition at line 343 of file stob.c.

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

◆ m0_stob_io_bufvec_launch()

M0_INTERNAL int m0_stob_io_bufvec_launch ( struct m0_stob stob,
struct m0_bufvec bufvec,
int  op_code,
m0_bindex_t  offset 
)

Reads or writes bufvector to stob

Precondition
stob != NULL
bufvec != NULL
M0_IN(op_code, (SIO_READ, SIO_WRITE))

Definition at line 248 of file io.c.

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

◆ m0_stob_io_credit()

M0_INTERNAL void m0_stob_io_credit ( const struct m0_stob_io io,
const struct m0_stob_domain dom,
struct m0_be_tx_credit accum 
)

Calculates BE tx credit for stob I/O operation.

Parameters
ioDefines operation. Only some fields should be filled. At least m0_stob_io::si_opcode, m0_stob_io::si_flags and m0_stob_io::si_stob.
Note
Only SIO_WRITE opcode is supported at the moment.

Definition at line 130 of file io.c.

Here is the caller graph for this function:

◆ m0_stob_io_fini()

M0_INTERNAL void m0_stob_io_fini ( struct m0_stob_io io)
Precondition
io->si_state == SIS_IDLE

Definition at line 122 of file io.c.

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

◆ m0_stob_io_init()

M0_INTERNAL void m0_stob_io_init ( struct m0_stob_io io)
Postcondition
io->si_state == SIS_IDLE

Definition at line 111 of file io.c.

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

◆ m0_stob_io_launch()

M0_INTERNAL int m0_stob_io_launch ( struct m0_stob_io io,
struct m0_stob obj,
struct m0_dtx tx,
struct m0_io_scope *  scope 
)
Precondition
obj->so_state == CSS_EXISTS
m0_chan_has_waiters(&io->si_wait)
io->si_state == SIS_PREPARED
io->si_opcode != SIO_INVALID
m0_vec_count(&io->si_user.ov_vec) == m0_vec_count(&io->si_stob.ov_vec)
m0_stob_io_user_is_valid(&io->si_user)
m0_stob_io_stob_is_valid(&io->si_stob)
Postcondition
ergo(result != 0, io->si_state == SIS_IDLE)
Note
IO can be already completed by the time m0_stob_io_launch() finishes. Because of this no post-conditions for io->si_state are imposed in the successful return case.

Definition at line 192 of file io.c.

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

◆ m0_stob_io_prepare()

M0_INTERNAL int m0_stob_io_prepare ( struct m0_stob_io io,
struct m0_stob obj,
struct m0_dtx tx,
struct m0_io_scope *  scope 
)
Precondition
obj->so_state == CSS_EXISTS
m0_chan_has_waiters(&io->si_wait)
io->si_state == SIS_IDLE
io->si_opcode != SIO_INVALID
m0_vec_count(&io->si_user.ov_vec) == m0_vec_count(&io->si_stob.ov_vec)
m0_stob_io_user_is_valid(&io->si_user)
m0_stob_io_stob_is_valid(&io->si_stob)
Postcondition
ergo(result != 0, io->si_state == SIS_IDLE)

Definition at line 155 of file io.c.

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

◆ m0_stob_io_prepare_and_launch()

M0_INTERNAL int m0_stob_io_prepare_and_launch ( struct m0_stob_io io,
struct m0_stob obj,
struct m0_dtx tx,
struct m0_io_scope *  scope 
)
See also
m0_stob_io_prepare() and m0_stob_io_launch().

Definition at line 219 of file io.c.

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

◆ m0_stob_io_private_fini()

static void m0_stob_io_private_fini ( struct m0_stob_io io)
static

Definition at line 41 of file io.c.

Here is the caller graph for this function:

◆ m0_stob_io_private_setup()

M0_INTERNAL int m0_stob_io_private_setup ( struct m0_stob_io io,
struct m0_stob obj 
)

On success, ensures that io->si_stob_private is setup to launch IO against the object "obj".

Definition at line 49 of file io.c.

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

◆ m0_stob_io_stob_is_valid()

M0_INTERNAL bool m0_stob_io_stob_is_valid ( const struct m0_indexvec stob)

Returns true if stob is a valid vector of target IO extents.

Definition at line 235 of file io.c.

Here is the caller graph for this function:

◆ m0_stob_io_user_is_valid()

M0_INTERNAL bool m0_stob_io_user_is_valid ( const struct m0_bufvec user)

Returns true if user is a valid vector of user IO buffers.

Definition at line 230 of file io.c.

Here is the caller graph for this function:

◆ m0_stob_iovec_sort()

M0_INTERNAL void m0_stob_iovec_sort ( struct m0_stob_io stob)

Sorts index vecs from stob. It also move buffer vecs while sorting.

Parameters
stobstorage object from which index vecs needs to sort.

Definition at line 311 of file io.c.

Here is the caller graph for this function:

◆ m0_stob_locate()

M0_INTERNAL int m0_stob_locate ( struct m0_stob stob)

Locates the stob on the storage, fetching its attributes.

Precondition
stob->so_ref > 0
stob->so_state == CSS_UNKNOWN
Postcondition
ergo(rc == 0, M0_IN(m0_stob_state_get(stob), (CSS_EXISTS, CSS_NOENT)))

Definition at line 128 of file stob.c.

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

◆ m0_stob_lookup()

M0_INTERNAL int m0_stob_lookup ( const struct m0_stob_id id,
struct m0_stob **  out 
)

The same as m0_stob_find() but without m0_stob allocation.

Definition at line 119 of file stob.c.

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

◆ m0_stob_lookup_by_key()

M0_INTERNAL int m0_stob_lookup_by_key ( struct m0_stob_domain dom,
const struct m0_fid stob_fid,
struct m0_stob **  out 
)

Definition at line 102 of file stob.c.

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

◆ m0_stob_mod_fini()

M0_INTERNAL void m0_stob_mod_fini ( void  )

Definition at line 373 of file stob.c.

◆ m0_stob_mod_init()

M0_INTERNAL int m0_stob_mod_init ( void  )

Definition at line 367 of file stob.c.

◆ m0_stob_module__get()

M0_INTERNAL struct m0_stob_module* m0_stob_module__get ( void  )

Definition at line 49 of file module.c.

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

◆ m0_stob_punch()

M0_INTERNAL int m0_stob_punch ( struct m0_stob stob,
struct m0_indexvec range,
struct m0_dtx dtx 
)

Punches a hole within a stob at specified 'range'

Definition at line 232 of file stob.c.

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

◆ m0_stob_punch_credit()

M0_INTERNAL int m0_stob_punch_credit ( struct m0_stob stob,
struct m0_indexvec want,
struct m0_indexvec got,
struct m0_be_tx_credit accum 
)

Calculates BE tx credit for m0_stob_punch operation. The method of credits calculation is similar to m0_stob_destroy_credit operation, except for punch_credit, the credits are calculated only for the range of segments provided by user.

Definition at line 223 of file stob.c.

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

◆ m0_stob_put()

M0_INTERNAL void m0_stob_put ( struct m0_stob stob)

Releases reference to the stob.

When the last reference is released, the object can be either returned to the cache or immediately freed at the storage object domain discretion. A cached object can be freed at any time.

Definition at line 291 of file stob.c.

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

◆ m0_stob_state_get()

M0_INTERNAL enum m0_stob_state m0_stob_state_get ( struct m0_stob stob)

Returns stob state.

See also
m0_stob_state

Definition at line 265 of file stob.c.

Here is the caller graph for this function:

◆ m0_stob_type__dom_add()

M0_INTERNAL void m0_stob_type__dom_add ( struct m0_stob_type type,
struct m0_stob_domain dom 
)

Adds domain to the list of domains in the stob type.

Note
This function is used by generic stob domain code.
See also
m0_stob_type__dom_del(), m0_stob_type__dom_find().

Definition at line 174 of file type.c.

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

◆ m0_stob_type__dom_del()

M0_INTERNAL void m0_stob_type__dom_del ( struct m0_stob_type type,
struct m0_stob_domain dom 
)

Removes previously added domain from the list of domains in the stob type.

Note
This function is used by generic stob domain code.
See also
m0_stob_type__dom_add(), m0_stob_type__dom_find().

Definition at line 182 of file type.c.

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

◆ m0_stob_type__dom_find()

M0_INTERNAL struct m0_stob_domain * m0_stob_type__dom_find ( struct m0_stob_type type,
const struct m0_fid dom_id 
)

Finds previously added domain in the list of domains in the stob type.

Note
This function is used by generic stob domain code.
See also
m0_stob_type__dom_add(), m0_stob_type__dom_del(), m0_stob_type__dom_find_by_location().

Definition at line 191 of file type.c.

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

◆ m0_stob_type__dom_find_by_location()

M0_INTERNAL struct m0_stob_domain * m0_stob_type__dom_find_by_location ( struct m0_stob_type type,
const char *  location 
)

The same as m0_stob_type__dom_find(), but it performs search by domain location.

See also
m0_stob_type__dom_find().

Definition at line 204 of file type.c.

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

◆ m0_stob_type_by_dom_id()

M0_INTERNAL struct m0_stob_type * m0_stob_type_by_dom_id ( const struct m0_fid id)

Gets stob type by domain id.

Definition at line 122 of file type.c.

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

◆ m0_stob_type_by_name()

M0_INTERNAL struct m0_stob_type * m0_stob_type_by_name ( const char *  name)

Gets stob type by name.

Definition at line 131 of file type.c.

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

◆ m0_stob_type_deregister()

M0_INTERNAL void m0_stob_type_deregister ( struct m0_stob_type type)

Deregisters stob type

Definition at line 155 of file type.c.

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

◆ m0_stob_type_id_by_name()

M0_INTERNAL uint8_t m0_stob_type_id_by_name ( const char *  name)

Gets stob type id by name.

Definition at line 139 of file type.c.

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

◆ m0_stob_type_id_get()

M0_INTERNAL uint8_t m0_stob_type_id_get ( const struct m0_stob_type type)

Gets stob type id for the given stob type.

Definition at line 164 of file type.c.

Here is the caller graph for this function:

◆ m0_stob_type_name_get()

M0_INTERNAL const char * m0_stob_type_name_get ( struct m0_stob_type type)

Gets stob type name for the given stob type.

Definition at line 169 of file type.c.

Here is the caller graph for this function:

◆ m0_stob_type_register()

M0_INTERNAL void m0_stob_type_register ( struct m0_stob_type type)

Registers new stob type.

Precondition
type->st_fidt was not registered before for m0 instance

Definition at line 144 of file type.c.

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

◆ m0_stob_types_fini()

M0_INTERNAL void m0_stob_types_fini ( void  )

Definition at line 115 of file type.c.

Here is the call graph for this function:

◆ m0_stob_types_init()

M0_INTERNAL int m0_stob_types_init ( void  )

Definition at line 94 of file type.c.

Here is the call graph for this function:

◆ m0_stob_ut_ad_fini()

void m0_stob_ut_ad_fini ( struct m0_be_ut_backend ut_be,
struct m0_be_ut_seg ut_seg 
)

Definition at line 106 of file ad.c.

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

◆ m0_stob_ut_ad_init()

void m0_stob_ut_ad_init ( struct m0_be_ut_backend ut_be,
struct m0_be_ut_seg ut_seg,
bool  use_small_credits 
)

Definition at line 82 of file ad.c.

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

◆ m0_stob_ut_adieu_ad()

void m0_stob_ut_adieu_ad ( void  )

Definition at line 607 of file ad.c.

Here is the call graph for this function:

◆ m0_stob_ut_adieu_linux()

void m0_stob_ut_adieu_linux ( void  )

Definition at line 294 of file adieu.c.

Here is the call graph for this function:

◆ m0_stob_ut_adieu_perf()

void m0_stob_ut_adieu_perf ( void  )

Definition at line 304 of file adieu.c.

Here is the call graph for this function:

◆ M0_TL_DEFINE() [1/2]

M0_TL_DEFINE ( domains  ,
static  ,
struct m0_stob_domain   
)

◆ M0_TL_DEFINE() [2/2]

M0_TL_DEFINE ( types  ,
static  ,
struct m0_stob_type   
)

◆ M0_TL_DESCR_DEFINE() [1/2]

M0_TL_DESCR_DEFINE ( domains  ,
"stob domains"  ,
static  ,
struct m0_stob_domain  ,
sd_domain_linkage  ,
sd_magic  ,
M0_STOB_DOMAINS_MAGIC  ,
M0_STOB_DOMAINS_HEAD_MAGIC   
)

◆ M0_TL_DESCR_DEFINE() [2/2]

M0_TL_DESCR_DEFINE ( types  ,
"stob types"  ,
static  ,
struct m0_stob_type  ,
st_type_linkage  ,
st_magic  ,
M0_STOB_TYPES_MAGIC  ,
M0_STOB_TYPES_HEAD_MAGIC   
)

◆ M0_XCA_DOMAIN() [1/2]

struct m0_stob_ioq_error M0_XCA_DOMAIN ( rpc  )

◆ M0_XCA_DOMAIN() [2/2]

struct m0_stob_id M0_XCA_DOMAIN ( be rpc)

◆ malloc_reserve_extent()

static int malloc_reserve_extent ( struct m0_ad_balloc ballroom,
struct m0_be_tx tx,
struct m0_ext ext,
uint64_t  alloc_zone 
)
static

Definition at line 158 of file ad.c.

◆ mock_balloc_alloc()

static int mock_balloc_alloc ( struct m0_ad_balloc ballroom,
struct m0_dtx dtx,
m0_bcount_t  count,
struct m0_ext out,
uint64_t  alloc_type 
)
static

Definition at line 132 of file ad.c.

Here is the call graph for this function:

◆ mock_balloc_fini()

static void mock_balloc_fini ( struct m0_ad_balloc ballroom)
static

Definition at line 128 of file ad.c.

◆ mock_balloc_free()

static int mock_balloc_free ( struct m0_ad_balloc ballroom,
struct m0_dtx dtx,
struct m0_ext ext 
)
static

Definition at line 150 of file ad.c.

◆ mock_balloc_init()

static int mock_balloc_init ( struct m0_ad_balloc ballroom,
struct m0_be_seg seg,
uint32_t  bshift,
m0_bindex_t  container_size,
m0_bcount_t  groupsize,
m0_bcount_t  spare_reserve 
)
static

Definition at line 118 of file ad.c.

◆ punch_test()

static void punch_test ( void  )
static

PUNCH test.

Definition at line 551 of file ad.c.

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

◆ stob_domain_cache_evict_cb()

static void stob_domain_cache_evict_cb ( struct m0_stob_cache cache,
struct m0_stob stob 
)
static

Definition at line 91 of file domain.c.

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

◆ stob_domain_create()

static int stob_domain_create ( struct m0_stob_type type,
const char *  location_data,
uint64_t  dom_key,
const char *  str_cfg_create 
)
static

Definition at line 97 of file domain.c.

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

◆ stob_domain_init()

static int stob_domain_init ( struct m0_stob_type type,
const char *  location_data,
const char *  str_cfg_init,
struct m0_stob_domain **  out 
)
static

Definition at line 116 of file domain.c.

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

◆ stob_domain_init_create()

static int stob_domain_init_create ( const char *  location,
const char *  str_cfg_init,
uint64_t  dom_key,
const char *  str_cfg_create,
struct m0_stob_domain **  out,
bool  init 
)
static

Definition at line 136 of file domain.c.

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

◆ stob_domain_location_data()

static char* stob_domain_location_data ( const char *  location)
static

Definition at line 79 of file domain.c.

Here is the caller graph for this function:

◆ stob_domain_type()

static int stob_domain_type ( const char *  location,
struct m0_stob_type **  type 
)
static

Definition at line 54 of file domain.c.

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

◆ stob_io_addb2_add_and_push()

static void stob_io_addb2_add_and_push ( uint64_t  id,
struct m0_stob_io io,
struct m0_stob obj 
)
static

Definition at line 66 of file io.c.

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

◆ stob_io_fill()

static void stob_io_fill ( struct m0_stob_io io,
struct m0_stob obj,
struct m0_dtx tx,
struct m0_io_scope *  scope,
enum m0_stob_io_state  state,
bool  count_update 
)
static

Definition at line 138 of file io.c.

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

◆ stob_io_invariant()

static bool stob_io_invariant ( struct m0_stob_io io,
struct m0_stob obj,
enum m0_stob_io_state  state 
)
static

Definition at line 94 of file io.c.

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

◆ stob_type_copy()

static int stob_type_copy ( const struct m0_stob_type type,
struct m0_stob_type **  copy 
)
static

Definition at line 69 of file type.c.

Here is the caller graph for this function:

◆ stob_types_destroy_list()

static void stob_types_destroy_list ( struct m0_stob_types types)
static

Definition at line 77 of file type.c.

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

◆ stob_types_get()

static struct m0_stob_types* stob_types_get ( void  )
static

Definition at line 89 of file type.c.

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

◆ test_ad()

static void test_ad ( void  )
static

AD unit-test.

Definition at line 531 of file ad.c.

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

◆ test_ad_fini()

static int test_ad_fini ( void  )
static

Definition at line 283 of file ad.c.

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

◆ test_ad_init()

static int test_ad_init ( bool  use_small_credits)
static

Definition at line 208 of file ad.c.

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

◆ test_ad_rw_unordered()

static void test_ad_rw_unordered ( )
static

Definition at line 491 of file ad.c.

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

◆ test_ad_undo()

static void test_ad_undo ( void  )
static

Definition at line 566 of file ad.c.

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

◆ test_adieu()

static void test_adieu ( const char *  path)
static

Adieu unit-test.

Definition at line 256 of file adieu.c.

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

◆ test_adieu_fini()

static void test_adieu_fini ( void  )
static

Definition at line 149 of file adieu.c.

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

◆ test_adieu_init()

static int test_adieu_init ( const char *  location,
const char *  dom_cfg,
const char *  stob_cfg 
)
static

Definition at line 83 of file adieu.c.

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

◆ test_punch()

static void test_punch ( int  nr)
static

Definition at line 418 of file ad.c.

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

◆ test_read()

static void test_read ( int  nr)
static

Definition at line 379 of file ad.c.

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

◆ test_write() [1/2]

static void test_write ( int  i)
static

Definition at line 170 of file adieu.c.

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

◆ test_write() [2/2]

static void test_write ( int  nr,
struct m0_dtx tx 
)
static

Definition at line 310 of file ad.c.

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

◆ ub_fini()

static void ub_fini ( void  )
static

Definition at line 641 of file ad.c.

Here is the call graph for this function:

◆ ub_init()

static int ub_init ( const char *opts  M0_UNUSED)
static

Definition at line 636 of file ad.c.

Here is the call graph for this function:

◆ ub_iovec_init()

static void ub_iovec_init ( )
static

Definition at line 332 of file adieu.c.

Here is the call graph for this function:

◆ ub_iovec_invert()

static void ub_iovec_invert ( )
static

Definition at line 353 of file adieu.c.

Here is the caller graph for this function:

◆ ub_iovec_sort()

static void ub_iovec_sort ( )
static

Definition at line 372 of file adieu.c.

Here is the call graph for this function:

◆ ub_iovec_sort_invert()

static void ub_iovec_sort_invert ( )
static

Definition at line 377 of file adieu.c.

Here is the call graph for this function:

◆ ub_read()

static void ub_read ( int  i)
static

Definition at line 631 of file ad.c.

Here is the call graph for this function:

◆ ub_write()

static void ub_write ( int  i)
static

Definition at line 626 of file ad.c.

Here is the call graph for this function:

Variable Documentation

◆ block_shift [1/2]

uint32_t block_shift
static

Definition at line 74 of file ad.c.

◆ block_shift [2/2]

uint32_t block_shift
static

Definition at line 80 of file adieu.c.

◆ buf_size [1/2]

uint32_t buf_size
static

Definition at line 75 of file ad.c.

◆ buf_size [2/2]

uint32_t buf_size
static

Definition at line 81 of file adieu.c.

◆ clink [1/2]

struct m0_clink clink
static

Definition at line 70 of file ad.c.

◆ clink [2/2]

struct m0_clink clink
static

Definition at line 78 of file adieu.c.

◆ dom

struct m0_stob_domain* dom
static

Definition at line 65 of file adieu.c.

◆ dom_back

struct m0_stob_domain* dom_back
static

Definition at line 55 of file ad.c.

◆ dom_fore

struct m0_stob_domain* dom_fore
static

Definition at line 56 of file ad.c.

◆ f

FILE* f
static

Definition at line 79 of file adieu.c.

◆ g_tx

struct m0_dtx g_tx
static

Definition at line 71 of file ad.c.

◆ io [1/2]

struct m0_stob_io io
static

Definition at line 59 of file ad.c.

◆ io [2/2]

struct m0_stob_io io
static

Definition at line 69 of file adieu.c.

◆ linux_location

const char linux_location[] = "linuxstob:./__s"
static
Todo:
move vars to a context

Definition at line 63 of file adieu.c.

◆ linux_path

const char linux_path[] = "./__s/o/100000000000000:2"
static

Definition at line 67 of file adieu.c.

◆ m0_ad_ub

struct m0_ub_set m0_ad_ub
Initial value:
= {
.us_name = "ad-ub",
.us_init = ub_init,
.us_fini = ub_fini,
.us_run = {
{ .ub_name = "write-prime",
.ub_iter = 1,
.ub_round = ub_write },
{ .ub_name = "write",
.ub_iter = UB_ITER,
.ub_round = ub_write },
{ .ub_name = "read",
.ub_iter = UB_ITER,
.ub_round = ub_read },
{ .ub_name = NULL }
}
}
#define NULL
Definition: misc.h:38
static void ub_fini(void)
Definition: ad.c:641
static void ub_read(int i)
Definition: ad.c:631
static void ub_write(int i)
Definition: ad.c:626
Definition: ad.c:646
static int ub_init(const char *opts M0_UNUSED)
Definition: ad.c:636

Definition at line 648 of file ad.c.

◆ m0_adieu_ub

struct m0_ub_set m0_adieu_ub

Definition at line 398 of file adieu.c.

◆ m0_stob_null_type

const struct m0_stob_type m0_stob_null_type

Definition at line 87 of file null.c.

◆ M0_XCA_DOMAIN

struct m0_stob M0_XCA_DOMAIN

◆ M0_XCA_ENUM

enum m0_addb2_stio_req_labels M0_XCA_ENUM

◆ mb

struct mock_balloc mb
Initial value:
= {
.mb_next = 0,
.mb_ballroom = {
.ab_ops = &mock_balloc_ops
}
}
static const struct m0_ad_balloc_ops mock_balloc_ops
Definition: ad.c:165

Definition at line 173 of file ad.c.

◆ mock_balloc_ops

const struct m0_ad_balloc_ops mock_balloc_ops
static
Initial value:
= {
.bo_init = mock_balloc_init,
.bo_fini = mock_balloc_fini,
.bo_alloc = mock_balloc_alloc,
.bo_free = mock_balloc_free,
.bo_reserve_extent = malloc_reserve_extent,
}
static int mock_balloc_init(struct m0_ad_balloc *ballroom, struct m0_be_seg *seg, uint32_t bshift, m0_bindex_t container_size, m0_bcount_t groupsize, m0_bcount_t spare_reserve)
Definition: ad.c:118
static void mock_balloc_fini(struct m0_ad_balloc *ballroom)
Definition: ad.c:128
static int malloc_reserve_extent(struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)
Definition: ad.c:158
static int mock_balloc_free(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, struct m0_ext *ext)
Definition: ad.c:150
static int mock_balloc_alloc(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_type)
Definition: ad.c:132

Definition at line 165 of file ad.c.

◆ obj

struct m0_stob* obj
static

Definition at line 66 of file adieu.c.

◆ obj_back

struct m0_stob* obj_back
static

Definition at line 57 of file ad.c.

◆ obj_fore

struct m0_stob* obj_fore
static

Definition at line 58 of file ad.c.

◆ perf_location

const char perf_location[] = "perfstob:./__s"
static

Definition at line 64 of file adieu.c.

◆ perf_path

const char perf_path[] = "./__s/backstore/o/100000000000000:2"
static

Definition at line 68 of file adieu.c.

◆ read_buf [1/2]

char* read_buf[NR]
static

Definition at line 64 of file ad.c.

◆ read_buf [2/2]

char* read_buf[NR]
static

Definition at line 73 of file adieu.c.

◆ read_bufs [1/2]

char* read_bufs[NR]
static

Definition at line 68 of file ad.c.

◆ read_bufs [2/2]

char* read_bufs[NR]
static

Definition at line 76 of file adieu.c.

◆ read_cksm_buf [1/2]

char* read_cksm_buf[NR]
static

Definition at line 65 of file ad.c.

◆ read_cksm_buf [2/2]

char* read_cksm_buf[NR]
static

Definition at line 74 of file adieu.c.

◆ sc_busy

struct m0_tl sc_busy

Definition at line 51 of file cache.h.

◆ sc_busy_hits

uint64_t sc_busy_hits

Definition at line 57 of file cache.h.

◆ sc_eviction_cb

Definition at line 55 of file cache.h.

◆ sc_evictions

uint64_t sc_evictions

Definition at line 60 of file cache.h.

◆ sc_idle

struct m0_tl sc_idle

Definition at line 52 of file cache.h.

◆ sc_idle_hits

uint64_t sc_idle_hits

Definition at line 58 of file cache.h.

◆ sc_idle_size

uint64_t sc_idle_size

Definition at line 53 of file cache.h.

◆ sc_idle_used

uint64_t sc_idle_used

Definition at line 54 of file cache.h.

◆ sc_lock

struct m0_mutex sc_lock

Definition at line 50 of file cache.h.

◆ sc_misses

uint64_t sc_misses

Definition at line 59 of file cache.h.

◆ si_battr

struct m0_bufvec si_battr

A sequence of block attributes. Each element of this sequence is an array of N 64-bit values, where N is the number of block attributes used for this stob (i.e., number of 1-s in binary mask passed to ->sop_battr_set()).

For write, elements of this sequence are associated with the matching written blocks.

For read, the sequence is populated with the block attributes of read blocks.

Definition at line 403 of file io.h.

◆ si_cksum

struct m0_buf si_cksum

Definition at line 412 of file io.h.

◆ si_cksum_nob_read

m0_bcount_t si_cksum_nob_read

Definition at line 418 of file io.h.

◆ si_cksum_sz

m0_bcount_t si_cksum_sz

Definition at line 416 of file io.h.

◆ si_count

m0_bcount_t si_count

Number of blocks transferred between data pages and storage object.

This field is valid after IO completion has been signalled.

Definition at line 340 of file io.h.

◆ si_flags

enum m0_stob_io_flags si_flags

Flags with which this IO operation is queued.

Definition at line 290 of file io.h.

◆ si_fol_frag

struct m0_fol_frag* si_fol_frag

FOL record part representing operations on storage object.

Definition at line 390 of file io.h.

◆ si_id

uint64_t si_id

Definition at line 406 of file io.h.

◆ si_mutex

struct m0_mutex si_mutex

si_wait chan protection

Definition at line 319 of file io.h.

◆ si_obj

struct m0_stob* si_obj

Storage object this operation is against.

Definition at line 326 of file io.h.

◆ si_op

const struct m0_stob_io_op* si_op

operation vector

Definition at line 328 of file io.h.

◆ si_opcode

enum m0_stob_io_opcode si_opcode

Definition at line 286 of file io.h.

◆ si_rc

int32_t si_rc

Result code.

This field is valid after IO completion has been signalled.

Definition at line 334 of file io.h.

◆ si_scope

struct m0_io_scope* si_scope

IO scope (resource accounting group) this IO operation is a part of.

Definition at line 355 of file io.h.

◆ si_start

m0_time_t si_start

IO launch time.

Definition at line 405 of file io.h.

◆ si_state

enum m0_stob_io_state si_state

State of IO operation. See state diagram for adieu. State transition from SIS_BUSY to SIS_IDLE is asynchronous for adieu user.

Definition at line 345 of file io.h.

◆ si_stob

struct m0_indexvec si_stob

Where data are located in the storage object name-space.

Segments in si_stob must be non-overlapping and go in increasing offset order.

Note
extent sizes in m0_stob_io::si_stob.iv_vec.v_count[] and extent offsets in m0_stob_io::si_stob.ov_index[] are in block size units (as determined by m0_stob_op::sop_block_shift).

Definition at line 311 of file io.h.

◆ si_stob_magic

uint32_t si_stob_magic

Stob type magic used to detect when m0_stob_io::si_stob_private can be re-used.

This field is set to the value of m0_stob_type::st_magic when m0_stob_io::si_stob_private is allocated. When the same m0_stob_io is used to queue IO again, the magic is compared against type magic of the target storage object. If magic differs (meaning that previous IO was against an object of different type), implementation private data at m0_stob_io::si_stob_private are freed and new private data are allocated. Otherwise, old private data are re-used.

See also
m0_stob_io::si_stob_private
Note
magic number is used instead of a pointer to a storage object or storage object class, to avoid pinning them for undefined amount of time.
currently it is equal to stob type id

Definition at line 388 of file io.h.

◆ si_stob_private

void* si_stob_private

Pointer to implementation private data associated with the IO operation.

This pointer is initialized when m0_stob_io is queued for the first time. When IO completes, the memory allocated by implementation is not immediately freed (the implementation is still guaranteed to never touch this memory while m0_stob_io is owned by a user).

See also
m0_stob_io::si_stob_magic

Definition at line 367 of file io.h.

◆ si_tx

struct m0_dtx* si_tx

Distributed transaction this IO operation is part of.

This field is owned by the adieu implementation.

Definition at line 351 of file io.h.

◆ si_unit_sz

m0_bindex_t si_unit_sz

Definition at line 414 of file io.h.

◆ si_user

struct m0_bufvec si_user

Where data are located in the user address space.

Note
buffer sizes in m0_stob_io::si_user.ov_vec.v_count[] are in block size units (as determined by m0_stob_op::sop_block_shift). Buffer addresses in m0_stob_io::si_user.ov_buf[] must be shifted block-shift bits to the left.

Definition at line 300 of file io.h.

◆ si_wait

struct m0_chan si_wait

Channel where IO operation completion is signalled.

Note
alternatively a channel embedded in every state machine can be used.

Definition at line 318 of file io.h.

◆ sio_fini

void(* sio_fini) (struct m0_stob_io *io)

Called by m0_stob_io_fini() to finalize implementation resources.

Also called when the same m0_stob_io is re-used for a different type of IO.

See also
m0_stob_io_private_fini().

Definition at line 430 of file io.h.

◆ sio_launch

int(* sio_launch) (struct m0_stob_io *io)

Called by m0_stob_io_launch() to queue IO operation.

Note
This method releases lock before successful returning.
Precondition
io->si_state == SIS_BUSY
Postcondition
ergo(result != 0, io->si_state == SIS_IDLE)

Definition at line 439 of file io.h.

◆ sio_prepare

int(* sio_prepare) (struct m0_stob_io *io)

Called by m0_stob_io_prepare() to capture metadata accroding to internal logic.

Precondition
io->si_state == SIS_PREPARED
Postcondition
ergo(result != 0, io->si_state == SIS_BUSY)

Definition at line 447 of file io.h.

◆ stob_types_reg

const struct m0_stob_type* stob_types_reg[]
static
Initial value:
= {
}
const struct m0_stob_type m0_stob_perf_type
Definition: perf.c:924
const struct m0_stob_type m0_stob_ad_type
Definition: ad.c:1003
const struct m0_stob_type m0_stob_null_type
Definition: null.c:87
const struct m0_stob_type m0_stob_linux_type
Definition: linux.c:86

Definition at line 50 of file type.c.

◆ stob_vc

m0_bcount_t stob_vc[NR]
static

Definition at line 61 of file ad.c.

◆ stob_vec

m0_bindex_t stob_vec[NR]
static

Definition at line 77 of file adieu.c.

◆ stob_vec1

m0_bindex_t stob_vec1[NR_SORT]
static

Definition at line 330 of file adieu.c.

◆ stob_vi

m0_bindex_t stob_vi[NR]
static

Definition at line 69 of file ad.c.

◆ user_buf [1/2]

char* user_buf[NR]
static

Definition at line 62 of file ad.c.

◆ user_buf [2/2]

char* user_buf[NR]
static

Definition at line 71 of file adieu.c.

◆ user_bufs [1/2]

char* user_bufs[NR]
static

Definition at line 67 of file ad.c.

◆ user_bufs [2/2]

char* user_bufs[NR]
static

Definition at line 75 of file adieu.c.

◆ user_bufs1

char* user_bufs1[NR_SORT]
static

Definition at line 329 of file adieu.c.

◆ user_cksm_buf [1/2]

char* user_cksm_buf[NR]
static

Definition at line 63 of file ad.c.

◆ user_cksm_buf [2/2]

char* user_cksm_buf[NR]
static

Definition at line 72 of file adieu.c.

◆ user_vc

m0_bcount_t user_vc[NR]
static

Definition at line 60 of file ad.c.

◆ user_vec

m0_bcount_t user_vec[NR]
static

Definition at line 70 of file adieu.c.

◆ user_vec1

m0_bcount_t user_vec1[NR_SORT]
static

Definition at line 328 of file adieu.c.

◆ ut_be

struct m0_be_ut_backend ut_be

Definition at line 72 of file ad.c.

◆ ut_seg

struct m0_be_ut_seg ut_seg

Definition at line 73 of file ad.c.

◆ zero_buf

char* zero_buf[NR]
static

Definition at line 66 of file ad.c.