struct lu_attr *attr, struct dt_allocation_hint *hint,
struct dt_object_format *dof, struct thandle *th)
{
- struct osp_update_request *update;
- struct osp_object *obj = dt2osp_obj(dt);
- int rc;
+ struct osp_update_request *update;
+ struct osp_object *obj = dt2osp_obj(dt);
+ int rc;
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
LASSERT(attr->la_valid & LA_TYPE);
- rc = osp_update_rpc_pack(env, create, update, OUT_CREATE,
+ rc = OSP_UPDATE_RPC_PACK(env, out_create_pack, update,
lu_object_fid(&dt->do_lu), attr, hint, dof);
if (rc != 0)
GOTO(out, rc);
static int osp_md_ref_del(const struct lu_env *env, struct dt_object *dt,
struct thandle *th)
{
- struct osp_update_request *update;
- int rc;
+ struct osp_update_request *update;
+ int rc;
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = osp_update_rpc_pack(env, ref_del, update, OUT_REF_DEL,
+ rc = OSP_UPDATE_RPC_PACK(env, out_ref_del_pack, update,
lu_object_fid(&dt->do_lu));
return rc;
}
static int osp_md_ref_add(const struct lu_env *env, struct dt_object *dt,
struct thandle *th)
{
- struct osp_update_request *update;
- int rc;
+ struct osp_update_request *update;
+ int rc;
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = osp_update_rpc_pack(env, ref_add, update, OUT_REF_ADD,
+ rc = OSP_UPDATE_RPC_PACK(env, out_ref_add_pack, update,
lu_object_fid(&dt->do_lu));
return rc;
}
int osp_md_attr_set(const struct lu_env *env, struct dt_object *dt,
const struct lu_attr *attr, struct thandle *th)
{
- struct osp_update_request *update;
- int rc;
+ struct osp_update_request *update;
+ int rc;
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = osp_update_rpc_pack(env, attr_set, update, OUT_ATTR_SET,
+ rc = OSP_UPDATE_RPC_PACK(env, out_attr_set_pack, update,
lu_object_fid(&dt->do_lu), attr);
return rc;
}
if (IS_ERR(update))
RETURN(PTR_ERR(update));
- rc = osp_update_rpc_pack(env, index_lookup, update, OUT_INDEX_LOOKUP,
+ rc = OSP_UPDATE_RPC_PACK(env, out_index_lookup_pack, update,
lu_object_fid(&dt->do_lu), rec, key);
if (rc != 0) {
CERROR("%s: Insert update error: rc = %d\n",
* \retval 0 if packing index insert succeeds.
* \retval negative errno if packing fails.
*/
-static int osp_md_index_insert(const struct lu_env *env,
- struct dt_object *dt,
+static int osp_md_index_insert(const struct lu_env *env, struct dt_object *dt,
const struct dt_rec *rec,
- const struct dt_key *key,
- struct thandle *th,
+ const struct dt_key *key, struct thandle *th,
int ignore_quota)
{
struct osp_update_request *update;
- int rc;
+ int rc;
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = osp_update_rpc_pack(env, index_insert, update, OUT_INDEX_INSERT,
+ rc = OSP_UPDATE_RPC_PACK(env, out_index_insert_pack, update,
lu_object_fid(&dt->do_lu), rec, key);
return rc;
}
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = osp_update_rpc_pack(env, index_delete, update, OUT_INDEX_DELETE,
+ rc = OSP_UPDATE_RPC_PACK(env, out_index_delete_pack, update,
lu_object_fid(&dt->do_lu), key);
return rc;
if (IS_ERR(update))
RETURN(PTR_ERR(update));
- rc = osp_update_rpc_pack(env, xattr_list, update, OUT_XATTR_LIST,
+ rc = OSP_UPDATE_RPC_PACK(env, out_xattr_list_pack, update,
lu_object_fid(&dt->do_lu), buf->lb_len);
if (rc) {
CERROR("%s: Insert update error "DFID": rc = %d\n",
int osp_md_destroy(const struct lu_env *env, struct dt_object *dt,
struct thandle *th)
{
- struct osp_object *o = dt2osp_obj(dt);
- struct osp_device *osp = lu2osp_dev(dt->do_lu.lo_dev);
- struct osp_update_request *update;
- int rc = 0;
+ struct osp_object *o = dt2osp_obj(dt);
+ struct osp_device *osp = lu2osp_dev(dt->do_lu.lo_dev);
+ struct osp_update_request *update;
+ int rc = 0;
ENTRY;
o->opo_non_exist = 1;
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = osp_update_rpc_pack(env, destroy, update, OUT_DESTROY,
+ rc = OSP_UPDATE_RPC_PACK(env, out_destroy_pack, update,
lu_object_fid(&dt->do_lu));
if (rc != 0)
RETURN(rc);
CDEBUG(D_INFO, "write "DFID" offset = %llu length = %zu\n",
PFID(lu_object_fid(&dt->do_lu)), *pos, buf->lb_len);
- rc = osp_update_rpc_pack(env, write, update, OUT_WRITE,
+ rc = OSP_UPDATE_RPC_PACK(env, out_write_pack, update,
lu_object_fid(&dt->do_lu), buf, *pos);
if (rc < 0)
RETURN(rc);
if (IS_ERR(update))
RETURN(PTR_ERR(update));
- rc = osp_update_rpc_pack(env, read, update, OUT_READ,
+ rc = OSP_UPDATE_RPC_PACK(env, out_read_pack, update,
lu_object_fid(&dt->do_lu),
rbuf->lb_len, *pos);
if (rc != 0) {
if (IS_ERR(update))
RETURN(PTR_ERR(update));
- rc = osp_update_rpc_pack(env, attr_get, update, OUT_ATTR_GET,
+ rc = OSP_UPDATE_RPC_PACK(env, out_attr_get_pack, update,
lu_object_fid(&dt->do_lu));
if (rc != 0) {
CERROR("%s: Insert update error "DFID": rc = %d\n",
if (IS_ERR(update))
RETURN(PTR_ERR(update));
- rc = osp_update_rpc_pack(env, attr_set, update,
- OUT_ASTTR_SET,
+ rc = OSP_UPDATE_RPC_PACK(env, out_attr_set_pack, update,
lu_object_fid(&dt->do_lu),
attr);
if (rc != 0) {
if (IS_ERR(update))
GOTO(out, rc = PTR_ERR(update));
- rc = osp_update_rpc_pack(env, xattr_get, update, OUT_XATTR_GET,
+ rc = OSP_UPDATE_RPC_PACK(env, out_xattr_get_pack, update,
lu_object_fid(&dt->do_lu), name, buf->lb_len);
if (rc != 0) {
CERROR("%s: Insert update error "DFID": rc = %d\n",
const struct lu_buf *buf, const char *name, int fl,
struct thandle *th)
{
- struct osp_object *o = dt2osp_obj(dt);
+ struct osp_object *o = dt2osp_obj(dt);
struct osp_update_request *update;
- struct osp_xattr_entry *oxe;
- int rc;
+ struct osp_xattr_entry *oxe;
+ int rc;
ENTRY;
update = thandle_to_osp_update_request(th);
CDEBUG(D_INODE, DFID" set xattr '%s' with size %zd\n",
PFID(lu_object_fid(&dt->do_lu)), name, buf->lb_len);
- rc = osp_update_rpc_pack(env, xattr_set, update, OUT_XATTR_SET,
+ rc = OSP_UPDATE_RPC_PACK(env, out_xattr_set_pack, update,
lu_object_fid(&dt->do_lu), buf, name, fl);
if (rc != 0)
RETURN(rc);
const char *name, struct thandle *th)
{
struct osp_update_request *update;
- const struct lu_fid *fid = lu_object_fid(&dt->do_lu);
- struct osp_object *o = dt2osp_obj(dt);
- struct osp_xattr_entry *oxe;
- int rc;
+ const struct lu_fid *fid = lu_object_fid(&dt->do_lu);
+ struct osp_object *o = dt2osp_obj(dt);
+ struct osp_xattr_entry *oxe;
+ int rc;
update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = osp_update_rpc_pack(env, xattr_del, update, OUT_XATTR_DEL,
- fid, name);
+ rc = OSP_UPDATE_RPC_PACK(env, out_xattr_del_pack, update, fid, name);
if (rc != 0)
return rc;