#include "cmm_internal.h"
#include "mdc_internal.h"
-static struct md_object_operations mdc_mo_ops;
-static struct md_dir_operations mdc_dir_ops;
-static struct lu_object_operations mdc_obj_ops;
+static const struct md_object_operations mdc_mo_ops;
+static const struct md_dir_operations mdc_dir_ops;
+static const struct lu_object_operations mdc_obj_ops;
extern struct lu_context_key mdc_thread_key;
}
static int mdc_object_init(const struct lu_env *env, struct lu_object *lo,
- const struct lu_object_conf *_)
+ const struct lu_object_conf *unused)
{
ENTRY;
lo->lo_header->loh_attr |= LOHA_REMOTE;
LASSERT(ma->ma_capa != NULL);
*ma->ma_capa = *capa;
}
-
+
if ((body->valid & OBD_MD_FLEASIZE) || (body->valid & OBD_MD_FLDIREA)) {
if (body->eadatasize == 0) {
CERROR("No size defined for easize field\n");
RETURN(-EPROTO);
LASSERT(ma->ma_lmm != NULL);
- LASSERT(ma->ma_lmm_size >= body->eadatasize);
+ LASSERT(ma->ma_lmm_size >= body->eadatasize);
ma->ma_lmm_size = body->eadatasize;
memcpy(ma->ma_lmm, md, ma->ma_lmm_size);
ma->ma_valid |= MA_LOV;
RETURN(-EPROTO);
}
- cookie = req_capsule_server_sized_get(&req->rq_pill,
+ cookie = req_capsule_server_sized_get(&req->rq_pill,
&RMF_LOGCOOKIES,
body->aclsize);
if (cookie == NULL)
RETURN(-EPROTO);
}
- acl = req_capsule_server_sized_get(&req->rq_pill,
+ acl = req_capsule_server_sized_get(&req->rq_pill,
&RMF_ACL,
body->aclsize);
if (acl == NULL)
memset(&mci->mci_opdata, 0, sizeof(mci->mci_opdata));
- rc = md_getattr(mc->mc_desc.cl_exp, lu_object_fid(&mo->mo_lu),
- NULL, OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID |
- OBD_MD_FLFLAGS | OBD_MD_FLCROSSREF, 0, &mci->mci_req);
+ memcpy(&mci->mci_opdata.op_fid1, lu_object_fid(&mo->mo_lu),
+ sizeof (struct lu_fid));
+ mci->mci_opdata.op_valid = OBD_MD_FLMODE | OBD_MD_FLUID |
+ OBD_MD_FLGID | OBD_MD_FLFLAGS |
+ OBD_MD_FLCROSSREF;
+
+ rc = md_getattr(mc->mc_desc.cl_exp, &mci->mci_opdata, &mci->mci_req);
if (rc == 0) {
/* get attr from request */
rc = mdc_req2attr_update(env, ma);
mci = mdc_info_init(env);
mci->mci_opdata.op_bias = MDS_CROSS_REF;
mci->mci_opdata.op_fid2 = *lu_object_fid(&mo->mo_lu);
-
+
/* Parent fid is needed to create dotdot on the remote node. */
mci->mci_opdata.op_fid1 = *(spec->u.sp_pfid);
mci->mci_opdata.op_mod_time = la->la_ctime;
}
#endif
-static struct md_object_operations mdc_mo_ops = {
+static const struct md_object_operations mdc_mo_ops = {
.moo_attr_get = mdc_attr_get,
.moo_attr_set = mdc_attr_set,
.moo_object_create = mdc_object_create,
RETURN(rc);
}
-/*
+/*
* Return resulting fid in sfid
* 0: fids are not relatives
* fid: fid at which search stopped
body = req_capsule_server_get(&mci->mci_req->rq_pill,
&RMF_MDT_BODY);
LASSERT(body->valid & OBD_MD_FLID);
-
+
CDEBUG(D_INFO, "Remote mdo_is_subdir(), new src "DFID"\n",
PFID(&body->fid1));
*sfid = body->fid1;
RETURN(rc);
}
-static struct md_dir_operations mdc_dir_ops = {
+static const struct md_dir_operations mdc_dir_ops = {
.mdo_is_subdir = mdc_is_subdir,
.mdo_rename_tgt = mdc_rename_tgt
};