22 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_COB 44 #include "mdservice/md_fops_xc.h" 153 }
else if (
rc == 0) {
169 (
int)
attr->ca_name.b_nob, (
char *)
attr->ca_name.b_addr,
rc,
230 fop_rep =
fom->fo_rep_fop;
239 (
int)
attr.ca_name.b_nob, (
char *)
attr.ca_name.b_addr);
249 if (S_ISLNK(
attr.ca_mode)) {
282 fop_rep =
fom->fo_rep_fop;
334 fop_rep =
fom->fo_rep_fop;
346 (
int)
req->u_name.s_len, (
char *)
req->u_name.s_buf);
365 (
int)
req->u_name.s_len, (
char *)
req->u_name.s_buf,
444 fop_rep =
fom->fo_rep_fop;
458 sbody = &
req->r_sbody;
459 tbody = &
req->r_tbody;
474 &sattr, scob, scob, tx);
482 &sattr, tcob, scob, tx);
513 fop_rep =
fom->fo_rep_fop;
543 }
else if (
rc == -ENOENT) {
550 }
else if (
rc != 0) {
581 fop_rep =
fom->fo_rep_fop;
619 rep->c_body.b_rc =
rc;
647 fop_rep =
fom->fo_rep_fop;
704 fop_rep =
fom->fo_rep_fop;
750 rep->l_body.b_rc =
rc;
777 fop_rep =
fom->fo_rep_fop;
846 fop_rep =
fom->fo_rep_fop;
866 (
char *)
req->g_key.s_buf,
927 fop_rep =
fom->fo_rep_fop;
932 req->s_key.s_len, (
char *)
req->s_key.s_buf,
933 req->s_value.s_len, (
char *)
req->s_value.s_buf,
949 (
char *)
req->s_key.s_buf,
997 fop_rep =
fom->fo_rep_fop;
1016 (
char *)
req->d_key.s_buf,
1031 int rc = -EOPNOTSUPP;
1051 fop_rep =
fom->fo_rep_fop;
1069 #define M0_MD_READDIR_BUFF_SIZE 4096 1093 fop_rep =
fom->fo_rep_fop;
1124 (
char *)
req->r_pos.s_buf,
req->r_pos.s_len);
1149 if (
rep->r_end.s_buf ==
NULL) {
1164 rep->r_body.b_rc =
rc;
1330 (*m0_md_req_fom_fini_func)(
fom);
1450 if (fom_obj ==
NULL)
1516 return M0_ERR(-EOPNOTSUPP);
1542 #undef M0_TRACE_SUBSYSTEM
static int m0_md_tick_setattr(struct m0_fom *fom)
struct m0_cob_nsrec co_nsrec
struct m0_fop_str r_spath
void m0_fom_phase_moveif(struct m0_fom *fom, int32_t rc, int phase0, int phase1)
static const struct m0_fom_ops m0_md_fom_rename_ops
uint32_t m0_fop_opcode(const struct m0_fop *fop)
static int m0_md_tick_readdir(struct m0_fom *fom)
static int m0_md_tick_lookup(struct m0_fom *fom)
static int m0_md_tick_open(struct m0_fom *fom)
void(* m0_md_req_fom_fini_func)(struct m0_fom *fom)
static const struct m0_fom_ops m0_md_fom_statfs_ops
M0_INTERNAL int m0_cob_ea_del(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_be_tx *tx)
struct m0_cob_domain * md_dom
static struct m0_addb2_mach * m
M0_INTERNAL size_t m0_cob_max_earec_size(void)
struct m0_mdstore * rh_mdstore
#define M0_MD_MAX_NAME_LEN
M0_INTERNAL int m0_cob_ea_get(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *out, struct m0_be_tx *tx)
struct m0_fop_str l_tpath
struct m0_fop_str l_spath
static struct io_request req
static void md_statfs_mem2wire(struct m0_fop_statfs_rep *rep, struct m0_statfs *statfs)
static int md_tail(struct m0_fom *fom, struct m0_fop_cob *body, struct m0_fop_mod_rep *mod, int rc)
#define M0_LOG(level,...)
static struct m0_be_tx_credit * m0_fom_tx_credit(struct m0_fom *fom)
M0_INTERNAL int m0_mdstore_locate(struct m0_mdstore *md, const struct m0_fid *fid, struct m0_cob **cob, int flags)
static void m0_md_create_credit(struct m0_mdstore *md, struct m0_be_tx_credit *accum)
static struct m0_mdstore md
M0_INTERNAL uint32_t m0_bitstring_len_get(const struct m0_bitstring *c)
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
M0_INTERNAL int m0_mdstore_statfs(struct m0_mdstore *md, struct m0_statfs *statfs)
M0_INTERNAL void m0_cob_put(struct m0_cob *cob)
void * m0_fop_data(const struct m0_fop *fop)
M0_INTERNAL void m0_md_cob_wire2mem(struct m0_cob_attr *attr, const struct m0_fop_cob *body)
struct m0_fop_type m0_fop_create_rep_fopt
#define container_of(ptr, type, member)
static const struct m0_fom_ops m0_md_fom_link_ops
static int m0_md_tick_rename(struct m0_fom *fom)
static struct m0_rpc_item * item
struct m0_fop_getxattr_rep * rep
static int m0_md_tick_listxattr(struct m0_fom *fom)
static int m0_md_tick_create(struct m0_fom *fom)
static struct m0_be_tx * m0_fom_tx(struct m0_fom *fom)
struct m0_fom_type ft_fom_type
static int m0_md_tick_link(struct m0_fom *fom)
M0_INTERNAL int m0_mdstore_close(struct m0_mdstore *md, struct m0_cob *cob, struct m0_be_tx *tx)
M0_INTERNAL int m0_md_req_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
M0_INTERNAL int m0_mdstore_fcreate(struct m0_mdstore *md, struct m0_fid *pfid, struct m0_cob_attr *attr, struct m0_cob **out, struct m0_be_tx *tx)
M0_INTERNAL void m0_cob_tx_credit(struct m0_cob_domain *dom, enum m0_cob_op optype, struct m0_be_tx_credit *accum)
#define M0_BE_TX_CREDIT(nr, size)
M0_INTERNAL void m0_mdstore_unlink_credit(struct m0_mdstore *md, struct m0_be_tx_credit *accum)
static const struct m0_fom_ops m0_md_fom_setxattr_ops
M0_INTERNAL int m0_cob_ea_set(struct m0_cob *cob, struct m0_cob_eakey *eakey, struct m0_cob_earec *earec, struct m0_be_tx *tx)
static const struct m0_fom_ops m0_md_fom_getxattr_ops
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
M0_INTERNAL int m0_mdstore_link(struct m0_mdstore *md, struct m0_fid *pfid, struct m0_cob *cob, struct m0_buf *name, struct m0_be_tx *tx)
struct m0_fop_type * f_type
M0_INTERNAL void m0_mdstore_create_credit(struct m0_mdstore *md, struct m0_be_tx_credit *accum)
return M0_ERR(-EOPNOTSUPP)
static int m0_md_tick_getattr(struct m0_fom *fom)
struct m0_fop_type m0_fop_getxattr_rep_fopt
struct m0_fop_type m0_fop_getattr_rep_fopt
static void m0_md_fom_fini(struct m0_fom *fom)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
M0_INTERNAL void m0_bitstring_copy(struct m0_bitstring *dst, const char *src, size_t count)
struct m0_bitstring * r_pos
int m0_fom_tick_generic(struct m0_fom *fom)
void m0_fom_fini(struct m0_fom *fom)
struct m0_fop_type m0_fop_unlink_rep_fopt
static struct m0_cob * cob
static void m0_md_rename_credit(struct m0_mdstore *md, struct m0_be_tx_credit *accum)
static const struct m0_fom_ops m0_md_fom_delxattr_ops
M0_INTERNAL void m0_md_cob_mem2wire(struct m0_fop_cob *body, const struct m0_cob_attr *attr)
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
struct m0_fop_type m0_fop_close_rep_fopt
M0_INTERNAL void m0_be_tx_credit_add(struct m0_be_tx_credit *c0, const struct m0_be_tx_credit *c1)
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)
struct m0_fop_type m0_fop_delxattr_rep_fopt
M0_INTERNAL void m0_fom_mod_rep_fill(struct m0_fop_mod_rep *rep, struct m0_fom *fom)
const struct m0_rpc_item_type * ri_type
void * m0_alloc(size_t size)
M0_INTERNAL int m0_mdstore_open(struct m0_mdstore *md, struct m0_cob *cob, m0_mdstore_locate_flags_t flags, struct m0_be_tx *tx)
static const struct m0_fom_ops m0_md_fom_readdir_ops
#define M0_MD_READDIR_BUFF_SIZE
static int md_locate(struct m0_mdstore *md, struct m0_fid *tfid, struct m0_cob **cob)
static const struct m0_fom_ops m0_md_fom_setattr_ops
struct m0_fop_type m0_fop_rename_rep_fopt
M0_INTERNAL int m0_mdstore_readdir(struct m0_mdstore *md, struct m0_cob *cob, struct m0_rdpg *rdpg)
static int m0_md_tick_generic(struct m0_fom *fom)
static int m0_md_tick_unlink(struct m0_fom *fom)
static const struct m0_fom_ops m0_md_fom_unlink_ops
M0_INTERNAL int m0_md_fop_init(struct m0_fop *fop, struct m0_fom *fom)
struct m0_fop_type m0_fop_setxattr_rep_fopt
static int m0_md_tick_setxattr(struct m0_fom *fom)
M0_INTERNAL int m0_mdstore_path(struct m0_mdstore *md, struct m0_fid *fid, char **path)
static const struct m0_fom_ops m0_md_fom_open_ops
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 const struct m0_fom_ops m0_md_fom_close_ops
struct m0_fop_cob r_tbody
M0_INTERNAL int m0_mdstore_rename(struct m0_mdstore *md, struct m0_fid *pfid_tgt, struct m0_fid *pfid_src, struct m0_cob *cob_tgt, struct m0_cob *cob_src, struct m0_buf *tname, struct m0_buf *sname, struct m0_be_tx *tx)
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
struct m0_fop_str g_value
static int m0_md_tick_statfs(struct m0_fom *fom)
M0_INTERNAL int m0_md_rep_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
size_t(* fo_home_locality)(const struct m0_fom *fom)
struct m0_fop_type m0_fop_link_rep_fopt
M0_INTERNAL void m0_mdstore_rename_credit(struct m0_mdstore *md, struct m0_be_tx_credit *accum)
struct m0_fop_type m0_fop_listxattr_rep_fopt
M0_INTERNAL void m0_mdstore_setattr_credit(struct m0_mdstore *md, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_cob_eakey_make(struct m0_cob_eakey **keyh, const struct m0_fid *fid, const char *name, size_t namelen)
M0_INTERNAL void m0_bitstring_free(struct m0_bitstring *c)
static const struct m0_fom_ops m0_md_fom_listxattr_ops
struct m0_fop_cob r_sbody
static void m0_md_req_fom_fini(struct m0_fom *fom)
struct m0_fop_str r_tpath
M0_INTERNAL int m0_mdstore_unlink(struct m0_mdstore *md, struct m0_fid *pfid, struct m0_cob *cob, struct m0_buf *name, struct m0_be_tx *tx)
M0_INTERNAL void * m0_bitstring_buf_get(struct m0_bitstring *c)
struct m0_rpc_item * m0_fop_to_rpc_item(const struct m0_fop *fop)
static int m0_md_tick_getxattr(struct m0_fom *fom)
static int m0_md_tick_close(struct m0_fom *fom)
static struct m0_fop * fop
struct m0_cob_omgrec co_omgrec
static const struct m0_fom_ops m0_md_fom_lookup_ops
M0_INTERNAL void m0_mdstore_link_credit(struct m0_mdstore *md, struct m0_be_tx_credit *accum)
static size_t m0_md_req_fom_locality_get(const struct m0_fom *fom)
static int m0_md_tick_delxattr(struct m0_fom *fom)
M0_INTERNAL int m0_mdstore_setattr(struct m0_mdstore *md, struct m0_cob *cob, struct m0_cob_attr *attr, struct m0_be_tx *tx)
static const struct m0_fom_ops m0_md_fom_create_ops
static int m0_md_req_path_get(struct m0_mdstore *mdstore, struct m0_fid *fid, struct m0_fop_str *str)
M0_INTERNAL const struct m0_fid * m0_cob_fid(const struct m0_cob *cob)
struct m0_fop_type m0_fop_setattr_rep_fopt
M0_INTERNAL int m0_mdstore_lookup(struct m0_mdstore *md, struct m0_fid *pfid, struct m0_buf *name, struct m0_cob **cob)
struct m0_bitstring * r_end
struct m0_fop_type m0_fop_open_rep_fopt
M0_INTERNAL int m0_mdstore_getattr(struct m0_mdstore *md, struct m0_cob *cob, struct m0_cob_attr *attr)
M0_INTERNAL struct m0_reqh * m0_fom_reqh(const struct m0_fom *fom)
struct m0_fop_type m0_fop_lookup_rep_fopt
struct m0_fop_type m0_fop_statfs_rep_fopt
M0_INTERNAL bool m0_fom_invariant(const struct m0_fom *fom)
static const struct m0_fom_ops m0_md_fom_getattr_ops
struct m0_fop_type m0_fop_readdir_rep_fopt