Motr  M0
md_foms.c File Reference
#include <sys/stat.h>
#include "lib/misc.h"
#include "lib/arith.h"
#include "lib/errno.h"
#include "lib/assert.h"
#include "lib/memory.h"
#include "lib/bitstring.h"
#include "lib/rwlock.h"
#include "lib/trace.h"
#include "net/net.h"
#include "fid/fid.h"
#include "fop/fop.h"
#include "cob/cob.h"
#include "reqh/reqh.h"
#include "rpc/rpc_opcodes.h"
#include "fop/fom_generic.h"
#include "layout/layout.h"
#include "layout/pdclust.h"
#include "mdservice/md_fops.h"
#include "mdservice/md_fops_xc.h"
#include "mdservice/md_foms.h"
#include "mdservice/md_service.h"
#include "mdstore/mdstore.h"
Include dependency graph for md_foms.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_COB
 
#define M0_MD_READDIR_BUFF_SIZE   4096
 

Functions

static int md_locate (struct m0_mdstore *md, struct m0_fid *tfid, struct m0_cob **cob)
 
static size_t m0_md_req_fom_locality_get (const struct m0_fom *fom)
 
M0_INTERNAL void m0_md_cob_wire2mem (struct m0_cob_attr *attr, const struct m0_fop_cob *body)
 
M0_INTERNAL void m0_md_cob_mem2wire (struct m0_fop_cob *body, const struct m0_cob_attr *attr)
 
static void m0_md_create_credit (struct m0_mdstore *md, struct m0_be_tx_credit *accum)
 
static int m0_md_create (struct m0_mdstore *md, struct m0_fid *pfid, struct m0_fid *tfid, struct m0_cob_attr *attr, struct m0_be_tx *tx)
 
static int m0_md_tick_generic (struct m0_fom *fom)
 
static int md_tail (struct m0_fom *fom, struct m0_fop_cob *body, struct m0_fop_mod_rep *mod, int rc)
 
static int m0_md_tick_create (struct m0_fom *fom)
 
static int m0_md_tick_link (struct m0_fom *fom)
 
static int m0_md_tick_unlink (struct m0_fom *fom)
 
static void m0_md_rename_credit (struct m0_mdstore *md, struct m0_be_tx_credit *accum)
 
static int m0_md_rename (struct m0_mdstore *md, struct m0_fid *pfid_tgt, struct m0_fid *pfid_src, struct m0_fid *tfid_tgt, struct m0_fid *tfid_src, struct m0_cob_attr *tattr, struct m0_cob_attr *sattr, struct m0_cob *tcob, struct m0_cob *scob, struct m0_be_tx *tx)
 
static int m0_md_tick_rename (struct m0_fom *fom)
 
static int m0_md_tick_open (struct m0_fom *fom)
 
static int m0_md_tick_close (struct m0_fom *fom)
 
static int m0_md_tick_setattr (struct m0_fom *fom)
 
static int m0_md_tick_lookup (struct m0_fom *fom)
 
static int m0_md_tick_getattr (struct m0_fom *fom)
 
static void md_statfs_mem2wire (struct m0_fop_statfs_rep *rep, struct m0_statfs *statfs)
 
static int m0_md_tick_getxattr (struct m0_fom *fom)
 
static int m0_md_tick_setxattr (struct m0_fom *fom)
 
static int m0_md_tick_delxattr (struct m0_fom *fom)
 
static int m0_md_tick_listxattr (struct m0_fom *fom)
 
static int m0_md_tick_statfs (struct m0_fom *fom)
 
static int m0_md_tick_readdir (struct m0_fom *fom)
 
static int m0_md_req_path_get (struct m0_mdstore *mdstore, struct m0_fid *fid, struct m0_fop_str *str)
 
M0_INTERNAL int m0_md_fop_init (struct m0_fop *fop, struct m0_fom *fom)
 
static void m0_md_fom_fini (struct m0_fom *fom)
 
static void m0_md_req_fom_fini (struct m0_fom *fom)
 
M0_INTERNAL int m0_md_rep_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
M0_INTERNAL int m0_md_req_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 

Variables

void(* m0_md_req_fom_fini_func )(struct m0_fom *fom) = &m0_md_fom_fini
 
static const struct m0_fom_ops m0_md_fom_create_ops
 
static const struct m0_fom_ops m0_md_fom_link_ops
 
static const struct m0_fom_ops m0_md_fom_unlink_ops
 
static const struct m0_fom_ops m0_md_fom_rename_ops
 
static const struct m0_fom_ops m0_md_fom_open_ops
 
static const struct m0_fom_ops m0_md_fom_close_ops
 
static const struct m0_fom_ops m0_md_fom_setattr_ops
 
static const struct m0_fom_ops m0_md_fom_getattr_ops
 
static const struct m0_fom_ops m0_md_fom_setxattr_ops
 
static const struct m0_fom_ops m0_md_fom_getxattr_ops
 
static const struct m0_fom_ops m0_md_fom_delxattr_ops
 
static const struct m0_fom_ops m0_md_fom_listxattr_ops
 
static const struct m0_fom_ops m0_md_fom_lookup_ops
 
static const struct m0_fom_ops m0_md_fom_statfs_ops
 
static const struct m0_fom_ops m0_md_fom_readdir_ops
 

Macro Definition Documentation

◆ M0_MD_READDIR_BUFF_SIZE

#define M0_MD_READDIR_BUFF_SIZE   4096

Readdir fop data buffer size

Definition at line 1069 of file md_foms.c.

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_COB

Definition at line 22 of file md_foms.c.

Function Documentation

◆ m0_md_cob_mem2wire()

M0_INTERNAL void m0_md_cob_mem2wire ( struct m0_fop_cob body,
const struct m0_cob_attr attr 
)

Definition at line 89 of file md_foms.c.

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

◆ m0_md_cob_wire2mem()

M0_INTERNAL void m0_md_cob_wire2mem ( struct m0_cob_attr attr,
const struct m0_fop_cob body 
)

Definition at line 53 of file md_foms.c.

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

◆ m0_md_create()

static int m0_md_create ( struct m0_mdstore md,
struct m0_fid pfid,
struct m0_fid tfid,
struct m0_cob_attr attr,
struct m0_be_tx tx 
)
static

Create object in with and attributes from . Handle possible variants for existing/missing objects and links.

Definition at line 137 of file md_foms.c.

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

◆ m0_md_create_credit()

static void m0_md_create_credit ( struct m0_mdstore md,
struct m0_be_tx_credit accum 
)
static

Definition at line 124 of file md_foms.c.

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

◆ m0_md_fom_fini()

static void m0_md_fom_fini ( struct m0_fom fom)
static

Definition at line 1308 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_fop_init()

M0_INTERNAL int m0_md_fop_init ( struct m0_fop fop,
struct m0_fom fom 
)

Definition at line 1201 of file md_foms.c.

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

◆ m0_md_rename()

static int m0_md_rename ( struct m0_mdstore md,
struct m0_fid pfid_tgt,
struct m0_fid pfid_src,
struct m0_fid tfid_tgt,
struct m0_fid tfid_src,
struct m0_cob_attr tattr,
struct m0_cob_attr sattr,
struct m0_cob tcob,
struct m0_cob scob,
struct m0_be_tx tx 
)
static

Definition at line 380 of file md_foms.c.

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

◆ m0_md_rename_credit()

static void m0_md_rename_credit ( struct m0_mdstore md,
struct m0_be_tx_credit accum 
)
static

Definition at line 373 of file md_foms.c.

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

◆ m0_md_rep_fom_create()

M0_INTERNAL int m0_md_rep_fom_create ( struct m0_fop fop,
struct m0_fom **  m,
struct m0_reqh reqh 
)

Definition at line 1431 of file md_foms.c.

◆ m0_md_req_fom_create()

M0_INTERNAL int m0_md_req_fom_create ( struct m0_fop fop,
struct m0_fom **  m,
struct m0_reqh reqh 
)

Init request fom for all types of requests.

Definition at line 1437 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_req_fom_fini()

static void m0_md_req_fom_fini ( struct m0_fom fom)
static

Definition at line 1328 of file md_foms.c.

◆ m0_md_req_fom_locality_get()

static size_t m0_md_req_fom_locality_get ( const struct m0_fom fom)
static

Definition at line 1333 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_req_path_get()

static int m0_md_req_path_get ( struct m0_mdstore mdstore,
struct m0_fid fid,
struct m0_fop_str str 
)
static

Definition at line 1180 of file md_foms.c.

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

◆ m0_md_tick_close()

static int m0_md_tick_close ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 558 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_create()

static int m0_md_tick_create ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Symlink body size is stored in ->ca_size

Definition at line 203 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_delxattr()

static int m0_md_tick_delxattr ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 972 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_generic()

static int m0_md_tick_generic ( struct m0_fom fom)
inlinestatic

Definition at line 174 of file md_foms.c.

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

◆ m0_md_tick_getattr()

static int m0_md_tick_getattr ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 755 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_getxattr()

static int m0_md_tick_getxattr ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 823 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_link()

static int m0_md_tick_link ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 260 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_listxattr()

static int m0_md_tick_listxattr ( struct m0_fom fom)
static

Definition at line 1029 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_lookup()

static int m0_md_tick_lookup ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 680 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_open()

static int m0_md_tick_open ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 490 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_readdir()

static int m0_md_tick_readdir ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 1071 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_rename()

static int m0_md_tick_rename ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 417 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_setattr()

static int m0_md_tick_setattr ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 624 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_setxattr()

static int m0_md_tick_setxattr ( struct m0_fom fom)
static

Definition at line 901 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_statfs()

static int m0_md_tick_statfs ( struct m0_fom fom)
static

Definition at line 1036 of file md_foms.c.

Here is the call graph for this function:

◆ m0_md_tick_unlink()

static int m0_md_tick_unlink ( struct m0_fom fom)
static

Init some fop fields (full path) that require mdstore and other initialialized structures.

Definition at line 309 of file md_foms.c.

Here is the call graph for this function:

◆ md_locate()

static int md_locate ( struct m0_mdstore md,
struct m0_fid tfid,
struct m0_cob **  cob 
)
static

Definition at line 1530 of file md_foms.c.

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

◆ md_statfs_mem2wire()

static void md_statfs_mem2wire ( struct m0_fop_statfs_rep rep,
struct m0_statfs statfs 
)
static

Definition at line 809 of file md_foms.c.

Here is the caller graph for this function:

◆ md_tail()

static int md_tail ( struct m0_fom fom,
struct m0_fop_cob body,
struct m0_fop_mod_rep mod,
int  rc 
)
static

Definition at line 190 of file md_foms.c.

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

Variable Documentation

◆ m0_md_fom_close_ops

const struct m0_fom_ops m0_md_fom_close_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_close,
.fo_fini = m0_md_req_fom_fini
}
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static int m0_md_tick_close(struct m0_fom *fom)
Definition: md_foms.c:558
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1371 of file md_foms.c.

◆ m0_md_fom_create_ops

const struct m0_fom_ops m0_md_fom_create_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_create,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_create(struct m0_fom *fom)
Definition: md_foms.c:203
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1341 of file md_foms.c.

◆ m0_md_fom_delxattr_ops

const struct m0_fom_ops m0_md_fom_delxattr_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_delxattr,
.fo_fini = m0_md_req_fom_fini
}
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333
static int m0_md_tick_delxattr(struct m0_fom *fom)
Definition: md_foms.c:972

Definition at line 1401 of file md_foms.c.

◆ m0_md_fom_getattr_ops

const struct m0_fom_ops m0_md_fom_getattr_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_getattr,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_getattr(struct m0_fom *fom)
Definition: md_foms.c:755
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1383 of file md_foms.c.

◆ m0_md_fom_getxattr_ops

const struct m0_fom_ops m0_md_fom_getxattr_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_getxattr,
.fo_fini = m0_md_req_fom_fini
}
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static int m0_md_tick_getxattr(struct m0_fom *fom)
Definition: md_foms.c:823
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1395 of file md_foms.c.

◆ m0_md_fom_link_ops

const struct m0_fom_ops m0_md_fom_link_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_link,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_link(struct m0_fom *fom)
Definition: md_foms.c:260
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1347 of file md_foms.c.

◆ m0_md_fom_listxattr_ops

const struct m0_fom_ops m0_md_fom_listxattr_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_listxattr(struct m0_fom *fom)
Definition: md_foms.c:1029
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1407 of file md_foms.c.

◆ m0_md_fom_lookup_ops

const struct m0_fom_ops m0_md_fom_lookup_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_lookup,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_lookup(struct m0_fom *fom)
Definition: md_foms.c:680
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1413 of file md_foms.c.

◆ m0_md_fom_open_ops

const struct m0_fom_ops m0_md_fom_open_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_open,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_open(struct m0_fom *fom)
Definition: md_foms.c:490
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1365 of file md_foms.c.

◆ m0_md_fom_readdir_ops

const struct m0_fom_ops m0_md_fom_readdir_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_readdir,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_readdir(struct m0_fom *fom)
Definition: md_foms.c:1071
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1425 of file md_foms.c.

◆ m0_md_fom_rename_ops

const struct m0_fom_ops m0_md_fom_rename_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_rename,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_rename(struct m0_fom *fom)
Definition: md_foms.c:417
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1359 of file md_foms.c.

◆ m0_md_fom_setattr_ops

const struct m0_fom_ops m0_md_fom_setattr_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_setattr,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_setattr(struct m0_fom *fom)
Definition: md_foms.c:624
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1377 of file md_foms.c.

◆ m0_md_fom_setxattr_ops

const struct m0_fom_ops m0_md_fom_setxattr_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_setxattr,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_setxattr(struct m0_fom *fom)
Definition: md_foms.c:901
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1389 of file md_foms.c.

◆ m0_md_fom_statfs_ops

const struct m0_fom_ops m0_md_fom_statfs_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_statfs,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_statfs(struct m0_fom *fom)
Definition: md_foms.c:1036
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1419 of file md_foms.c.

◆ m0_md_fom_unlink_ops

const struct m0_fom_ops m0_md_fom_unlink_ops
static
Initial value:
= {
.fo_home_locality = m0_md_req_fom_locality_get,
.fo_tick = m0_md_tick_unlink,
.fo_fini = m0_md_req_fom_fini
}
static int m0_md_tick_unlink(struct m0_fom *fom)
Definition: md_foms.c:309
static void m0_md_req_fom_fini(struct m0_fom *fom)
Definition: md_foms.c:1328
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
Definition: md_foms.c:1333

Definition at line 1353 of file md_foms.c.

◆ m0_md_req_fom_fini_func

void(* m0_md_req_fom_fini_func) (struct m0_fom *fom) = &m0_md_fom_fini

md fom finaliser is called indirectly through this pointer so that UT can redirect it.

Definition at line 1326 of file md_foms.c.