Motr  M0
Storage object based on Linux specific file system

Data Structures

struct  ioq_qev
 
struct  stob_linux_io
 
struct  m0_stob_ioq
 
struct  m0_stob_linux_domain_cfg
 
struct  m0_stob_linux_domain
 
struct  m0_stob_linux
 

Enumerations

enum  { STOB_IOQ_BSHIFT = 12, STOB_IOQ_BSIZE = 1 << STOB_IOQ_BSHIFT, STOB_IOQ_BMASK = STOB_IOQ_BSIZE - 1 }
 
enum  { M0_STOB_IOQ_NR_THREADS = 8, M0_STOB_IOQ_RING_SIZE = 1024, M0_STOB_IOQ_BATCH_IN_SIZE = 8, M0_STOB_IOQ_BATCH_OUT_SIZE = 8 }
 
enum  { STOB_TYPE_LINUX = 0x01 }
 

Functions

static struct ioq_qevioq_queue_get (struct m0_stob_ioq *ioq)
 
static void ioq_queue_put (struct m0_stob_ioq *ioq, struct ioq_qev *qev)
 
static void ioq_queue_submit (struct m0_stob_ioq *ioq)
 
static void ioq_queue_lock (struct m0_stob_ioq *ioq)
 
static void ioq_queue_unlock (struct m0_stob_ioq *ioq)
 
M0_INTERNAL int m0_stob_linux_io_init (struct m0_stob *stob, struct m0_stob_io *io)
 
static void stob_linux_io_release (struct stob_linux_io *lio)
 
static void stob_linux_io_fini (struct m0_stob_io *io)
 
static int stob_linux_io_launch (struct m0_stob_io *io)
 
static void ioq_io_error (struct m0_stob_ioq *ioq, struct ioq_qev *qev)
 
static void ioq_complete (struct m0_stob_ioq *ioq, struct ioq_qev *qev, long res, long res2)
 
static unsigned long stob_ioq_timer_cb (unsigned long data)
 
static int stob_ioq_thread_init (struct m0_stob_ioq *ioq)
 
static void stob_ioq_thread (struct m0_stob_ioq *ioq)
 
M0_INTERNAL int m0_stob_ioq_init (struct m0_stob_ioq *ioq)
 
M0_INTERNAL void m0_stob_ioq_fini (struct m0_stob_ioq *ioq)
 
M0_INTERNAL uint32_t m0_stob_ioq_bshift (struct m0_stob_ioq *ioq)
 
M0_INTERNAL m0_bcount_t m0_stob_ioq_bsize (struct m0_stob_ioq *ioq)
 
M0_INTERNAL m0_bcount_t m0_stob_ioq_bmask (struct m0_stob_ioq *ioq)
 
M0_INTERNAL bool m0_stob_ioq_directio (struct m0_stob_ioq *ioq)
 
M0_INTERNAL void m0_stob_ioq_directio_setup (struct m0_stob_ioq *ioq, bool use_directio)
 
static void stob_linux_type_register (struct m0_stob_type *type)
 
static void stob_linux_type_deregister (struct m0_stob_type *type)
 
M0_INTERNAL struct m0_stob_linuxm0_stob_linux_container (struct m0_stob *stob)
 
M0_INTERNAL struct m0_stob_linux_domainm0_stob_linux_domain_container (struct m0_stob_domain *dom)
 
static char * stob_linux_vsnprintf (const char *format,...)
 
static char * stob_linux_dir_domain (const char *path)
 
static char * stob_linux_dir_stob (const char *path)
 
static char * stob_linux_file_domain_id (const char *path)
 
static char * stob_linux_file_stob (const char *path, const struct m0_fid *stob_fid)
 
static int stob_linux_domain_key_get_set (const char *path, uint64_t *dom_key, bool get)
 
static int stob_linux_domain_cfg_init_parse (const char *str_cfg_init, void **cfg_init)
 
static void stob_linux_domain_cfg_init_free (void *cfg_init)
 
static int stob_linux_domain_cfg_create_parse (const char *str_cfg_create, void **cfg_create)
 
static void stob_linux_domain_cfg_create_free (void *cfg_create)
 
static int stob_linux_domain_init (struct m0_stob_type *type, const char *location_data, void *cfg_init, struct m0_stob_domain **out)
 
static void stob_linux_domain_fini (struct m0_stob_domain *dom)
 
static int stob_linux_domain_create_destroy (struct m0_stob_type *type, const char *path, uint64_t dom_key, void *cfg, bool create)
 
static int stob_linux_domain_create (struct m0_stob_type *type, const char *location_data, uint64_t dom_key, void *cfg_create)
 
static int stob_linux_domain_destroy (struct m0_stob_type *type, const char *location_data)
 
static struct m0_stobstob_linux_alloc (struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
 
static void stob_linux_free (struct m0_stob_domain *dom, struct m0_stob *stob)
 
static int stob_linux_cfg_parse (const char *str_cfg_create, void **cfg_create)
 
static void stob_linux_cfg_free (void *cfg_create)
 
static int stob_linux_stat (struct m0_stob_linux *lstob)
 
static int stob_linux_open (struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid, void *cfg, bool create)
 
static int stob_linux_init (struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
 
static void stob_linux_close (struct m0_stob_linux *lstob)
 
static void stob_linux_fini (struct m0_stob *stob)
 
static void stob_linux_create_credit (struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
 
static int stob_linux_create (struct m0_stob *stob, struct m0_stob_domain *dom, struct m0_dtx *dtx, const struct m0_fid *stob_fid, void *cfg)
 
static void stob_linux_destroy_credit (struct m0_stob *stob, struct m0_be_tx_credit *accum)
 
static int stob_linux_punch_credit (struct m0_stob *stob, struct m0_indexvec *want, struct m0_indexvec *got, struct m0_be_tx_credit *accum)
 
static int stob_linux_destroy (struct m0_stob *stob, struct m0_dtx *dtx)
 
static int stob_linux_punch (struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
 
static void stob_linux_write_credit (const struct m0_stob_domain *dom, const struct m0_stob_io *io, struct m0_be_tx_credit *accum)
 
static uint32_t stob_linux_block_shift (struct m0_stob *stob)
 
static int stob_linux_fd (struct m0_stob *stob)
 
M0_INTERNAL int m0_stob_linux_reopen (struct m0_stob_id *stob_id, const char *f_path)
 
M0_INTERNAL void m0_stob_linux_conf_sdev_associate (struct m0_stob *stob, const struct m0_fid *conf_sdev)
 
M0_INTERNAL int m0_stob_linux_domain_fd_get (struct m0_stob_domain *dom, int *fd)
 
M0_INTERNAL int m0_stob_linux_domain_fd_put (struct m0_stob_domain *dom, int fd)
 
M0_INTERNAL bool m0_stob_linux_domain_directio (struct m0_stob_domain *dom)
 

Variables

static const struct m0_stob_io_op stob_linux_io_op
 
int64_t emulate_disk_errors_nr = 0
 
static const struct timespec ioq_timeout_default
 
enum { ... }  M0_XCA_DOMAIN
 
const struct m0_stob_type m0_stob_linux_type
 
static struct m0_stob_type_ops stob_linux_type_ops
 
static struct m0_stob_domain_ops stob_linux_domain_ops
 
static struct m0_stob_ops stob_linux_ops
 
const struct m0_stob_type m0_stob_linux_type
 

Detailed Description

and block device interfaces.

See also
stob

Linux stob adieu

adieu implementation for Linux stob is based on Linux specific asynchronous IO interfaces: io_{setup,destroy,submit,cancel,getevents}().

IO admission control and queueing in Linux stob adieu are implemented on a storage object domain level, that is, each domain has its own set of queues, threads and thresholds.

On a high level, adieu IO request is first split into fragments. A fragment is initially placed into a per-domain queue (admission queue, linux_domain::ioq_queue) where it is held until there is enough space in the AIO ring buffer (linux_domain::ioq_ctx). Placing a fragment into the ring buffer (ioq_queue_submit()) means that kernel AIO is launched for it. When IO completes, the kernel delivers an IO completion event via the ring buffer.

A number (M0_STOB_IOQ_NR_THREADS by default) of worker adieu threads is created for each storage object domain. These threads are implementing admission control and completion notification, they

- listen for the AIO completion events in the ring buffer. When an AIO is
  completed, worker thread signals completion event to AIO users;

- when space becomes available in the ring buffer, a worker thread moves
  some number of pending fragments from the admission queue to the ring
  buffer.

Admission queue separate from the ring buffer is needed to

- be able to handle more pending fragments than a kernel can support and

- potentially do some pre-processing on the pending fragments (like
  elevator does).

Concurrency control

Per-domain data structures (queue, thresholds, etc.) are protected by linux_domain::ioq_mutex.

Concurrency control for an individual adieu fragment is very simple: user is not allowed to touch it in SIS_BUSY state and io_getevents() exactly-once delivery semantics guarantee that there is no concurrency for busy->idle transition. This nice picture would break apart if IO cancellation were to be implemented, because it requires synchronization between user actions (cancellation) and ongoing IO in SIS_BUSY state.

Todo:
use explicit state machine instead of ioq threads
See also
http://www.kernel.org/doc/man-pages/online/pages/man2/io_setup.2.html

Implementation of m0_stob on top of Linux files.

A linux storage object is simply a file on a local file system. A linux storage object domain is a directory containing

- data-base tables mapping storage object identifiers to local
  identifiers (not currently used) and

- a directory where files, corresponding to storage objects are stored
  in. A name of a file is built from the corresponding storage object
  local identifier (stob_ket).

A linux storage object domain is identified by the path to its directory.

When an in-memory representation for an object is created, no file system operations are performed. It is only when the object is "located" (m0_stob_locate()) or "created" (m0_stob_create()) when actual open(2) system call is made. If the call was successful, the file descriptor (m0_stob_linux::sl_fd) remains open until the object is destroyed.

Direct I/O

To enable directio for a stob domain you should specify "directio=true" somewhere in str_cfg_init for m0_stob_domain_init() or m0_stob_domain_create().

Symlinks

To make stob pointing to other file on the filesystem just pass filename as str_cfg to m0_stob_create() to create a symlink instead of a file.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
STOB_IOQ_BSHIFT 
STOB_IOQ_BSIZE 
STOB_IOQ_BMASK 

Definition at line 149 of file ioq.c.

◆ anonymous enum

anonymous enum
Enumerator
M0_STOB_IOQ_NR_THREADS 

Default number of threads to create in a storage object domain.

M0_STOB_IOQ_RING_SIZE 

Default size of a ring buffer shared by adieu and the kernel.

M0_STOB_IOQ_BATCH_IN_SIZE 

Size of a batch in which requests are moved from the admission queue to the ring buffer.

M0_STOB_IOQ_BATCH_OUT_SIZE 

Size of a batch in which completion events are extracted from the ring buffer.

Definition at line 47 of file ioq.h.

◆ anonymous enum

anonymous enum
Enumerator
STOB_TYPE_LINUX 

Definition at line 82 of file linux.c.

Function Documentation

◆ ioq_complete()

static void ioq_complete ( struct m0_stob_ioq ioq,
struct ioq_qev qev,
long  res,
long  res2 
)
static

Handles AIO completion event from the ring buffer.

When all fragments of a certain adieu request have completed, signals m0_stob_io::si_wait.

Definition at line 495 of file ioq.c.

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

◆ ioq_io_error()

static void ioq_io_error ( struct m0_stob_ioq ioq,
struct ioq_qev qev 
)
static

Handles detection of drive IO error by signalling HA.

Definition at line 434 of file ioq.c.

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

◆ ioq_queue_get()

static struct ioq_qev * ioq_queue_get ( struct m0_stob_ioq ioq)
static

Removes an element from the (non-empty) admission queue and returns it.

Definition at line 351 of file ioq.c.

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

◆ ioq_queue_lock()

static void ioq_queue_lock ( struct m0_stob_ioq ioq)
static

Definition at line 379 of file ioq.c.

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

◆ ioq_queue_put()

static void ioq_queue_put ( struct m0_stob_ioq ioq,
struct ioq_qev qev 
)
static

Adds an element to the admission queue.

Definition at line 367 of file ioq.c.

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

◆ ioq_queue_submit()

static void ioq_queue_submit ( struct m0_stob_ioq ioq)
static

Transfers fragments from the admission queue to the ring buffer in batches until the ring buffer is full.

Definition at line 393 of file ioq.c.

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

◆ ioq_queue_unlock()

static void ioq_queue_unlock ( struct m0_stob_ioq ioq)
static

Definition at line 384 of file ioq.c.

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

◆ m0_stob_ioq_bmask()

M0_INTERNAL m0_bcount_t m0_stob_ioq_bmask ( struct m0_stob_ioq ioq)

Definition at line 742 of file ioq.c.

Here is the caller graph for this function:

◆ m0_stob_ioq_bshift()

M0_INTERNAL uint32_t m0_stob_ioq_bshift ( struct m0_stob_ioq ioq)

Definition at line 732 of file ioq.c.

Here is the caller graph for this function:

◆ m0_stob_ioq_bsize()

M0_INTERNAL m0_bcount_t m0_stob_ioq_bsize ( struct m0_stob_ioq ioq)

Definition at line 737 of file ioq.c.

◆ m0_stob_ioq_directio()

M0_INTERNAL bool m0_stob_ioq_directio ( struct m0_stob_ioq ioq)

Definition at line 747 of file ioq.c.

Here is the caller graph for this function:

◆ m0_stob_ioq_directio_setup()

M0_INTERNAL void m0_stob_ioq_directio_setup ( struct m0_stob_ioq ioq,
bool  use_directio 
)

Definition at line 752 of file ioq.c.

Here is the caller graph for this function:

◆ m0_stob_ioq_fini()

M0_INTERNAL void m0_stob_ioq_fini ( struct m0_stob_ioq ioq)

Definition at line 716 of file ioq.c.

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

◆ m0_stob_ioq_init()

M0_INTERNAL int m0_stob_ioq_init ( struct m0_stob_ioq ioq)

Definition at line 686 of file ioq.c.

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

◆ m0_stob_linux_conf_sdev_associate()

M0_INTERNAL void m0_stob_linux_conf_sdev_associate ( struct m0_stob stob,
const struct m0_fid conf_sdev 
)

Associates linux stob with fid of a m0_conf_sdev object. This fid is sent to HA when stob I/O error is reported.

Definition at line 594 of file linux.c.

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

◆ m0_stob_linux_container()

M0_INTERNAL struct m0_stob_linux * m0_stob_linux_container ( struct m0_stob stob)

Definition at line 100 of file linux.c.

Here is the caller graph for this function:

◆ m0_stob_linux_domain_container()

M0_INTERNAL struct m0_stob_linux_domain * m0_stob_linux_domain_container ( struct m0_stob_domain dom)

Definition at line 106 of file linux.c.

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

◆ m0_stob_linux_domain_directio()

M0_INTERNAL bool m0_stob_linux_domain_directio ( struct m0_stob_domain dom)

Definition at line 628 of file linux.c.

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

◆ m0_stob_linux_domain_fd_get()

M0_INTERNAL int m0_stob_linux_domain_fd_get ( struct m0_stob_domain dom,
int *  fd 
)

Obtains file descriptor of a file which is stored on the same local filesystem where objects are.

Definition at line 604 of file linux.c.

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

◆ m0_stob_linux_domain_fd_put()

M0_INTERNAL int m0_stob_linux_domain_fd_put ( struct m0_stob_domain dom,
int  fd 
)

Closes previously obtained file descriptor.

Definition at line 621 of file linux.c.

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

◆ m0_stob_linux_io_init()

M0_INTERNAL int m0_stob_linux_io_init ( struct m0_stob stob,
struct m0_stob_io io 
)

Definition at line 161 of file ioq.c.

Here is the call graph for this function:

◆ m0_stob_linux_reopen()

M0_INTERNAL int m0_stob_linux_reopen ( struct m0_stob_id stob_id,
const char *  f_path 
)

Reopen the stob to update it's file descriptor. Find the stob from the provided stob_id and destroy it to get rid of the stale fd. Create the stob with provided path to reopen the underlying device, create will also update the stob with new fd.

Definition at line 554 of file linux.c.

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

◆ stob_ioq_thread()

static void stob_ioq_thread ( struct m0_stob_ioq ioq)
static

Linux adieu worker thread.

Listens to the completion events from the ring buffer. Delivers completion events to the users. Moves fragments from the admission queue to the ring buffer.

Definition at line 637 of file ioq.c.

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

◆ stob_ioq_thread_init()

static int stob_ioq_thread_init ( struct m0_stob_ioq ioq)
static

Definition at line 604 of file ioq.c.

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

◆ stob_ioq_timer_cb()

static unsigned long stob_ioq_timer_cb ( unsigned long  data)
static

Definition at line 596 of file ioq.c.

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

◆ stob_linux_alloc()

static struct m0_stob* stob_linux_alloc ( struct m0_stob_domain dom,
const struct m0_fid stob_fid 
)
static

Definition at line 336 of file linux.c.

◆ stob_linux_block_shift()

static uint32_t stob_linux_block_shift ( struct m0_stob stob)
static

Definition at line 534 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_cfg_free()

static void stob_linux_cfg_free ( void *  cfg_create)
static

Definition at line 359 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_cfg_parse()

static int stob_linux_cfg_parse ( const char *  str_cfg_create,
void **  cfg_create 
)
static

Definition at line 352 of file linux.c.

◆ stob_linux_close()

static void stob_linux_close ( struct m0_stob_linux lstob)
static

Definition at line 415 of file linux.c.

Here is the caller graph for this function:

◆ stob_linux_create()

static int stob_linux_create ( struct m0_stob stob,
struct m0_stob_domain dom,
struct m0_dtx dtx,
const struct m0_fid stob_fid,
void *  cfg 
)
static

Definition at line 438 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_create_credit()

static void stob_linux_create_credit ( struct m0_stob_domain dom,
struct m0_be_tx_credit accum 
)
static

Definition at line 433 of file linux.c.

◆ stob_linux_destroy()

static int stob_linux_destroy ( struct m0_stob stob,
struct m0_dtx dtx 
)
static

Definition at line 460 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_destroy_credit()

static void stob_linux_destroy_credit ( struct m0_stob stob,
struct m0_be_tx_credit accum 
)
static

Definition at line 447 of file linux.c.

◆ stob_linux_dir_domain()

static char* stob_linux_dir_domain ( const char *  path)
static

Definition at line 132 of file linux.c.

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

◆ stob_linux_dir_stob()

static char* stob_linux_dir_stob ( const char *  path)
static

Definition at line 137 of file linux.c.

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

◆ stob_linux_domain_cfg_create_free()

static void stob_linux_domain_cfg_create_free ( void *  cfg_create)
static

Definition at line 223 of file linux.c.

◆ stob_linux_domain_cfg_create_parse()

static int stob_linux_domain_cfg_create_parse ( const char *  str_cfg_create,
void **  cfg_create 
)
static

Definition at line 217 of file linux.c.

◆ stob_linux_domain_cfg_init_free()

static void stob_linux_domain_cfg_init_free ( void *  cfg_init)
static

Definition at line 212 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_domain_cfg_init_parse()

static int stob_linux_domain_cfg_init_parse ( const char *  str_cfg_init,
void **  cfg_init 
)
static

Definition at line 186 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_domain_create()

static int stob_linux_domain_create ( struct m0_stob_type type,
const char *  location_data,
uint64_t  dom_key,
void *  cfg_create 
)
static

Definition at line 320 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_domain_create_destroy()

static int stob_linux_domain_create_destroy ( struct m0_stob_type type,
const char *  path,
uint64_t  dom_key,
void *  cfg,
bool  create 
)
static
Todo:
get mode from create cfg

Definition at line 276 of file linux.c.

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

◆ stob_linux_domain_destroy()

static int stob_linux_domain_destroy ( struct m0_stob_type type,
const char *  location_data 
)
static

Definition at line 329 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_domain_fini()

static void stob_linux_domain_fini ( struct m0_stob_domain dom)
static

Definition at line 267 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_domain_init()

static int stob_linux_domain_init ( struct m0_stob_type type,
const char *  location_data,
void *  cfg_init,
struct m0_stob_domain **  out 
)
static

Definition at line 227 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_domain_key_get_set()

static int stob_linux_domain_key_get_set ( const char *  path,
uint64_t *  dom_key,
bool  get 
)
static

Definition at line 153 of file linux.c.

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

◆ stob_linux_fd()

static int stob_linux_fd ( struct m0_stob stob)
static

Definition at line 541 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_file_domain_id()

static char* stob_linux_file_domain_id ( const char *  path)
static

Definition at line 142 of file linux.c.

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

◆ stob_linux_file_stob()

static char* stob_linux_file_stob ( const char *  path,
const struct m0_fid stob_fid 
)
static

Definition at line 147 of file linux.c.

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

◆ stob_linux_fini()

static void stob_linux_fini ( struct m0_stob stob)
static

Definition at line 426 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_free()

static void stob_linux_free ( struct m0_stob_domain dom,
struct m0_stob stob 
)
static

Definition at line 345 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_init()

static int stob_linux_init ( struct m0_stob stob,
struct m0_stob_domain dom,
const struct m0_fid stob_fid 
)
static

Definition at line 408 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_io_fini()

static void stob_linux_io_fini ( struct m0_stob_io io)
static

Definition at line 188 of file ioq.c.

Here is the call graph for this function:

◆ stob_linux_io_launch()

static int stob_linux_io_launch ( struct m0_stob_io io)
static

Launch asynchronous IO.

  • calculate how many fragments IO operation has;
  • allocate ioq_qev array and fill it with fragments;
  • queue all fragments and submit as many as possible;

Definition at line 205 of file ioq.c.

Here is the call graph for this function:

◆ stob_linux_io_release()

static void stob_linux_io_release ( struct stob_linux_io lio)
static

Definition at line 181 of file ioq.c.

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

◆ stob_linux_open()

static int stob_linux_open ( struct m0_stob stob,
struct m0_stob_domain dom,
const struct m0_fid stob_fid,
void *  cfg,
bool  create 
)
static

Definition at line 376 of file linux.c.

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

◆ stob_linux_punch()

static int stob_linux_punch ( struct m0_stob stob,
struct m0_indexvec range,
struct m0_dtx dtx 
)
static

Punch holes in a stob.

Parameters
range,specifiesthe location to punch.

Definition at line 479 of file linux.c.

Here is the call graph for this function:

◆ stob_linux_punch_credit()

static int stob_linux_punch_credit ( struct m0_stob stob,
struct m0_indexvec want,
struct m0_indexvec got,
struct m0_be_tx_credit accum 
)
static

Definition at line 452 of file linux.c.

◆ stob_linux_stat()

static int stob_linux_stat ( struct m0_stob_linux lstob)
static

Definition at line 364 of file linux.c.

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

◆ stob_linux_type_deregister()

static void stob_linux_type_deregister ( struct m0_stob_type type)
static

Definition at line 96 of file linux.c.

◆ stob_linux_type_register()

static void stob_linux_type_register ( struct m0_stob_type type)
static

Definition at line 92 of file linux.c.

◆ stob_linux_vsnprintf()

static char* stob_linux_vsnprintf ( const char *  format,
  ... 
)
static

Call vsnprintf() for the given parameters.

  • memory is allocated using m0_alloc() for the string returned;
  • at most (MAXPATHLEN - 1) characters is in the string returned;
  • NULL is returned in case of error (including too large string).

Definition at line 119 of file linux.c.

Here is the caller graph for this function:

◆ stob_linux_write_credit()

static void stob_linux_write_credit ( const struct m0_stob_domain dom,
const struct m0_stob_io io,
struct m0_be_tx_credit accum 
)
static

Definition at line 528 of file linux.c.

Variable Documentation

◆ emulate_disk_errors_nr

int64_t emulate_disk_errors_nr = 0

Definition at line 487 of file ioq.c.

◆ ioq_timeout_default

const struct timespec ioq_timeout_default
static
Initial value:
= {
.tv_sec = 1,
.tv_nsec = 0
}

Definition at line 591 of file ioq.c.

◆ m0_stob_linux_type [1/2]

const struct m0_stob_type m0_stob_linux_type
Initial value:
= {
.st_ops = &stob_linux_type_ops,
.st_fidt = {
.ft_id = STOB_TYPE_LINUX,
.ft_name = "linuxstob",
},
}
static struct m0_stob_type_ops stob_linux_type_ops
Definition: linux.c:88

Definition at line 86 of file linux.c.

◆ m0_stob_linux_type [2/2]

const struct m0_stob_type m0_stob_linux_type

Definition at line 86 of file linux.c.

◆ M0_XCA_DOMAIN

enum { ... } M0_XCA_DOMAIN

◆ stob_linux_domain_ops

static struct m0_stob_domain_ops stob_linux_domain_ops
static
Initial value:
= {
.sdo_fini = &stob_linux_domain_fini,
.sdo_stob_alloc = &stob_linux_alloc,
.sdo_stob_free = &stob_linux_free,
.sdo_stob_cfg_parse = &stob_linux_cfg_parse,
.sdo_stob_cfg_free = &stob_linux_cfg_free,
.sdo_stob_init = &stob_linux_init,
.sdo_stob_create_credit = &stob_linux_create_credit,
.sdo_stob_create = &stob_linux_create,
.sdo_stob_write_credit = &stob_linux_write_credit,
}
static int stob_linux_create(struct m0_stob *stob, struct m0_stob_domain *dom, struct m0_dtx *dtx, const struct m0_fid *stob_fid, void *cfg)
Definition: linux.c:438
static struct m0_stob * stob_linux_alloc(struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
Definition: linux.c:336
static void stob_linux_free(struct m0_stob_domain *dom, struct m0_stob *stob)
Definition: linux.c:345
static void stob_linux_create_credit(struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
Definition: linux.c:433
static void stob_linux_cfg_free(void *cfg_create)
Definition: linux.c:359
static int stob_linux_cfg_parse(const char *str_cfg_create, void **cfg_create)
Definition: linux.c:352
static int stob_linux_init(struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
Definition: linux.c:408
static void stob_linux_write_credit(const struct m0_stob_domain *dom, const struct m0_stob_io *io, struct m0_be_tx_credit *accum)
Definition: linux.c:528
static void stob_linux_domain_fini(struct m0_stob_domain *dom)
Definition: linux.c:267

Definition at line 89 of file linux.c.

◆ stob_linux_io_op

static const struct m0_stob_io_op stob_linux_io_op
static
Initial value:
= {
.sio_launch = stob_linux_io_launch,
.sio_fini = stob_linux_io_fini
}
static void stob_linux_io_fini(struct m0_stob_io *io)
Definition: ioq.c:188
static int stob_linux_io_launch(struct m0_stob_io *io)
Definition: ioq.c:205

Definition at line 147 of file ioq.c.

◆ stob_linux_ops

static struct m0_stob_ops stob_linux_ops
static
Initial value:
= {
.sop_fini = &stob_linux_fini,
.sop_destroy_credit = &stob_linux_destroy_credit,
.sop_destroy = &stob_linux_destroy,
.sop_punch_credit = &stob_linux_punch_credit,
.sop_punch = &stob_linux_punch,
.sop_io_init = &m0_stob_linux_io_init,
.sop_block_shift = &stob_linux_block_shift,
.sop_fd = &stob_linux_fd,
}
static void stob_linux_destroy_credit(struct m0_stob *stob, struct m0_be_tx_credit *accum)
Definition: linux.c:447
static int stob_linux_fd(struct m0_stob *stob)
Definition: linux.c:541
static int stob_linux_destroy(struct m0_stob *stob, struct m0_dtx *dtx)
Definition: linux.c:460
static uint32_t stob_linux_block_shift(struct m0_stob *stob)
Definition: linux.c:534
static void stob_linux_fini(struct m0_stob *stob)
Definition: linux.c:426
M0_INTERNAL int m0_stob_linux_io_init(struct m0_stob *stob, struct m0_stob_io *io)
Definition: ioq.c:161
static int stob_linux_punch(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
Definition: linux.c:479
static int stob_linux_punch_credit(struct m0_stob *stob, struct m0_indexvec *want, struct m0_indexvec *got, struct m0_be_tx_credit *accum)
Definition: linux.c:452

Definition at line 90 of file linux.c.

◆ stob_linux_type_ops

static struct m0_stob_type_ops stob_linux_type_ops
static
Initial value:
= {
.sto_register = &stob_linux_type_register,
.sto_deregister = &stob_linux_type_deregister,
.sto_domain_cfg_init_parse = &stob_linux_domain_cfg_init_parse,
.sto_domain_cfg_init_free = &stob_linux_domain_cfg_init_free,
.sto_domain_cfg_create_parse = &stob_linux_domain_cfg_create_parse,
.sto_domain_cfg_create_free = &stob_linux_domain_cfg_create_free,
.sto_domain_init = &stob_linux_domain_init,
.sto_domain_create = &stob_linux_domain_create,
.sto_domain_destroy = &stob_linux_domain_destroy,
}
static void stob_linux_type_deregister(struct m0_stob_type *type)
Definition: linux.c:96
static int stob_linux_domain_destroy(struct m0_stob_type *type, const char *location_data)
Definition: linux.c:329
static void stob_linux_type_register(struct m0_stob_type *type)
Definition: linux.c:92
static int stob_linux_domain_cfg_create_parse(const char *str_cfg_create, void **cfg_create)
Definition: linux.c:217
static int stob_linux_domain_cfg_init_parse(const char *str_cfg_init, void **cfg_init)
Definition: linux.c:186
static void stob_linux_domain_cfg_init_free(void *cfg_init)
Definition: linux.c:212
static int stob_linux_domain_create(struct m0_stob_type *type, const char *location_data, uint64_t dom_key, void *cfg_create)
Definition: linux.c:320
static void stob_linux_domain_cfg_create_free(void *cfg_create)
Definition: linux.c:223
static int stob_linux_domain_init(struct m0_stob_type *type, const char *location_data, void *cfg_init, struct m0_stob_domain **out)
Definition: linux.c:227

Definition at line 88 of file linux.c.