* \retval 0 for success
* \retval negative error number on failure
*/
-static int osp_oac_init(struct osp_object *obj)
+int osp_oac_init(struct osp_object *obj)
{
struct osp_object_attr *ooa;
struct osp_device *osp = lu2osp_dev(dt->do_lu.lo_dev);
struct osp_object *obj = dt2osp_obj(dt);
struct dt_device *dev = &osp->opd_dt_dev;
- struct dt_update_request *update;
+ struct osp_update_request *update;
struct object_update_reply *reply;
struct ptlrpc_request *req = NULL;
int rc = 0;
spin_unlock(&obj->opo_lock);
}
- update = dt_update_request_create(dev);
+ update = osp_update_request_create(dev);
if (IS_ERR(update))
RETURN(PTR_ERR(update));
- rc = out_attr_get_pack(env, &update->dur_buf,
- lu_object_fid(&dt->do_lu));
+ rc = osp_update_rpc_pack(env, attr_get, update, OUT_ATTR_GET,
+ lu_object_fid(&dt->do_lu));
if (rc != 0) {
CERROR("%s: Insert update error "DFID": rc = %d\n",
dev->dd_lu_dev.ld_obd->obd_name,
if (req != NULL)
ptlrpc_req_finished(req);
- dt_update_request_destroy(update);
+ osp_update_request_destroy(update);
return rc;
}
mutex_unlock(&osp->opd_async_requests_mutex);
osp_oac_xattr_put(oxe);
} else {
- struct dt_update_request *update;
+ struct osp_update_request *update;
/* XXX: Currently, we trigger the batched async OUT
* RPC via dt_declare_xattr_get(). It is not
*
* We will improve it in the future. */
update = osp->opd_async_requests;
- if (update != NULL && update->dur_buf.ub_req != NULL &&
- update->dur_buf.ub_req->ourq_count > 0) {
+ if (update != NULL && update->our_req != NULL &&
+ update->our_req->ourq_count > 0) {
osp->opd_async_requests = NULL;
mutex_unlock(&osp->opd_async_requests_mutex);
rc = osp_unplug_async_request(env, osp, update);
struct osp_object *obj = dt2osp_obj(dt);
struct dt_device *dev = &osp->opd_dt_dev;
struct lu_buf *rbuf = &osp_env_info(env)->osi_lb2;
- struct dt_update_request *update = NULL;
+ struct osp_update_request *update = NULL;
struct ptlrpc_request *req = NULL;
struct object_update_reply *reply;
struct osp_xattr_entry *oxe = NULL;
spin_unlock(&obj->opo_lock);
}
- update = dt_update_request_create(dev);
+ update = osp_update_request_create(dev);
if (IS_ERR(update))
GOTO(out, rc = PTR_ERR(update));
- rc = out_xattr_get_pack(env, &update->dur_buf,
- lu_object_fid(&dt->do_lu), name);
+ rc = osp_update_rpc_pack(env, xattr_get, update, OUT_XATTR_GET,
+ lu_object_fid(&dt->do_lu), name);
if (rc != 0) {
CERROR("%s: Insert update error "DFID": rc = %d\n",
dname, PFID(lu_object_fid(&dt->do_lu)), rc);
ptlrpc_req_finished(req);
if (update != NULL && !IS_ERR(update))
- dt_update_request_destroy(update);
+ osp_update_request_destroy(update);
if (oxe != NULL)
osp_oac_xattr_put(oxe);
struct thandle *th)
{
struct osp_object *o = dt2osp_obj(dt);
- struct dt_update_request *update;
+ struct osp_update_request *update;
struct osp_xattr_entry *oxe;
int rc;
ENTRY;
- LASSERT(buf->lb_len > 0 && buf->lb_buf != NULL);
- update = thandle_to_dt_update_request(th);
+ update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
CDEBUG(D_INODE, DFID" set xattr '%s' with size %zd\n",
PFID(lu_object_fid(&dt->do_lu)), name, buf->lb_len);
- rc = out_xattr_set_pack(env, &update->dur_buf,
- lu_object_fid(&dt->do_lu),
- buf, name, fl, update->dur_batchid);
+ rc = osp_update_rpc_pack(env, xattr_set, update, OUT_XATTR_SET,
+ lu_object_fid(&dt->do_lu), buf, name, fl);
if (rc != 0 || o->opo_ooa == NULL)
- return rc;
+ RETURN(rc);
oxe = osp_oac_xattr_find_or_add(o, name, buf->lb_len);
if (oxe == NULL) {
int osp_xattr_del(const struct lu_env *env, struct dt_object *dt,
const char *name, struct thandle *th)
{
- struct dt_update_request *update;
+ 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_object *o = dt2osp_obj(dt);
struct osp_xattr_entry *oxe;
int rc;
- update = thandle_to_dt_update_request(th);
+ update = thandle_to_osp_update_request(th);
LASSERT(update != NULL);
- rc = out_xattr_del_pack(env, &update->dur_buf, fid, name,
- update->dur_batchid);
+ rc = osp_update_rpc_pack(env, xattr_del, update, OUT_XATTR_DEL,
+ fid, name);
if (rc != 0 || o->opo_ooa == NULL)
return rc;
int rc = 0;
ENTRY;
+
o->opo_non_exist = 1;
LASSERT(!osp->opd_connect_mdt);