LASSERT(lov->lov_tgts[i]->ltd_exp);
/* XXX: LOV STACKING: use real "obj_mdp" sub-data */
- err = obd_create(lov->lov_tgts[i]->ltd_exp,
+ err = obd_create(NULL, lov->lov_tgts[i]->ltd_exp,
tmp_oa, &obj_mdp, oti);
if (err) {
/* This export will be disabled until it is recovered,
if (i == lsm->lsm_stripe_count)
GOTO(out, rc = -EINVAL);
- rc = obd_create(lov->lov_tgts[ost_idx]->ltd_exp, src_oa, &obj_mdp, oti);
+ rc = obd_create(NULL, lov->lov_tgts[ost_idx]->ltd_exp,
+ src_oa, &obj_mdp, oti);
out:
OBD_FREE(obj_mdp, sizeof(*obj_mdp));
RETURN(rc);
}
/* the LOV expects oa->o_id to be set to the LOV object id */
-static int lov_create(struct obd_export *exp, struct obdo *src_oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti)
+static int lov_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *src_oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti)
{
struct lov_obd *lov;
struct obd_info oinfo;
"%p->lsm_magic=%x\n", (lsmp), (lsmp)->lsm_magic); \
} while (0)
-static int lov_destroy(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *lsm, struct obd_trans_info *oti,
- struct obd_export *md_exp, void *capa)
+static int lov_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *lsm,
+ struct obd_trans_info *oti, struct obd_export *md_exp,
+ void *capa)
{
struct lov_request_set *set;
struct obd_info oinfo;
if (oa->o_valid & OBD_MD_FLCOOKIE)
oti->oti_logcookies = set->set_cookies + req->rq_stripe;
- err = obd_destroy(lov->lov_tgts[req->rq_idx]->ltd_exp,
+ err = obd_destroy(env, lov->lov_tgts[req->rq_idx]->ltd_exp,
req->rq_oi.oi_oa, NULL, oti, NULL, capa);
err = lov_update_common_set(set, req, err);
if (err) {
RETURN(rc ? rc : err);
}
-static int lov_getattr(struct obd_export *exp, struct obd_info *oinfo)
+static int lov_getattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo)
{
struct lov_request_set *set;
struct lov_request *req;
"%u\n", oinfo->oi_oa->o_id, req->rq_stripe,
req->rq_oi.oi_oa->o_id, req->rq_idx);
- rc = obd_getattr(lov->lov_tgts[req->rq_idx]->ltd_exp,
+ rc = obd_getattr(env, lov->lov_tgts[req->rq_idx]->ltd_exp,
&req->rq_oi);
err = lov_update_common_set(set, req, rc);
if (err) {
RETURN(rc ? rc : err);
}
-static int lov_setattr(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti)
+static int lov_setattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti)
{
struct lov_request_set *set;
struct lov_obd *lov;
cfs_list_for_each (pos, &set->set_list) {
req = cfs_list_entry(pos, struct lov_request, rq_link);
- rc = obd_setattr(lov->lov_tgts[req->rq_idx]->ltd_exp,
+ rc = obd_setattr(env, lov->lov_tgts[req->rq_idx]->ltd_exp,
&req->rq_oi, NULL);
err = lov_update_setattr_set(set, req, rc);
if (err) {
/* FIXME: maybe we'll just make one node the authoritative attribute node, then
* we can send this 'punch' to just the authoritative node and the nodes
* that the punch will affect. */
-static int lov_punch(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti,
+static int lov_punch(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti,
struct ptlrpc_request_set *rqset)
{
struct lov_request_set *set;
cfs_list_for_each (pos, &set->set_list) {
req = cfs_list_entry(pos, struct lov_request, rq_link);
- rc = obd_punch(lov->lov_tgts[req->rq_idx]->ltd_exp,
+ rc = obd_punch(env, lov->lov_tgts[req->rq_idx]->ltd_exp,
&req->rq_oi, NULL, rqset);
if (rc) {
CERROR("error: punch objid "LPX64" subobj "LPX64
RETURN(rc ?: err);
}
-static int lov_sync(struct obd_export *exp, struct obd_info *oinfo,
- obd_off start, obd_off end,
+static int lov_sync(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, obd_off start, obd_off end,
struct ptlrpc_request_set *rqset)
{
struct lov_request_set *set = NULL;
cfs_list_for_each (pos, &set->set_list) {
req = cfs_list_entry(pos, struct lov_request, rq_link);
- rc = obd_sync(lov->lov_tgts[req->rq_idx]->ltd_exp, &req->rq_oi,
- req->rq_oi.oi_policy.l_extent.start,
+ rc = obd_sync(env, lov->lov_tgts[req->rq_idx]->ltd_exp,
+ &req->rq_oi, req->rq_oi.oi_policy.l_extent.start,
req->rq_oi.oi_policy.l_extent.end, rqset);
if (rc) {
CERROR("error: fsync objid "LPX64" subobj "LPX64
RETURN(rc ? rc : err);
}
-static int lov_statfs_async(struct obd_device *obd, struct obd_info *oinfo,
+static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
__u64 max_age, struct ptlrpc_request_set *rqset)
{
+ struct obd_device *obd = class_exp2obd(exp);
struct lov_request_set *set;
struct lov_request *req;
cfs_list_t *pos;
RETURN(rc);
cfs_list_for_each (pos, &set->set_list) {
- struct obd_device *osc_obd;
-
req = cfs_list_entry(pos, struct lov_request, rq_link);
-
- osc_obd = class_exp2obd(lov->lov_tgts[req->rq_idx]->ltd_exp);
- rc = obd_statfs_async(osc_obd, &req->rq_oi, max_age, rqset);
+ rc = obd_statfs_async(lov->lov_tgts[req->rq_idx]->ltd_exp,
+ &req->rq_oi, max_age, rqset);
if (rc)
break;
}
RETURN(0);
}
-static int lov_statfs(struct obd_device *obd, struct obd_statfs *osfs,
- __u64 max_age, __u32 flags)
+static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
+ struct obd_statfs *osfs, __u64 max_age, __u32 flags)
{
struct ptlrpc_request_set *set = NULL;
struct obd_info oinfo = { { { 0 } } };
oinfo.oi_osfs = osfs;
oinfo.oi_flags = flags;
- rc = lov_statfs_async(obd, &oinfo, max_age, set);
+ rc = lov_statfs_async(exp, &oinfo, max_age, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(-EFAULT);
/* got statfs data */
- rc = obd_statfs(osc_obd, &stat_buf,
+ rc = obd_statfs(NULL, lov->lov_tgts[index]->ltd_exp, &stat_buf,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
0);
if (rc)
fm_local->fm_flags &= ~FIEMAP_FLAG_DEVICE_ORDER;
memcpy(&fm_key->fiemap, fm_local, sizeof(*fm_local));
*vallen=fiemap_count_to_size(fm_local->fm_extent_count);
- rc = obd_get_info(lov->lov_tgts[ost_index]->ltd_exp,
+ rc = obd_get_info(NULL,
+ lov->lov_tgts[ost_index]->ltd_exp,
keylen, key, vallen, fm_local, lsm);
if (rc != 0)
GOTO(out, rc);
return rc;
}
-static int lov_get_info(struct obd_export *exp, __u32 keylen,
- void *key, __u32 *vallen, void *val,
+static int lov_get_info(const struct lu_env *env, struct obd_export *exp,
+ __u32 keylen, void *key, __u32 *vallen, void *val,
struct lov_stripe_md *lsm)
{
struct obd_device *obddev = class_exp2obd(exp);
if (!tgt || !tgt->ltd_active)
GOTO(out, rc = -ESRCH);
- rc = obd_get_info(tgt->ltd_exp, keylen, key, &size, info->data, NULL);
+ rc = obd_get_info(env, tgt->ltd_exp, keylen, key,
+ &size, info->data, NULL);
GOTO(out, rc = 0);
} else if (KEY_IS(KEY_LOVDESC)) {
struct lov_desc *desc_ret = val;
RETURN(rc);
}
-static int lov_set_info_async(struct obd_export *exp, obd_count keylen,
- void *key, obd_count vallen, void *val,
- struct ptlrpc_request_set *set)
+static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
+ obd_count keylen, void *key, obd_count vallen,
+ void *val, struct ptlrpc_request_set *set)
{
struct obd_device *obddev = class_exp2obd(exp);
struct lov_obd *lov = &obddev->u.lov;
&tgt->ltd_uuid))
continue;
- err = obd_set_info_async(tgt->ltd_exp,
+ err = obd_set_info_async(env, tgt->ltd_exp,
keylen, key, sizeof(int),
&mgi->group, set);
} else if (next_id) {
- err = obd_set_info_async(tgt->ltd_exp,
+ err = obd_set_info_async(env, tgt->ltd_exp,
keylen, key, vallen,
((struct obd_id_info*)val)->data, set);
} else if (capa) {
!obd_uuid_equals(info->uuid, &tgt->ltd_uuid))
continue;
- err = obd_set_info_async(tgt->ltd_exp, keylen, key,
- sizeof(*info->capa),
+ err = obd_set_info_async(env, tgt->ltd_exp, keylen,
+ key, sizeof(*info->capa),
info->capa, set);
} else {
/* Only want a specific OSC */
!obd_uuid_equals(val, &tgt->ltd_uuid))
continue;
- err = obd_set_info_async(tgt->ltd_exp,
+ err = obd_set_info_async(env, tgt->ltd_exp,
keylen, key, vallen, val, set);
}