osi->osi_obdo.o_valid = 0;
obdo_from_la(&osi->osi_obdo, attr, attr->la_valid);
lustre_set_wire_obdo(NULL, &osi->osi_obdo, &osi->osi_obdo);
- obdo_cpu_to_le(&osi->osi_obdo, &osi->osi_obdo);
bufs[0] = (char *)&osi->osi_obdo;
buf_count = 1;
fid1 = (struct lu_fid *)lu_object_fid(&dt->do_lu);
if (hint != NULL && hint->dah_parent) {
struct lu_fid *fid2;
- struct lu_fid *tmp_fid = &osi->osi_fid;
fid2 = (struct lu_fid *)lu_object_fid(&hint->dah_parent->do_lu);
- fid_cpu_to_le(tmp_fid, fid2);
- sizes[1] = sizeof(*tmp_fid);
- bufs[1] = (char *)tmp_fid;
+ sizes[1] = sizeof(*fid2);
+ bufs[1] = (char *)fid2;
buf_count++;
}
{
LASSERT(ah);
- memset(ah, 0, sizeof(*ah));
ah->dah_parent = parent;
ah->dah_mode = child_mode;
}
obdo_from_la(&osi->osi_obdo, (struct lu_attr *)attr,
attr->la_valid);
lustre_set_wire_obdo(NULL, &osi->osi_obdo, &osi->osi_obdo);
- obdo_cpu_to_le(&osi->osi_obdo, &osi->osi_obdo);
buf = (char *)&osi->osi_obdo;
fid = (struct lu_fid *)lu_object_fid(&dt->do_lu);
}
fid = lbuf->lb_buf;
- fid_le_to_cpu(fid, fid);
+ if (ptlrpc_rep_need_swab(req))
+ lustre_swab_lu_fid(fid);
if (!fid_is_sane(fid)) {
CERROR("%s: lookup "DFID" %s invalid fid "DFID"\n",
dt_dev->dd_lu_dev.ld_obd->obd_name,
struct ldlm_enqueue_info *einfo,
ldlm_policy_data_t *policy)
{
- struct osp_thread_info *info = osp_env_info(env);
- struct ldlm_res_id *res_id = &info->osi_resid;
+ struct ldlm_res_id *res_id;
struct dt_device *dt_dev = lu2dt_dev(dt->do_lu.lo_dev);
struct osp_device *osp = dt2osp_dev(dt_dev);
struct ptlrpc_request *req;
__u64 flags = 0;
ldlm_mode_t mode;
- fid_build_reg_res_name(lu_object_fid(&dt->do_lu), res_id);
+ res_id = einfo->ei_res_id;
+ LASSERT(res_id != NULL);
mode = ldlm_lock_match(osp->opd_obd->obd_namespace,
LDLM_FL_BLOCK_GRANTED, res_id,
.do_object_lock = osp_md_object_lock,
.do_object_unlock = osp_md_object_unlock,
};
+
+static ssize_t osp_md_declare_write(const struct lu_env *env,
+ struct dt_object *dt,
+ const struct lu_buf *buf,
+ loff_t pos, struct thandle *th)
+{
+ struct dt_update_request *update;
+ struct lu_fid *fid;
+ int sizes[2] = {buf->lb_len, sizeof(pos)};
+ const char *bufs[2] = {(char *)buf->lb_buf,
+ (char *)&pos};
+ ssize_t rc;
+
+ update = out_find_create_update_loc(th, dt);
+ if (IS_ERR(update)) {
+ CERROR("%s: Get OSP update buf failed: rc = %d\n",
+ dt->do_lu.lo_dev->ld_obd->obd_name,
+ (int)PTR_ERR(update));
+ return PTR_ERR(update);
+ }
+
+ pos = cpu_to_le64(pos);
+ bufs[1] = (char *)&pos;
+ fid = (struct lu_fid *)lu_object_fid(&dt->do_lu);
+ rc = out_insert_update(env, update, OUT_WRITE, fid,
+ ARRAY_SIZE(sizes), sizes, bufs);
+
+ return rc;
+
+}
+
+static ssize_t osp_md_write(const struct lu_env *env, struct dt_object *dt,
+ const struct lu_buf *buf, loff_t *pos,
+ struct thandle *handle,
+ struct lustre_capa *capa, int ignore_quota)
+{
+ return buf->lb_len;
+}
+
+/* These body operation will be used to write symlinks during migration etc */
+struct dt_body_operations osp_md_body_ops = {
+ .dbo_declare_write = osp_md_declare_write,
+ .dbo_write = osp_md_write,
+};