void obdo_from_md(struct obdo *oa, struct md_op_data *op_data,
unsigned int valid);
-void obdo_cpu_to_le(struct obdo *dobdo, struct obdo *sobdo);
-void obdo_le_to_cpu(struct obdo *dobdo, struct obdo *sobdo);
-
#define OBT(dev) (dev)->obd_type
#define OBP(dev, op) (dev)->obd_type->typ_dt_ops->o_ ## op
#define MDP(dev, op) (dev)->obd_type->typ_md_ops->m_ ## op
}
}
EXPORT_SYMBOL(obdo_from_md);
-
-void obdo_cpu_to_le(struct obdo *dobdo, struct obdo *sobdo)
-{
- dobdo->o_size = cpu_to_le64(sobdo->o_size);
- dobdo->o_mtime = cpu_to_le64(sobdo->o_mtime);
- dobdo->o_atime = cpu_to_le64(sobdo->o_atime);
- dobdo->o_ctime = cpu_to_le64(sobdo->o_ctime);
- dobdo->o_blocks = cpu_to_le64(sobdo->o_blocks);
- dobdo->o_mode = cpu_to_le32(sobdo->o_mode);
- dobdo->o_uid = cpu_to_le32(sobdo->o_uid);
- dobdo->o_gid = cpu_to_le32(sobdo->o_gid);
- dobdo->o_flags = cpu_to_le32(sobdo->o_flags);
- dobdo->o_nlink = cpu_to_le32(sobdo->o_nlink);
- dobdo->o_blksize = cpu_to_le32(sobdo->o_blksize);
- dobdo->o_valid = cpu_to_le64(sobdo->o_valid);
-}
-EXPORT_SYMBOL(obdo_cpu_to_le);
-
-void obdo_le_to_cpu(struct obdo *dobdo, struct obdo *sobdo)
-{
- dobdo->o_size = le64_to_cpu(sobdo->o_size);
- dobdo->o_mtime = le64_to_cpu(sobdo->o_mtime);
- dobdo->o_atime = le64_to_cpu(sobdo->o_atime);
- dobdo->o_ctime = le64_to_cpu(sobdo->o_ctime);
- dobdo->o_blocks = le64_to_cpu(sobdo->o_blocks);
- dobdo->o_mode = le32_to_cpu(sobdo->o_mode);
- dobdo->o_uid = le32_to_cpu(sobdo->o_uid);
- dobdo->o_gid = le32_to_cpu(sobdo->o_gid);
- dobdo->o_flags = le32_to_cpu(sobdo->o_flags);
- dobdo->o_nlink = le32_to_cpu(sobdo->o_nlink);
- dobdo->o_blksize = le32_to_cpu(sobdo->o_blksize);
- dobdo->o_valid = le64_to_cpu(sobdo->o_valid);
-}
-EXPORT_SYMBOL(obdo_le_to_cpu);
-
typedef int (*osp_async_update_interpterer_t)(const struct lu_env *env,
struct object_update_reply *reply,
+ struct ptlrpc_request *req,
struct osp_object *obj,
void *data, int index, int rc);
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++;
}
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,
static int osp_get_attr_from_reply(const struct lu_env *env,
struct object_update_reply *reply,
+ struct ptlrpc_request *req,
struct lu_attr *attr,
struct osp_object *obj, int index)
{
if (rbuf->lb_len != sizeof(*wobdo))
return -EPROTO;
- obdo_le_to_cpu(wobdo, wobdo);
+ LASSERT(req != NULL);
+ if (ptlrpc_req_need_swab(req))
+ lustre_swab_obdo(wobdo);
+
lustre_get_wire_obdo(NULL, lobdo, wobdo);
spin_lock(&obj->opo_lock);
if (obj->opo_ooa != NULL) {
static int osp_attr_get_interpterer(const struct lu_env *env,
struct object_update_reply *reply,
+ struct ptlrpc_request *req,
struct osp_object *obj,
void *data, int index, int rc)
{
osp2lu_obj(obj)->lo_header->loh_attr |= LOHA_EXISTS;
obj->opo_non_exist = 0;
- return osp_get_attr_from_reply(env, reply, NULL, obj, index);
+ return osp_get_attr_from_reply(env, reply, req, NULL, obj,
+ index);
} else {
if (rc == -ENOENT) {
osp2lu_obj(obj)->lo_header->loh_attr &= ~LOHA_EXISTS;
if (reply == NULL || reply->ourp_magic != UPDATE_REPLY_MAGIC)
GOTO(out, rc = -EPROTO);
- rc = osp_get_attr_from_reply(env, reply, attr, obj, 0);
+ rc = osp_get_attr_from_reply(env, reply, req, attr, obj, 0);
if (rc != 0)
GOTO(out, rc);
static int osp_xattr_get_interpterer(const struct lu_env *env,
struct object_update_reply *reply,
+ struct ptlrpc_request *req,
struct osp_object *obj,
void *data, int index, int rc)
{
rc1 = -EINVAL;
}
- oaui->oaui_interpterer(env, reply, oaui->oaui_obj,
+ oaui->oaui_interpterer(env, reply, req, oaui->oaui_obj,
oaui->oaui_data, index, rc1);
osp_async_update_item_fini(env, oaui);
index++;
list_for_each_entry_safe(oaui, next,
&update->dur_cb_items, oaui_list) {
list_del_init(&oaui->oaui_list);
- oaui->oaui_interpterer(env, NULL, oaui->oaui_obj,
+ oaui->oaui_interpterer(env, NULL, NULL, oaui->oaui_obj,
oaui->oaui_data, 0, rc);
osp_async_update_item_fini(env, oaui);
}
RETURN(err_serious(-EPROTO));
}
- obdo_le_to_cpu(wobdo, wobdo);
+ if (ptlrpc_req_need_swab(tsi->tsi_pill->rc_req))
+ lustre_swab_obdo(wobdo);
lustre_get_wire_obdo(NULL, lobdo, wobdo);
la_from_obdo(attr, lobdo, lobdo->o_valid);
attr->la_valid = 0;
attr->la_valid = 0;
- obdo_le_to_cpu(wobdo, wobdo);
+
+ if (ptlrpc_req_need_swab(tsi->tsi_pill->rc_req))
+ lustre_swab_obdo(wobdo);
lustre_get_wire_obdo(NULL, lobdo, wobdo);
la_from_obdo(attr, lobdo, lobdo->o_valid);
obdo->o_valid = 0;
obdo_from_la(obdo, la, la->la_valid);
- obdo_cpu_to_le(obdo, obdo);
lustre_set_wire_obdo(NULL, obdo, obdo);
out_unlock: