cfs_module_t *o_owner;
int (*o_iocontrol)(unsigned int cmd, struct obd_export *exp, int len,
void *karg, void *uarg);
- int (*o_get_info)(struct obd_export *, __u32 keylen, void *key,
- __u32 *vallen, void *val, struct lov_stripe_md *lsm);
- int (*o_set_info_async)(struct obd_export *, __u32 keylen, void *key,
+ int (*o_get_info)(const struct lu_env *env, struct obd_export *,
+ __u32 keylen, void *key, __u32 *vallen, void *val,
+ struct lov_stripe_md *lsm);
+ int (*o_set_info_async)(const struct lu_env *, struct obd_export *,
+ __u32 keylen, void *key,
__u32 vallen, void *val,
struct ptlrpc_request_set *set);
int (*o_attach)(struct obd_device *dev, obd_count len, void *data);
*/
int (*o_fid_delete)(struct obd_export *exp, const struct lu_fid *fid);
- int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs,
- __u64 max_age, __u32 flags);
- int (*o_statfs_async)(struct obd_device *obd, struct obd_info *oinfo,
+ int (*o_statfs)(const struct lu_env *, struct obd_export *exp,
+ struct obd_statfs *osfs, __u64 max_age, __u32 flags);
+ int (*o_statfs_async)(struct obd_export *exp, struct obd_info *oinfo,
__u64 max_age, struct ptlrpc_request_set *set);
int (*o_packmd)(struct obd_export *exp, struct lov_mds_md **disk_tgt,
struct lov_stripe_md *mem_src);
obd_id *ids);
/* FIXME: add fid capability support for create & destroy! */
int (*o_precreate)(struct obd_export *exp);
- int (*o_create)(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti);
+ int (*o_create)(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti);
int (*o_create_async)(struct obd_export *exp, struct obd_info *oinfo,
struct lov_stripe_md **ea,
struct obd_trans_info *oti);
- int (*o_destroy)(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *ea, struct obd_trans_info *oti,
- struct obd_export *md_exp, void *capa);
- int (*o_setattr)(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti);
+ int (*o_destroy)(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *ea,
+ struct obd_trans_info *oti, struct obd_export *md_exp,
+ void *capa);
+ int (*o_setattr)(const struct lu_env *, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti);
int (*o_setattr_async)(struct obd_export *exp, struct obd_info *oinfo,
struct obd_trans_info *oti,
struct ptlrpc_request_set *rqset);
- int (*o_getattr)(struct obd_export *exp, struct obd_info *oinfo);
+ int (*o_getattr)(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo);
int (*o_getattr_async)(struct obd_export *exp, struct obd_info *oinfo,
struct ptlrpc_request_set *set);
int (*o_brw)(int rw, struct obd_export *exp, struct obd_info *oinfo,
struct ost_lvb *lvb, int kms_only);
int (*o_adjust_kms)(struct obd_export *exp, struct lov_stripe_md *lsm,
obd_off size, int shrink);
- int (*o_punch)(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti,
+ int (*o_punch)(const struct lu_env *, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti,
struct ptlrpc_request_set *rqset);
- int (*o_sync)(struct obd_export *exp, struct obd_info *oinfo,
- obd_size start, obd_size end,
+ int (*o_sync)(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, obd_size start, obd_size end,
struct ptlrpc_request_set *set);
int (*o_migrate)(struct lustre_handle *conn, struct lov_stripe_md *dst,
struct lov_stripe_md *src, obd_size start,
int (*o_iterate)(struct lustre_handle *conn,
int (*)(obd_id, obd_seq, void *),
obd_id *startid, obd_seq seq, void *data);
- int (*o_preprw)(int cmd, struct obd_export *exp, struct obdo *oa,
- int objcount, struct obd_ioobj *obj,
- struct niobuf_remote *remote, int *nr_pages,
- struct niobuf_local *local,
- struct obd_trans_info *oti,
- struct lustre_capa *capa);
- int (*o_commitrw)(int cmd, struct obd_export *exp, struct obdo *oa,
+ int (*o_preprw)(const struct lu_env *env, int cmd,
+ struct obd_export *exp, struct obdo *oa, int objcount,
+ struct obd_ioobj *obj, struct niobuf_remote *remote,
+ int *nr_pages, struct niobuf_local *local,
+ struct obd_trans_info *oti, struct lustre_capa *capa);
+ int (*o_commitrw)(const struct lu_env *env, int cmd,
+ struct obd_export *exp, struct obdo *oa,
int objcount, struct obd_ioobj *obj,
struct niobuf_remote *remote, int pages,
struct niobuf_local *local,
int (*o_notify)(struct obd_device *obd, struct obd_device *watched,
enum obd_notify_event ev, void *data);
- int (*o_health_check)(struct obd_device *);
+ int (*o_health_check)(const struct lu_env *env, struct obd_device *);
struct obd_uuid *(*o_get_uuid) (struct obd_export *exp);
/* quota methods */
struct ptlrpc_request_set *rqset);
- int (*o_ping)(struct obd_export *exp);
+ int (*o_ping)(const struct lu_env *, struct obd_export *exp);
/* pools methods */
int (*o_pool_new)(struct obd_device *obd, char *poolname);
return MAX_OBD_DEVICES;
}
-static inline int obd_get_info(struct obd_export *exp, __u32 keylen,
+static inline int obd_get_info(const struct lu_env *env,
+ struct obd_export *exp, __u32 keylen,
void *key, __u32 *vallen, void *val,
struct lov_stripe_md *lsm)
{
EXP_CHECK_DT_OP(exp, get_info);
EXP_COUNTER_INCREMENT(exp, get_info);
- rc = OBP(exp->exp_obd, get_info)(exp, keylen, key, vallen, val, lsm);
+ rc = OBP(exp->exp_obd, get_info)(env, exp, keylen, key, vallen, val,
+ lsm);
RETURN(rc);
}
-static inline int obd_set_info_async(struct obd_export *exp, obd_count keylen,
+static inline int obd_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)
{
EXP_CHECK_DT_OP(exp, set_info_async);
EXP_COUNTER_INCREMENT(exp, set_info_async);
- rc = OBP(exp->exp_obd, set_info_async)(exp, keylen, key, vallen, val,
- set);
+ rc = OBP(exp->exp_obd, set_info_async)(env, exp, keylen, key, vallen,
+ val, set);
RETURN(rc);
}
RETURN(rc);
}
-static inline int obd_create(struct obd_export *exp, struct obdo *obdo,
- struct lov_stripe_md **ea,
+static inline int obd_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *obdo, struct lov_stripe_md **ea,
struct obd_trans_info *oti)
{
int rc;
EXP_CHECK_DT_OP(exp, create);
EXP_COUNTER_INCREMENT(exp, create);
- rc = OBP(exp->exp_obd, create)(exp, obdo, ea, oti);
+ rc = OBP(exp->exp_obd, create)(env, exp, obdo, ea, oti);
RETURN(rc);
}
-static inline int obd_destroy(struct obd_export *exp, struct obdo *obdo,
- struct lov_stripe_md *ea,
+static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *obdo, struct lov_stripe_md *ea,
struct obd_trans_info *oti,
struct obd_export *md_exp, void *capa)
{
EXP_CHECK_DT_OP(exp, destroy);
EXP_COUNTER_INCREMENT(exp, destroy);
- rc = OBP(exp->exp_obd, destroy)(exp, obdo, ea, oti, md_exp, capa);
+ rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, ea, oti, md_exp, capa);
RETURN(rc);
}
-static inline int obd_getattr(struct obd_export *exp, struct obd_info *oinfo)
+static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo)
{
int rc;
ENTRY;
EXP_CHECK_DT_OP(exp, getattr);
EXP_COUNTER_INCREMENT(exp, getattr);
- rc = OBP(exp->exp_obd, getattr)(exp, oinfo);
+ rc = OBP(exp->exp_obd, getattr)(env, exp, oinfo);
RETURN(rc);
}
RETURN(rc);
}
-static inline int obd_setattr(struct obd_export *exp, struct obd_info *oinfo,
+static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo,
struct obd_trans_info *oti)
{
int rc;
EXP_CHECK_DT_OP(exp, setattr);
EXP_COUNTER_INCREMENT(exp, setattr);
- rc = OBP(exp->exp_obd, setattr)(exp, oinfo, oti);
+ rc = OBP(exp->exp_obd, setattr)(env, exp, oinfo, oti);
RETURN(rc);
}
RETURN(rc);
}
-static inline int obd_ping(struct obd_export *exp)
+static inline int obd_ping(const struct lu_env *env, struct obd_export *exp)
{
int rc;
ENTRY;
OBD_CHECK_DT_OP(exp->exp_obd, ping, 0);
EXP_COUNTER_INCREMENT(exp, ping);
- rc = OBP(exp->exp_obd, ping)(exp);
+ rc = OBP(exp->exp_obd, ping)(env, exp);
RETURN(rc);
}
/* @max_age is the oldest time in jiffies that we accept using a cached data.
* If the cache is older than @max_age we will get a new value from the
* target. Use a value of "cfs_time_current() + HZ" to guarantee freshness. */
-static inline int obd_statfs_async(struct obd_device *obd,
+static inline int obd_statfs_async(struct obd_export *exp,
struct obd_info *oinfo,
__u64 max_age,
struct ptlrpc_request_set *rqset)
{
int rc = 0;
+ struct obd_device *obd;
ENTRY;
- if (obd == NULL)
+ if (exp == NULL || exp->exp_obd == NULL)
RETURN(-EINVAL);
+ obd = exp->exp_obd;
OBD_CHECK_DT_OP(obd, statfs, -EOPNOTSUPP);
OBD_COUNTER_INCREMENT(obd, statfs);
CDEBUG(D_SUPER, "%s: osfs %p age "LPU64", max_age "LPU64"\n",
obd->obd_name, &obd->obd_osfs, obd->obd_osfs_age, max_age);
if (cfs_time_before_64(obd->obd_osfs_age, max_age)) {
- rc = OBP(obd, statfs_async)(obd, oinfo, max_age, rqset);
+ rc = OBP(obd, statfs_async)(exp, oinfo, max_age, rqset);
} else {
CDEBUG(D_SUPER,"%s: use %p cache blocks "LPU64"/"LPU64
" objects "LPU64"/"LPU64"\n",
RETURN(rc);
}
-static inline int obd_statfs_rqset(struct obd_device *obd,
+static inline int obd_statfs_rqset(struct obd_export *exp,
struct obd_statfs *osfs, __u64 max_age,
__u32 flags)
{
oinfo.oi_osfs = osfs;
oinfo.oi_flags = flags;
- rc = obd_statfs_async(obd, &oinfo, max_age, set);
+ rc = obd_statfs_async(exp, &oinfo, max_age, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
/* @max_age is the oldest time in jiffies that we accept using a cached data.
* If the cache is older than @max_age we will get a new value from the
* target. Use a value of "cfs_time_current() + HZ" to guarantee freshness. */
-static inline int obd_statfs(struct obd_device *obd, struct obd_statfs *osfs,
- __u64 max_age, __u32 flags)
+static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
+ struct obd_statfs *osfs, __u64 max_age,
+ __u32 flags)
{
int rc = 0;
+ struct obd_device *obd = exp->exp_obd;
ENTRY;
if (obd == NULL)
CDEBUG(D_SUPER, "osfs "LPU64", max_age "LPU64"\n",
obd->obd_osfs_age, max_age);
if (cfs_time_before_64(obd->obd_osfs_age, max_age)) {
- rc = OBP(obd, statfs)(obd, osfs, max_age, flags);
+ rc = OBP(obd, statfs)(env, exp, osfs, max_age, flags);
if (rc == 0) {
cfs_spin_lock(&obd->obd_osfs_lock);
memcpy(&obd->obd_osfs, osfs, sizeof(obd->obd_osfs));
if (set == NULL)
RETURN(-ENOMEM);
- rc = OBP(exp->exp_obd, sync)(exp, oinfo, start, end, set);
+ rc = OBP(exp->exp_obd, sync)(NULL, exp, oinfo, start, end, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
}
-static inline int obd_sync(struct obd_export *exp, struct obd_info *oinfo,
- obd_size start, obd_size end,
+static inline int obd_sync(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, obd_size start, obd_size end,
struct ptlrpc_request_set *set)
{
int rc;
OBD_CHECK_DT_OP(exp->exp_obd, sync, -EOPNOTSUPP);
EXP_COUNTER_INCREMENT(exp, sync);
- rc = OBP(exp->exp_obd, sync)(exp, oinfo, start, end, set);
+ rc = OBP(exp->exp_obd, sync)(env, exp, oinfo, start, end, set);
RETURN(rc);
}
if (set == NULL)
RETURN(-ENOMEM);
- rc = OBP(exp->exp_obd, punch)(exp, oinfo, oti, set);
+ rc = OBP(exp->exp_obd, punch)(NULL, exp, oinfo, oti, set);
if (rc == 0)
rc = ptlrpc_set_wait(set);
ptlrpc_set_destroy(set);
RETURN(rc);
}
-static inline int obd_punch(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti,
+static inline int obd_punch(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti,
struct ptlrpc_request_set *rqset)
{
int rc;
EXP_CHECK_DT_OP(exp, punch);
EXP_COUNTER_INCREMENT(exp, punch);
- rc = OBP(exp->exp_obd, punch)(exp, oinfo, oti, rqset);
+ rc = OBP(exp->exp_obd, punch)(env, exp, oinfo, oti, rqset);
RETURN(rc);
}
RETURN(rc);
}
-static inline int obd_preprw(int cmd, struct obd_export *exp, struct obdo *oa,
+static inline int obd_preprw(const struct lu_env *env, int cmd,
+ struct obd_export *exp, struct obdo *oa,
int objcount, struct obd_ioobj *obj,
struct niobuf_remote *remote, int *pages,
struct niobuf_local *local,
EXP_CHECK_DT_OP(exp, preprw);
EXP_COUNTER_INCREMENT(exp, preprw);
- rc = OBP(exp->exp_obd, preprw)(cmd, exp, oa, objcount, obj, remote,
+ rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote,
pages, local, oti, capa);
RETURN(rc);
}
-static inline int obd_commitrw(int cmd, struct obd_export *exp, struct obdo *oa,
+static inline int obd_commitrw(const struct lu_env *env, int cmd,
+ struct obd_export *exp, struct obdo *oa,
int objcount, struct obd_ioobj *obj,
struct niobuf_remote *rnb, int pages,
struct niobuf_local *local,
EXP_CHECK_DT_OP(exp, commitrw);
EXP_COUNTER_INCREMENT(exp, commitrw);
- rc = OBP(exp->exp_obd, commitrw)(cmd, exp, oa, objcount, obj,
+ rc = OBP(exp->exp_obd, commitrw)(env, cmd, exp, oa, objcount, obj,
rnb, pages, local, oti, rc);
RETURN(rc);
}
RETURN(rc);
}
-static inline int obd_health_check(struct obd_device *obd)
+static inline int obd_health_check(const struct lu_env *env,
+ struct obd_device *obd)
{
/* returns: 0 on healthy
* >0 on unhealthy + reason code/flag
if (!OBP(obd, health_check))
RETURN(0);
- rc = OBP(obd, health_check)(obd);
+ rc = OBP(obd, health_check)(env, obd);
RETURN(rc);
}
__u16 stripes;
ENTRY;
- rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
+ rc = obd_get_info(NULL, dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
&valsize, &desc, NULL);
if (rc)
RETURN(rc);
if (export->exp_imp_reverse != NULL) {
/* destroyed import can be still referenced in ctxt */
- obd_set_info_async(export, sizeof(KEY_REVIMP_UPD),
- KEY_REVIMP_UPD, 0, NULL, NULL);
+ obd_set_info_async(req->rq_svc_thread->t_env, export,
+ sizeof(KEY_REVIMP_UPD), KEY_REVIMP_UPD,
+ 0, NULL, NULL);
client_destroy_import(export->exp_imp_reverse);
}
int target_handle_ping(struct ptlrpc_request *req)
{
- obd_ping(req->rq_export);
+ obd_ping(req->rq_svc_thread->t_env, req->rq_export);
return req_capsule_server_pack(&req->rq_pill);
}
if (KEY_IS(KEY_HSM_COPYTOOL_SEND))
/* Pass it on to mdc (the "export" in this case) */
- rc = obd_set_info_async(req->rq_export,
+ rc = obd_set_info_async(req->rq_svc_thread->t_env,
+ req->rq_export,
sizeof(KEY_HSM_COPYTOOL_SEND),
KEY_HSM_COPYTOOL_SEND,
vallen, val, NULL);
}
}
- rc = obd_destroy(llu_i2obdexp(dir), oa, lsm, &oti, NULL, NULL);
+ rc = obd_destroy(NULL, llu_i2obdexp(dir), oa, lsm, &oti, NULL, NULL);
OBDO_FREE(oa);
if (rc)
CERROR("obd destroy objid 0x"LPX64" error %d\n",
RETURN(0);
/* get our offset in the lov */
- rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe, lsm);
+ rc = obd_get_info(NULL, exp, sizeof(key), &key, &vallen, &stripe, lsm);
if (rc != 0) {
CERROR("obd_get_info: rc = %d\n", rc);
LBUG();
int rc;
ENTRY;
- rc = obd_statfs(class_exp2obd(sbi->ll_md_exp), osfs, max_age, 0);
+ rc = obd_statfs(NULL, sbi->ll_md_exp, osfs, max_age, 0);
if (rc) {
CERROR("md_statfs fails: rc = %d\n", rc);
RETURN(rc);
CERROR("MDC %s: not setup or attached\n", mdc);
GOTO(out_free, err = -EINVAL);
}
- obd_set_info_async(obd->obd_self_export, sizeof(KEY_ASYNC), KEY_ASYNC,
- sizeof(async), &async, NULL);
+ obd_set_info_async(NULL, obd->obd_self_export, sizeof(KEY_ASYNC),
+ KEY_ASYNC, sizeof(async), &async, NULL);
ocd.ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_VERSION |
OBD_CONNECT_FID | OBD_CONNECT_AT |
GOTO(out_free, err);
}
- err = obd_statfs(obd, &osfs, 100000000, 0);
+ err = obd_statfs(NULL, sbi->ll_md_exp, &osfs, 100000000, 0);
if (err)
GOTO(out_md, err);
CERROR("OSC %s: not setup or attached\n", osc);
GOTO(out_md, err = -EINVAL);
}
- obd_set_info_async(obd->obd_self_export, sizeof(KEY_ASYNC), KEY_ASYNC,
- sizeof(async), &async, NULL);
+ obd_set_info_async(NULL, obd->obd_self_export, sizeof(KEY_ASYNC),
+ KEY_ASYNC, sizeof(async), &async, NULL);
obd->obd_upcall.onu_owner = &sbi->ll_lco;
obd->obd_upcall.onu_upcall = cl_ocd_update;
return -ENOMEM;
strncpy(msp->mgs_param, string, MGS_PARAM_MAXLEN);
- rc = obd_set_info_async(mgc, sizeof(KEY_SET_INFO), KEY_SET_INFO,
+ rc = obd_set_info_async(NULL, mgc, sizeof(KEY_SET_INFO), KEY_SET_INFO,
sizeof(struct mgs_send_param), msp, NULL);
if (rc)
CERROR("Failed to set parameter: %d\n", rc);
/* get ost count when count is zero, get mdt count otherwise */
exp = count ? sbi->ll_md_exp : sbi->ll_dt_exp;
vallen = sizeof(count);
- rc = obd_get_info(exp, sizeof(KEY_TGT_COUNT), KEY_TGT_COUNT,
- &vallen, &count, NULL);
+ rc = obd_get_info(NULL, exp, sizeof(KEY_TGT_COUNT),
+ KEY_TGT_COUNT, &vallen, &count, NULL);
if (rc) {
CERROR("get target count failed: %d\n", rc);
RETURN(rc);
OBD_MD_FLMTIME | OBD_MD_FLCTIME);
obdo_set_parent_fid(oa, &ll_i2info(inode)->lli_fid);
memcpy(lsm2, lsm, lsm_size);
- rc = obd_create(exp, oa, &lsm2, &oti);
+ rc = obd_create(NULL, exp, oa, &lsm2, &oti);
OBD_FREE_LARGE(lsm2, lsm_size);
GOTO(out, rc);
memcpy(&fm_key.fiemap, fiemap, sizeof(*fiemap));
- rc = obd_get_info(exp, sizeof(fm_key), &fm_key, &vallen, fiemap, lsm);
+ rc = obd_get_info(NULL, exp, sizeof(fm_key), &fm_key, &vallen,
+ fiemap, lsm);
if (rc)
CERROR("obd_get_info failed: rc = %d\n", rc);
GOTO(out_md, err);
}
- err = obd_statfs(obd, osfs,
+ err = obd_statfs(NULL, sbi->ll_md_exp, osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), 0);
if (err)
GOTO(out_md_fid, err);
}
size = sizeof(*data);
- err = obd_get_info(sbi->ll_md_exp, sizeof(KEY_CONN_DATA),
+ err = obd_get_info(NULL, sbi->ll_md_exp, sizeof(KEY_CONN_DATA),
KEY_CONN_DATA, &size, data, NULL);
if (err) {
CERROR("Get connect data failed: %d \n", err);
#endif
checksum = sbi->ll_flags & LL_SBI_CHECKSUM;
- err = obd_set_info_async(sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
+ err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
KEY_CHECKSUM, sizeof(checksum), &checksum,
NULL);
cl_sb_init(sb);
*lmmsize = obd_size_diskmd(sbi->ll_dt_exp, NULL);
size = sizeof(int);
- rc = obd_get_info(sbi->ll_md_exp, sizeof(KEY_MAX_EASIZE),
+ rc = obd_get_info(NULL, sbi->ll_md_exp, sizeof(KEY_MAX_EASIZE),
KEY_MAX_EASIZE, &size, lmmsize, NULL);
if (rc)
CERROR("Get max mdsize error rc %d \n", rc);
int rc;
ENTRY;
- rc = obd_statfs(class_exp2obd(sbi->ll_md_exp), osfs, max_age, flags);
+ rc = obd_statfs(NULL, sbi->ll_md_exp, osfs, max_age, flags);
if (rc) {
CERROR("md_statfs fails: rc = %d\n", rc);
RETURN(rc);
if (sbi->ll_flags & LL_SBI_LAZYSTATFS)
flags |= OBD_STATFS_NODELAY;
- rc = obd_statfs_rqset(class_exp2obd(sbi->ll_dt_exp),
- &obd_osfs, max_age, flags);
+ rc = obd_statfs_rqset(sbi->ll_dt_exp, &obd_osfs, max_age, flags);
if (rc) {
CERROR("obd_statfs fails: rc = %d\n", rc);
RETURN(rc);
CDEBUG(D_SEC, "flush context for user %d\n", cfs_curproc_uid());
- obd_set_info_async(sbi->ll_md_exp,
+ obd_set_info_async(NULL, sbi->ll_md_exp,
sizeof(KEY_FLUSH_CTX), KEY_FLUSH_CTX,
0, NULL, NULL);
- obd_set_info_async(sbi->ll_dt_exp,
+ obd_set_info_async(NULL, sbi->ll_dt_exp,
sizeof(KEY_FLUSH_CTX), KEY_FLUSH_CTX,
0, NULL, NULL);
return 0;
if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) {
read_only = *flags & MS_RDONLY;
- err = obd_set_info_async(sbi->ll_md_exp,
+ err = obd_set_info_async(NULL, sbi->ll_md_exp,
sizeof(KEY_READ_ONLY),
KEY_READ_ONLY, sizeof(read_only),
&read_only, NULL);
else
sbi->ll_flags &= ~LL_SBI_CHECKSUM;
- rc = obd_set_info_async(sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
+ rc = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
KEY_CHECKSUM, sizeof(val), &val, NULL);
if (rc)
CWARN("Failed to set OSC checksum flags: %d\n", rc);
GOTO(out_free_memmd, rc);
}
- rc = obd_destroy(ll_i2dtexp(dir), oa, lsm, &oti, ll_i2mdexp(dir), oc);
+ rc = obd_destroy(NULL, ll_i2dtexp(dir), oa, lsm, &oti,
+ ll_i2mdexp(dir), oc);
capa_put(oc);
OBDO_FREE(oa);
if (rc)
if (tgts->ltd_exp == NULL)
continue;
- obd_set_info_async(tgts->ltd_exp, sizeof(KEY_INTERMDS),
+ obd_set_info_async(NULL, tgts->ltd_exp, sizeof(KEY_INTERMDS),
KEY_INTERMDS, 0, NULL, NULL);
}
}
(int) sizeof(struct obd_uuid))))
RETURN(-EFAULT);
- rc = obd_statfs(mdc_obd, &stat_buf,
+ rc = obd_statfs(NULL, lmv->tgts[index].ltd_exp, &stat_buf,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
0);
if (rc)
RETURN(rc);
}
-static int lmv_statfs(struct obd_device *obd, struct obd_statfs *osfs,
- __u64 max_age, __u32 flags)
+static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
+ struct obd_statfs *osfs, __u64 max_age, __u32 flags)
{
+ struct obd_device *obd = class_exp2obd(exp);
struct lmv_obd *lmv = &obd->u.lmv;
struct obd_statfs *temp;
int rc = 0;
if (lmv->tgts[i].ltd_exp == NULL)
continue;
- rc = obd_statfs(lmv->tgts[i].ltd_exp->exp_obd, temp,
+ rc = obd_statfs(env, lmv->tgts[i].ltd_exp, temp,
max_age, flags);
if (rc) {
CERROR("can't stat MDS #%d (%s), error %d\n", i,
RETURN(rc);
}
-static int lmv_get_info(struct obd_export *exp, __u32 keylen,
- void *key, __u32 *vallen, void *val,
+static int lmv_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 *obd;
continue;
}
- if (!obd_get_info(tgts->ltd_exp, keylen, key,
+ if (!obd_get_info(env, tgts->ltd_exp, keylen, key,
vallen, val, NULL))
RETURN(0);
}
* Forwarding this request to first MDS, it should know LOV
* desc.
*/
- rc = obd_get_info(lmv->tgts[0].ltd_exp, keylen, key,
+ rc = obd_get_info(env, lmv->tgts[0].ltd_exp, keylen, key,
vallen, val, NULL);
if (!rc && KEY_IS(KEY_CONN_DATA)) {
exp->exp_connect_flags =
RETURN(-EINVAL);
}
-int lmv_set_info_async(struct obd_export *exp, obd_count keylen,
- void *key, obd_count vallen, void *val,
- struct ptlrpc_request_set *set)
+int lmv_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 lmv_tgt_desc *tgt;
struct obd_device *obd;
if (!tgt->ltd_exp)
continue;
- err = obd_set_info_async(tgt->ltd_exp,
+ err = obd_set_info_async(env, tgt->ltd_exp,
keylen, key, vallen, val, set);
if (err && rc == 0)
rc = err;
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);
}
for (i = 0; i < lump->lmm_stripe_count; i++) {
__u32 len = sizeof(last_id);
oexp = lov->lov_tgts[lmm_objects[i].l_ost_idx]->ltd_exp;
- rc = obd_get_info(oexp, sizeof(KEY_LAST_ID), KEY_LAST_ID,
+ rc = obd_get_info(NULL, oexp, sizeof(KEY_LAST_ID), KEY_LAST_ID,
&len, &last_id, NULL);
if (rc)
RETURN(rc);
if (stripe >= lsm->lsm_stripe_count) {
req->rq_idx = ost_idx;
- rc = obd_create(lov->lov_tgts[ost_idx]->ltd_exp,
+ rc = obd_create(NULL, lov->lov_tgts[ost_idx]->ltd_exp,
req->rq_oi.oi_oa, &req->rq_oi.oi_md,
oti);
}
if (!set)
GOTO(out_failed, rc = -ENOMEM);
- rc = obd_statfs_async(obd, oinfo, max_age, set);
+ rc = obd_statfs_async(obd->obd_self_export, oinfo, max_age, set);
if (rc || cfs_list_empty(&set->set_requests)) {
if (rc)
CWARN("statfs failed with %d\n", rc);
continue;
sub_exp = lov->lov_tgts[req->rq_idx]->ltd_exp;
- err = obd_destroy(sub_exp, req->rq_oi.oi_oa, NULL, oti, NULL,
- NULL);
+ err = obd_destroy(NULL, sub_exp, req->rq_oi.oi_oa, NULL, oti,
+ NULL, NULL);
if (err)
CERROR("Failed to uncreate objid "LPX64" subobj "
LPX64" on OST idx %d: rc = %d\n",
RETURN(0);
}
-static int mdc_statfs(struct obd_device *obd, struct obd_statfs *osfs,
+static int mdc_statfs(const struct lu_env *env,
+ struct obd_export *exp, struct obd_statfs *osfs,
__u64 max_age, __u32 flags)
{
+ struct obd_device *obd = class_exp2obd(exp);
struct ptlrpc_request *req;
struct obd_statfs *msfs;
struct obd_import *imp = NULL;
/* Val is struct getinfo_fid2path result plus path */
vallen = sizeof(*gf) + gf->gf_pathlen;
- rc = obd_get_info(exp, keylen, key, &vallen, gf, NULL);
+ rc = obd_get_info(NULL, exp, keylen, key, &vallen, gf, NULL);
if (rc)
GOTO(out, rc);
struct ioc_changelog *icc = karg;
struct changelog_setinfo cs =
{.cs_recno = icc->icc_recno, .cs_id = icc->icc_id};
- rc = obd_set_info_async(exp, strlen(KEY_CHANGELOG_CLEAR),
+ rc = obd_set_info_async(NULL, exp, strlen(KEY_CHANGELOG_CLEAR),
KEY_CHANGELOG_CLEAR, sizeof(cs), &cs,
NULL);
GOTO(out, rc);
(int) sizeof(struct obd_uuid))))
GOTO(out, rc = -EFAULT);
- rc = mdc_statfs(obd, &stat_buf,
+ rc = mdc_statfs(NULL, obd->obd_self_export, &stat_buf,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
0);
if (rc != 0)
RETURN(rc);
}
-int mdc_set_info_async(struct obd_export *exp,
+int mdc_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)
RETURN(rc);
}
-int mdc_get_info(struct obd_export *exp, __u32 keylen, void *key,
- __u32 *vallen, void *val, struct lov_stripe_md *lsm)
+int mdc_get_info(const struct lu_env *env, struct obd_export *exp,
+ __u32 keylen, void *key, __u32 *vallen, void *val,
+ struct lov_stripe_md *lsm)
{
int rc = -EINVAL;
int rc;
ENTRY;
- rc = obd_set_info_async(lov_exp, sizeof(KEY_CAPA_KEY), KEY_CAPA_KEY,
- sizeof(info), &info, NULL);
+ rc = obd_set_info_async(env, lov_exp, sizeof(KEY_CAPA_KEY),
+ KEY_CAPA_KEY, sizeof(info), &info, NULL);
RETURN(rc);
}
}
OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_OPEN_WAIT_CREATE, 10);
- rc = obd_create(lov_exp, oa, &lsm, oti);
+ rc = obd_create(env, lov_exp, oa, &lsm, oti);
if (rc) {
if (rc > 0) {
CERROR("Create error for "DFID": %d\n",
CDEBUG(D_INFO, "destroying OSS object "LPU64":"LPU64"\n", oa->o_seq,
oa->o_id);
- rc = obd_destroy(lov_exp, oa, lsm, oti, NULL, NULL);
+ rc = obd_destroy(env, lov_exp, oa, lsm, oti, NULL, NULL);
obd_free_memmd(lov_exp, &lsm);
RETURN(rc);
}
if (obd->u.mds.mds_evict_ost_nids) {
- rc = obd_set_info_async(mds->mds_lov_exp,
+ rc = obd_set_info_async(NULL, mds->mds_lov_exp,
sizeof(KEY_EVICT_BY_NID),
KEY_EVICT_BY_NID, strlen(tmpbuf + 4) + 1,
tmpbuf + 4, set);
/* Creates an object with the same name as its fid. Because this is not at all
* performance sensitive, it is accomplished by creating a file, checking the
* fid, and renaming it. */
-int mds_obd_create(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti)
+int mds_obd_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti)
{
struct mds_obd *mds = &exp->exp_obd->u.mds;
struct inode *parent_inode = mds->mds_objects_dir->d_inode;
RETURN(rc);
}
-int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *ea, struct obd_trans_info *oti,
- struct obd_export *md_exp, void *capa)
+int mds_obd_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *ea,
+ struct obd_trans_info *oti, struct obd_export *md_exp,
+ void *capa)
{
struct mds_obd *mds = &exp->exp_obd->u.mds;
struct inode *parent_inode = mds->mds_objects_dir->d_inode;
__u64 connect_flags);
int mds_init_lov_desc(struct obd_device *obd, struct obd_export *osc_exp);
-int mds_obd_create(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti);
-int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *ea, struct obd_trans_info *oti,
+int mds_obd_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti);
+int mds_obd_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *ea,
+ struct obd_trans_info *oti,
struct obd_export *md_exp, void *capa);
/* mds/handler.c */
size = sizeof(lastid);
lastid.idx = idx;
lastid.data = &data[off];
- rc = obd_get_info(lov_exp, sizeof(KEY_LAST_ID), KEY_LAST_ID,
- &size, &lastid, NULL);
+ rc = obd_get_info(NULL, lov_exp, sizeof(KEY_LAST_ID),
+ KEY_LAST_ID, &size, &lastid, NULL);
if (rc)
GOTO(out, rc);
if (ost_uuid != NULL)
oti.oti_ost_uuid = ost_uuid;
- rc = obd_create(mds->mds_lov_exp, &oa, &empty_ea, &oti);
+ rc = obd_create(NULL, mds->mds_lov_exp, &oa, &empty_ea, &oti);
RETURN(rc);
}
info.idx = idx;
info.data = id;
- rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_NEXT_ID),
+ rc = obd_set_info_async(NULL, mds->mds_lov_exp, sizeof(KEY_NEXT_ID),
KEY_NEXT_ID, sizeof(info), &info, NULL);
if (rc)
CERROR ("%s: mds_lov_set_nextid failed (%d)\n",
if (!ld)
RETURN(-ENOMEM);
- rc = obd_get_info(mds->mds_lov_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
- &valsize, ld, NULL);
+ rc = obd_get_info(NULL, mds->mds_lov_exp, sizeof(KEY_LOVDESC),
+ KEY_LOVDESC, &valsize, ld, NULL);
if (rc)
GOTO(out, rc);
DEBUG_CAPA_KEY(D_SEC, key, "propagate");
info.capa = key;
- rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_CAPA_KEY),
- KEY_CAPA_KEY, sizeof(info), &info, NULL);
+ rc = obd_set_info_async(NULL, mds->mds_lov_exp,
+ sizeof(KEY_CAPA_KEY), KEY_CAPA_KEY,
+ sizeof(info), &info, NULL);
if (rc) {
DEBUG_CAPA_KEY(D_ERROR, key,
"propagate failed (rc = %d) for", rc);
mgi.group = mdt_to_obd_objseq(mds->mds_id);
mgi.uuid = uuid;
- rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_MDS_CONN),
+ rc = obd_set_info_async(NULL, mds->mds_lov_exp, sizeof(KEY_MDS_CONN),
KEY_MDS_CONN, sizeof(mgi), &mgi, NULL);
if (rc != 0)
GOTO(out, rc);
.loo_object_print = mdt_object_print
};
-static int mdt_obd_set_info_async(struct obd_export *exp,
+static int mdt_obd_set_info_async(const struct lu_env *env,
+ struct obd_export *exp,
__u32 keylen, void *key,
__u32 vallen, void *val,
struct ptlrpc_request_set *set)
RETURN(rc);
}
-int mgc_set_info_async(struct obd_export *exp, obd_count keylen,
- void *key, obd_count vallen, void *val,
- struct ptlrpc_request_set *set)
+int mgc_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)
{
int rc = -EINVAL;
ENTRY;
RETURN(rc);
}
-static int mgc_get_info(struct obd_export *exp, __u32 keylen, void *key,
- __u32 *vallen, void *val, struct lov_stripe_md *unused)
+static int mgc_get_info(const struct lu_env *env, struct obd_export *exp,
+ __u32 keylen, void *key, __u32 *vallen, void *val,
+ struct lov_stripe_md *unused)
{
int rc = -EINVAL;
class_incref(obd, __FUNCTION__, obd);
cfs_read_unlock(&obd_dev_lock);
- rc2 = obd_set_info_async(obd->obd_self_export,
+ rc2 = obd_set_info_async(NULL, obd->obd_self_export,
sizeof(KEY_SPTLRPC_CONF),
KEY_SPTLRPC_CONF, 0, NULL, NULL);
rc = rc ? rc : rc2;
class_incref(obd, __FUNCTION__, cfs_current());
cfs_read_unlock(&obd_dev_lock);
- if (obd_health_check(obd)) {
+ if (obd_health_check(NULL, obd)) {
rc += snprintf(page + rc, count - rc,
"device %s reported unhealthy\n",
obd->obd_name);
oa->o_seq = FID_SEQ_LLOG;
oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLGROUP;
- rc = obd_create(ctxt->loc_exp, oa, NULL, NULL);
+ rc = obd_create(NULL, ctxt->loc_exp, oa, NULL, NULL);
if (rc)
GOTO(out, rc);
GOTO(out, rc = PTR_ERR(th));
}
- rc = obd_destroy(handle->lgh_ctxt->loc_exp, oa, NULL, NULL, NULL, NULL);
+ rc = obd_destroy(NULL, handle->lgh_ctxt->loc_exp, oa,
+ NULL, NULL, NULL, NULL);
rc1 = fsfilt_commit(obd, inode, th, 0);
if (rc == 0 && rc1 != 0)
int lprocfs_rd_blksize(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
- struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs,
+ struct obd_device *obd = data;
+ struct obd_statfs osfs;
+ int rc = obd_statfs(NULL, obd->obd_self_export, &osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
int lprocfs_rd_kbytestotal(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
- struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs,
+ struct obd_device *obd = data;
+ struct obd_statfs osfs;
+ int rc = obd_statfs(NULL, obd->obd_self_export, &osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
int lprocfs_rd_kbytesfree(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
- struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs,
+ struct obd_device *obd = data;
+ struct obd_statfs osfs;
+ int rc = obd_statfs(NULL, obd->obd_self_export, &osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
int lprocfs_rd_kbytesavail(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
- struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs,
+ struct obd_device *obd = data;
+ struct obd_statfs osfs;
+ int rc = obd_statfs(NULL, obd->obd_self_export, &osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
int lprocfs_rd_filestotal(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
- struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs,
+ struct obd_device *obd = data;
+ struct obd_statfs osfs;
+ int rc = obd_statfs(NULL, obd->obd_self_export, &osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
int lprocfs_rd_filesfree(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
- struct obd_statfs osfs;
- int rc = obd_statfs(data, &osfs,
+ struct obd_device *obd = data;
+ struct obd_statfs osfs;
+ int rc = obd_statfs(NULL, obd->obd_self_export, &osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
OBD_STATFS_NODELAY);
if (!rc) {
obd = class_name2obd(mgcname);
if (obd && !obd->obd_stopping) {
- rc = obd_set_info_async(obd->obd_self_export,
+ rc = obd_set_info_async(NULL, obd->obd_self_export,
strlen(KEY_MGSSEC), KEY_MGSSEC,
strlen(mgssec), mgssec, NULL);
if (rc)
int vallen = sizeof(*data);
__u32 *flags = &lsi->lsi_lmd->lmd_flags;
- rc = obd_get_info(obd->obd_self_export,
+ rc = obd_get_info(NULL, obd->obd_self_export,
strlen(KEY_CONN_DATA), KEY_CONN_DATA,
&vallen, data, NULL);
LASSERT(rc == 0);
if at all possible. */
recov_bk++;
CDEBUG(D_MOUNT, "%s: Set MGC reconnect %d\n", mgcname,recov_bk);
- rc = obd_set_info_async(obd->obd_self_export,
+ rc = obd_set_info_async(NULL, obd->obd_self_export,
sizeof(KEY_INIT_RECOV_BACKUP),
KEY_INIT_RECOV_BACKUP,
sizeof(recov_bk), &recov_bk, NULL);
GOTO(out_free, rc = -ENOTCONN);
}
- rc = obd_set_info_async(obd->obd_self_export,
+ rc = obd_set_info_async(NULL, obd->obd_self_export,
strlen(KEY_MGSSEC), KEY_MGSSEC,
strlen(mgssec), mgssec, NULL);
if (rc)
/* Try all connections, but only once. */
recov_bk = 1;
- rc = obd_set_info_async(obd->obd_self_export,
+ rc = obd_set_info_async(NULL, obd->obd_self_export,
sizeof(KEY_INIT_RECOV_BACKUP),
KEY_INIT_RECOV_BACKUP,
sizeof(recov_bk), &recov_bk, NULL);
CDEBUG(D_MOUNT, "Set mgc disk for %s\n", lsi->lsi_lmd->lmd_dev);
/* cl_mgc_sem in mgc insures we sleep if the mgc_fs is busy */
- rc = obd_set_info_async(mgc->obd_self_export,
+ rc = obd_set_info_async(NULL, mgc->obd_self_export,
sizeof(KEY_SET_FS), KEY_SET_FS,
sizeof(*sb), sb, NULL);
if (rc) {
CDEBUG(D_MOUNT, "Unassign mgc disk\n");
- rc = obd_set_info_async(mgc->obd_self_export,
+ rc = obd_set_info_async(NULL, mgc->obd_self_export,
sizeof(KEY_CLEAR_FS), KEY_CLEAR_FS,
0, NULL, NULL);
RETURN(rc);
/* Register the target */
/* FIXME use mgc_process_config instead */
- rc = obd_set_info_async(mgc->u.cli.cl_mgc_mgsexp,
+ rc = obd_set_info_async(NULL, mgc->u.cli.cl_mgc_mgsexp,
sizeof(KEY_REGISTER_TARGET), KEY_REGISTER_TARGET,
sizeof(*mti), mti, NULL);
if (rc) {
mti->mti_flags |= LDD_F_OPC_READY;
/* FIXME use mgc_process_config instead */
- rc = obd_set_info_async(mgc->u.cli.cl_mgc_mgsexp,
+ rc = obd_set_info_async(NULL, mgc->u.cli.cl_mgc_mgsexp,
sizeof(KEY_REGISTER_TARGET),
KEY_REGISTER_TARGET,
sizeof(*mti), mti, NULL);
return id;
}
-static int echo_create(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti)
+static int echo_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti)
{
struct obd_device *obd = class_exp2obd(exp);
return 0;
}
-static int echo_destroy(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *ea, struct obd_trans_info *oti,
- struct obd_export *md_exp, void *capa)
+static int echo_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *ea,
+ struct obd_trans_info *oti, struct obd_export *md_exp,
+ void *capa)
{
struct obd_device *obd = class_exp2obd(exp);
RETURN(0);
}
-static int echo_getattr(struct obd_export *exp, struct obd_info *oinfo)
+static int echo_getattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo)
{
struct obd_device *obd = class_exp2obd(exp);
obd_id id = oinfo->oi_oa->o_id;
RETURN(0);
}
-static int echo_setattr(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti)
+static int echo_setattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti)
{
struct obd_device *obd = class_exp2obd(exp);
return rc;
}
-static int echo_preprw(int cmd, struct obd_export *export, struct obdo *oa,
- int objcount, struct obd_ioobj *obj,
- struct niobuf_remote *nb, int *pages,
- struct niobuf_local *res, struct obd_trans_info *oti,
- struct lustre_capa *unused)
+static int echo_preprw(const struct lu_env *env, int cmd,
+ struct obd_export *export, struct obdo *oa,
+ int objcount, struct obd_ioobj *obj,
+ struct niobuf_remote *nb, int *pages,
+ struct niobuf_local *res, struct obd_trans_info *oti,
+ struct lustre_capa *unused)
{
struct obd_device *obd;
int tot_bytes = 0;
return rc;
}
-static int echo_commitrw(int cmd, struct obd_export *export, struct obdo *oa,
- int objcount, struct obd_ioobj *obj,
- struct niobuf_remote *rb, int niocount,
- struct niobuf_local *res, struct obd_trans_info *oti,
- int rc)
+static int echo_commitrw(const struct lu_env *env, int cmd,
+ struct obd_export *export, struct obdo *oa,
+ int objcount, struct obd_ioobj *obj,
+ struct niobuf_remote *rb, int niocount,
+ struct niobuf_local *res, struct obd_trans_info *oti,
+ int rc)
{
struct obd_device *obd;
int pgs = 0;
return rc;
}
-static int echo_create_object(struct echo_device *ed, int on_target,
- struct obdo *oa, void *ulsm, int ulsm_nob,
- struct obd_trans_info *oti)
+static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
+ int on_target, struct obdo *oa, void *ulsm,
+ int ulsm_nob, struct obd_trans_info *oti)
{
struct echo_object *eco;
struct echo_client_obd *ec = ed->ed_ec;
/* Only echo objects are allowed to be created */
LASSERT((oa->o_valid & OBD_MD_FLGROUP) &&
(oa->o_seq == FID_SEQ_ECHO));
- rc = obd_create(ec->ec_exp, oa, &lsm, oti);
+ rc = obd_create(env, ec->ec_exp, oa, &lsm, oti);
if (rc != 0) {
CERROR("Cannot create objects: rc = %d\n", rc);
GOTO(failed, rc);
failed:
if (created && rc)
- obd_destroy(ec->ec_exp, oa, lsm, oti, NULL, NULL);
+ obd_destroy(env, ec->ec_exp, oa, lsm, oti, NULL, NULL);
if (lsm)
obd_free_memmd(ec->ec_exp, &lsm);
if (rc)
oti->oti_transno = 0;
lpages = npages;
- ret = obd_preprw(rw, exp, oa, 1, &ioo, rnb, &lpages, lnb, oti,
- NULL);
+ ret = obd_preprw(NULL, rw, exp, oa, 1, &ioo, rnb, &lpages,
+ lnb, oti, NULL);
if (ret != 0)
GOTO(out, ret);
LASSERT(lpages == npages);
rnb[i].len);
}
- ret = obd_commitrw(rw, exp, oa, 1,&ioo,rnb,npages,lnb,oti,ret);
+ ret = obd_commitrw(NULL, rw, exp, oa, 1, &ioo,
+ rnb, npages, lnb, oti, ret);
if (ret != 0)
GOTO(out, ret);
}
static int
-echo_client_iocontrol(unsigned int cmd, struct obd_export *exp,
- int len, void *karg, void *uarg)
+echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
+ void *karg, void *uarg)
{
struct obd_device *obd = exp->exp_obd;
struct echo_device *ed = obd2echo_dev(obd);
struct echo_object *eco;
struct obd_ioctl_data *data = karg;
struct obd_trans_info dummy_oti;
+ struct lu_env *env;
struct oti_req_ack_lock *ack_lock;
struct obdo *oa;
struct lu_fid fid;
if (rc < 0)
RETURN(rc);
+ OBD_ALLOC_PTR(env);
+ if (env == NULL)
+ RETURN(-ENOMEM);
+
+ rc = lu_env_init(env, LCT_DT_THREAD);
+ if (rc)
+ GOTO(out, rc = -ENOMEM);
+
switch (cmd) {
case OBD_IOC_CREATE: /* may create echo object */
if (!cfs_capable(CFS_CAP_SYS_ADMIN))
GOTO (out, rc = -EPERM);
- rc = echo_create_object (ed, 1, oa,
- data->ioc_pbuf1, data->ioc_plen1,
- &dummy_oti);
+ rc = echo_create_object(env, ed, 1, oa, data->ioc_pbuf1,
+ data->ioc_plen1, &dummy_oti);
GOTO(out, rc);
case OBD_IOC_ECHO_MD: {
GOTO(out, rc);
}
case OBD_IOC_ECHO_ALLOC_SEQ: {
- struct lu_env *env;
+ struct lu_env *cl_env;
int refcheck;
__u64 seq;
int max_count;
if (!cfs_capable(CFS_CAP_SYS_ADMIN))
GOTO(out, rc = -EPERM);
- env = cl_env_get(&refcheck);
- if (IS_ERR(env))
- GOTO(out, rc = PTR_ERR(env));
+ cl_env = cl_env_get(&refcheck);
+ if (IS_ERR(cl_env))
+ GOTO(out, rc = PTR_ERR(cl_env));
- rc = lu_env_refill_by_tags(env, ECHO_MD_CTX_TAG,
+ rc = lu_env_refill_by_tags(cl_env, ECHO_MD_CTX_TAG,
ECHO_MD_SES_TAG);
if (rc != 0) {
- cl_env_put(env, &refcheck);
+ cl_env_put(cl_env, &refcheck);
GOTO(out, rc);
}
- rc = seq_client_get_seq(env, ed->ed_cl_seq, &seq);
- cl_env_put(env, &refcheck);
+ rc = seq_client_get_seq(cl_env, ed->ed_cl_seq, &seq);
+ cl_env_put(cl_env, &refcheck);
if (rc < 0) {
CERROR("%s: Can not alloc seq: rc = %d\n",
obd->obd_name, rc);
if (!cfs_capable(CFS_CAP_SYS_ADMIN))
GOTO (out, rc = -EPERM);
- rc = echo_get_object (&eco, ed, oa);
+ rc = echo_get_object(&eco, ed, oa);
if (rc == 0) {
- rc = obd_destroy(ec->ec_exp, oa, eco->eo_lsm,
+ rc = obd_destroy(env, ec->ec_exp, oa, eco->eo_lsm,
&dummy_oti, NULL, NULL);
if (rc == 0)
eco->eo_deleted = 1;
GOTO(out, rc);
case OBD_IOC_GETATTR:
- rc = echo_get_object (&eco, ed, oa);
+ rc = echo_get_object(&eco, ed, oa);
if (rc == 0) {
struct obd_info oinfo = { { { 0 } } };
oinfo.oi_md = eco->eo_lsm;
oinfo.oi_oa = oa;
- rc = obd_getattr(ec->ec_exp, &oinfo);
+ rc = obd_getattr(env, ec->ec_exp, &oinfo);
echo_put_object(eco);
}
GOTO(out, rc);
if (!cfs_capable(CFS_CAP_SYS_ADMIN))
GOTO (out, rc = -EPERM);
- rc = echo_get_object (&eco, ed, oa);
+ rc = echo_get_object(&eco, ed, oa);
if (rc == 0) {
struct obd_info oinfo = { { { 0 } } };
oinfo.oi_oa = oa;
oinfo.oi_md = eco->eo_lsm;
- rc = obd_setattr(ec->ec_exp, &oinfo, NULL);
+ rc = obd_setattr(env, ec->ec_exp, &oinfo, NULL);
echo_put_object(eco);
}
GOTO(out, rc);
echo_put_object(eco);
}
} else {
- rc = echo_create_object(ed, 0, oa,
+ rc = echo_create_object(env, ed, 0, oa,
data->ioc_pbuf1,
data->ioc_plen1, &dummy_oti);
}
}
EXIT;
- out:
+out:
+ lu_env_fini(env);
+ OBD_FREE_PTR(env);
/* XXX this should be in a helper also called by target_send_reply */
for (ack_lock = dummy_oti.oti_ack_locks, i = 0; i < 4;
EXIT;
}
-static int filter_ping(struct obd_export *exp)
+static int filter_ping(const struct lu_env *env, struct obd_export *exp)
{
filter_fmd_expire(exp);
return 0;
return dchild;
}
-static int filter_getattr(struct obd_export *exp, struct obd_info *oinfo)
+static int filter_getattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo)
{
struct dentry *dentry = NULL;
struct obd_device *obd;
}
/* this is called from filter_truncate() until we have filter_punch() */
-int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti)
+int filter_setattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti)
{
struct obdo *oa = oinfo->oi_oa;
struct lustre_capa *capa = oinfo_capa(oinfo);
for (id = last; id > oa->o_id; id--) {
doa.o_id = id;
- rc = filter_destroy(exp, &doa, NULL, NULL, NULL, NULL);
+ rc = filter_destroy(NULL, exp, &doa, NULL, NULL, NULL, NULL);
if (rc && rc != -ENOENT) /* this is pretty fatal... */
CEMERG("error destroying precreate objid "LPU64": %d\n",
id, rc);
return rc;
}
-static int filter_statfs(struct obd_device *obd, struct obd_statfs *osfs,
- __u64 max_age, __u32 flags)
+static int filter_statfs(const struct lu_env *env, struct obd_export *exp,
+ struct obd_statfs *osfs, __u64 max_age, __u32 flags)
{
+ struct obd_device *obd = class_exp2obd(exp);
struct filter_obd *filter = &obd->u.filter;
int blockbits = obd->u.obt.obt_sb->s_blocksize_bits;
struct lr_server_data *lsd = class_server_data(obd);
OBD_ALLOC(osfs, sizeof(*osfs));
if (osfs == NULL)
RETURN(-ENOMEM);
- rc = filter_statfs(obd, osfs,
+ rc = filter_statfs(NULL, obd->obd_self_export, osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
0);
if (rc == 0 && osfs->os_bavail < (osfs->os_blocks >> 10)) {
RETURN(rc);
}
-int filter_create(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti)
+int filter_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti)
{
struct obd_device *obd = exp->exp_obd;
struct filter_export_data *fed;
RETURN(rc);
}
-int filter_destroy(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *md, struct obd_trans_info *oti,
- struct obd_export *md_exp, void *capa)
+int filter_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *md,
+ struct obd_trans_info *oti, struct obd_export *md_exp,
+ void *capa)
{
unsigned int qcids[MAXQUOTAS] = {0, 0};
struct obd_device *obd;
}
/* NB start and end are used for punch, but not truncate */
-static int filter_truncate(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti,
+static int filter_truncate(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti,
struct ptlrpc_request_set *rqset)
{
int rc;
oinfo->oi_policy.l_extent.start);
oinfo->oi_oa->o_size = oinfo->oi_policy.l_extent.start;
- rc = filter_setattr(exp, oinfo, oti);
+ rc = filter_setattr(env, exp, oinfo, oti);
RETURN(rc);
}
-static int filter_sync(struct obd_export *exp, struct obd_info *oinfo,
- obd_off start, obd_off end,
+static int filter_sync(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, obd_off start, obd_off end,
struct ptlrpc_request_set *set)
{
struct lvfs_run_ctxt saved;
RETURN(rc);
}
-static int filter_get_info(struct obd_export *exp, __u32 keylen,
- void *key, __u32 *vallen, void *val,
+static int filter_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 *obd;
RETURN(rc);
}
-static int filter_set_info_async(struct obd_export *exp, __u32 keylen,
+static int filter_set_info_async(const struct lu_env *env,
+ struct obd_export *exp, __u32 keylen,
void *key, __u32 vallen, void *val,
struct ptlrpc_request_set *set)
{
RETURN(0);
}
-static int filter_health_check(struct obd_device *obd)
+static int filter_health_check(const struct lu_env *env, struct obd_device *obd)
{
#ifdef USE_HEALTH_CHECK_WRITE
struct filter_obd *filter = &obd->u.filter;
int filter_update_last_objid(struct obd_device *, obd_seq, int force_sync);
int filter_common_setup(struct obd_device *, struct lustre_cfg *lcfg,
void *option);
-int filter_destroy(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *md, struct obd_trans_info *,
- struct obd_export *, void *);
+int filter_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *md,
+ struct obd_trans_info *, struct obd_export *, void *);
int filter_setattr_internal(struct obd_export *exp, struct dentry *dentry,
struct obdo *oa, struct obd_trans_info *oti);
-int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti);
+int filter_setattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti);
-int filter_create(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti);
+int filter_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti);
struct obd_llog_group *filter_find_olg(struct obd_device *obd, int seq);
/* filter_io.c */
-int filter_preprw(int cmd, struct obd_export *, struct obdo *, int objcount,
+int filter_preprw(const struct lu_env *env, int cmd, struct obd_export *,
+ struct obdo *, int objcount,
struct obd_ioobj *, struct niobuf_remote *,
int *, struct niobuf_local *, struct obd_trans_info *,
struct lustre_capa *);
-int filter_commitrw(int cmd, struct obd_export *, struct obdo *, int objcount,
+int filter_commitrw(const struct lu_env *, int cmd, struct obd_export *,
+ struct obdo *, int objcount,
struct obd_ioobj *, struct niobuf_remote *, int,
struct niobuf_local *, struct obd_trans_info *, int rc);
void filter_release_cache(struct obd_device *, struct obd_ioobj *,
noa->o_valid = OBD_MD_FLID;
}
- if (filter_create(exp, noa, NULL, oti) == 0) {
+ if (filter_create(NULL, exp, noa, NULL, oti) == 0) {
f_dput(dentry);
dentry = filter_fid2dentry(exp->exp_obd, NULL,
obj->ioo_seq,
return rc;
}
-int filter_preprw(int cmd, struct obd_export *exp, struct obdo *oa,
- int objcount, struct obd_ioobj *obj,
+int filter_preprw(const struct lu_env *env, int cmd, struct obd_export *exp,
+ struct obdo *oa, int objcount, struct obd_ioobj *obj,
struct niobuf_remote *nb, int *npages,
struct niobuf_local *res, struct obd_trans_info *oti,
struct lustre_capa *capa)
cfs_spin_unlock(&exp->exp_obd->obd_osfs_lock);
}
-int filter_commitrw(int cmd, struct obd_export *exp, struct obdo *oa,
- int objcount, struct obd_ioobj *obj,
+int filter_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
+ struct obdo *oa, int objcount, struct obd_ioobj *obj,
struct niobuf_remote *nb, int npages,
struct niobuf_local *res, struct obd_trans_info *oti,
int rc)
LBUG();
return -EPROTO;
}
-
}
while (count > 0) {
- rc = filter_destroy(exp, oa, NULL, NULL, NULL, NULL);
+ rc = filter_destroy(NULL, exp, oa, NULL, NULL, NULL, NULL);
if (rc == 0)
CDEBUG(D_RPCTRACE, "object "LPU64" is destroyed\n",
oid);
oinfo.oi_oa->o_lcookie = *cookie;
oid = oinfo.oi_oa->o_id;
- rc = filter_setattr(exp, &oinfo, NULL);
+ rc = filter_setattr(NULL, exp, &oinfo, NULL);
OBDO_FREE(oinfo.oi_oa);
if (rc == -ENOENT) {
RETURN(rc);
}
-int osc_create(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti)
+int osc_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti)
{
struct osc_creator *oscc = &exp->exp_obd->u.cli.cl_oscc;
struct obd_import *imp = exp->exp_obd->u.cli.cl_import;
#define OSCC_FLAG_NOSPC_BLK 0x100 /* no more block space on OST */
int osc_precreate(struct obd_export *exp);
-int osc_create(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md **ea, struct obd_trans_info *oti);
+int osc_create(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md **ea,
+ struct obd_trans_info *oti);
int osc_create_async(struct obd_export *exp, struct obd_info *oinfo,
struct lov_stripe_md **ea, struct obd_trans_info *oti);
int osc_real_create(struct obd_export *exp, struct obdo *oa,
RETURN(0);
}
-static int osc_getattr(struct obd_export *exp, struct obd_info *oinfo)
+static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo)
{
struct ptlrpc_request *req;
struct ost_body *body;
return rc;
}
-static int osc_setattr(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti)
+static int osc_setattr(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti)
{
struct ptlrpc_request *req;
struct ost_body *body;
RETURN(0);
}
-static int osc_punch(struct obd_export *exp, struct obd_info *oinfo,
- struct obd_trans_info *oti,
+static int osc_punch(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, struct obd_trans_info *oti,
struct ptlrpc_request_set *rqset)
{
oinfo->oi_oa->o_size = oinfo->oi_policy.l_extent.start;
RETURN(rc);
}
-static int osc_sync(struct obd_export *exp, struct obd_info *oinfo,
- obd_size start, obd_size end,
+static int osc_sync(const struct lu_env *env, struct obd_export *exp,
+ struct obd_info *oinfo, obd_size start, obd_size end,
struct ptlrpc_request_set *set)
{
struct ptlrpc_request *req;
* the records are not cancelled, and when the OST reconnects to the MDS next,
* it will retrieve the llog unlink logs and then sends the log cancellation
* cookies to the MDS after committing destroy transactions. */
-static int osc_destroy(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *ea, struct obd_trans_info *oti,
- struct obd_export *md_export, void *capa)
+static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct lov_stripe_md *ea,
+ struct obd_trans_info *oti, struct obd_export *md_export,
+ void *capa)
{
struct client_obd *cli = &exp->exp_obd->u.cli;
struct ptlrpc_request *req;
}
}
-static int osc_set_info_async(struct obd_export *exp, obd_count keylen,
- void *key, obd_count vallen, void *val,
- struct ptlrpc_request_set *set);
+static int osc_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);
static int osc_shrink_grant_interpret(const struct lu_env *env,
struct ptlrpc_request *req,
body->oa.o_flags |= OBD_FL_SHRINK_GRANT;
osc_update_next_shrink(cli);
- rc = osc_set_info_async(cli->cl_import->imp_obd->obd_self_export,
+ rc = osc_set_info_async(NULL, cli->cl_import->imp_obd->obd_self_export,
sizeof(KEY_GRANT_SHRINK), KEY_GRANT_SHRINK,
sizeof(*body), body, NULL);
if (rc != 0)
RETURN(rc);
}
-static int osc_statfs_async(struct obd_device *obd, struct obd_info *oinfo,
- __u64 max_age, struct ptlrpc_request_set *rqset)
+static int osc_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 ptlrpc_request *req;
struct osc_async_args *aa;
int rc;
RETURN(0);
}
-static int osc_statfs(struct obd_device *obd, struct obd_statfs *osfs,
- __u64 max_age, __u32 flags)
+static int osc_statfs(const struct lu_env *env, struct obd_export *exp,
+ struct obd_statfs *osfs, __u64 max_age, __u32 flags)
{
+ struct obd_device *obd = class_exp2obd(exp);
struct obd_statfs *msfs;
struct ptlrpc_request *req;
struct obd_import *imp = NULL;
return err;
}
-static int osc_get_info(struct obd_export *exp, obd_count keylen,
- void *key, __u32 *vallen, void *val,
+static int osc_get_info(const struct lu_env *env, struct obd_export *exp,
+ obd_count keylen, void *key, __u32 *vallen, void *val,
struct lov_stripe_md *lsm)
{
ENTRY;
RETURN(osc_setinfo_mds_connect_import(req->rq_import));
}
-static int osc_set_info_async(struct obd_export *exp, obd_count keylen,
- void *key, obd_count vallen, void *val,
- struct ptlrpc_request_set *set)
+static int osc_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 ptlrpc_request *req;
struct obd_device *obd = exp->exp_obd;
memcpy(&repbody->oa, &body->oa, sizeof(body->oa));
/* Do the destroy and set the reply status accordingly */
- req->rq_status = obd_destroy(exp, &repbody->oa, NULL, oti, NULL, capa);
+ req->rq_status = obd_destroy(req->rq_svc_thread->t_env, exp,
+ &repbody->oa, NULL, oti, NULL, capa);
RETURN(0);
}
oinfo->oi_oa = &repbody->oa;
oinfo->oi_capa = capa;
- req->rq_status = obd_getattr(exp, oinfo);
+ req->rq_status = obd_getattr(req->rq_svc_thread->t_env, exp, oinfo);
OBD_FREE_PTR(oinfo);
osfs = req_capsule_server_get(&req->rq_pill, &RMF_OBD_STATFS);
- req->rq_status = obd_statfs(req->rq_export->exp_obd, osfs,
+ req->rq_status = obd_statfs(req->rq_svc_thread->t_env, req->rq_export,
+ osfs,
cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
0);
if (req->rq_status != 0)
repbody->oa = body->oa;
oti->oti_logcookies = &body->oa.o_lcookie;
- req->rq_status = obd_create(exp, &repbody->oa, NULL, oti);
+ req->rq_status = obd_create(req->rq_svc_thread->t_env, exp,
+ &repbody->oa, NULL, oti);
//obd_log_cancel(conn, NULL, 1, oti->oti_logcookies, 0);
RETURN(0);
}
oinfo->oi_capa = capa;
oinfo->oi_flags = OBD_FL_PUNCH;
- req->rq_status = obd_punch(exp, oinfo, oti, NULL);
+ req->rq_status = obd_punch(req->rq_svc_thread->t_env, exp,
+ oinfo, oti, NULL);
OBD_FREE_PTR(oinfo);
unlock:
ost_lock_put(exp, &lh, LCK_PW);
oinfo->oi_oa = &repbody->oa;
oinfo->oi_capa = capa;
- req->rq_status = obd_sync(exp, oinfo, repbody->oa.o_size,
- repbody->oa.o_blocks, NULL);
+ req->rq_status = obd_sync(req->rq_svc_thread->t_env, exp, oinfo,
+ repbody->oa.o_size, repbody->oa.o_blocks,
+ NULL);
OBD_FREE_PTR(oinfo);
ost_drop_id(exp, &repbody->oa);
oinfo->oi_oa = &repbody->oa;
oinfo->oi_capa = capa;
- req->rq_status = obd_setattr(exp, oinfo, oti);
+ req->rq_status = obd_setattr(req->rq_svc_thread->t_env, exp, oinfo,
+ oti);
OBD_FREE_PTR(oinfo);
memcpy(&repbody->oa, &body->oa, sizeof(repbody->oa));
npages = OST_THREAD_POOL_SIZE;
- rc = obd_preprw(OBD_BRW_READ, exp, &repbody->oa, 1, ioo,
- remote_nb, &npages, local_nb, oti, capa);
+ rc = obd_preprw(req->rq_svc_thread->t_env, OBD_BRW_READ, exp,
+ &repbody->oa, 1, ioo, remote_nb, &npages, local_nb,
+ oti, capa);
if (rc != 0)
GOTO(out_lock, rc);
out_commitrw:
/* Must commit after prep above in all cases */
- rc = obd_commitrw(OBD_BRW_READ, exp, &repbody->oa, 1, ioo,
- remote_nb, npages, local_nb, oti, rc);
+ rc = obd_commitrw(req->rq_svc_thread->t_env, OBD_BRW_READ, exp,
+ &repbody->oa, 1, ioo, remote_nb, npages, local_nb,
+ oti, rc);
if (rc == 0)
ost_drop_id(exp, &repbody->oa);
memcpy(&repbody->oa, &body->oa, sizeof(repbody->oa));
npages = OST_THREAD_POOL_SIZE;
- rc = obd_preprw(OBD_BRW_WRITE, exp, &repbody->oa, objcount,
- ioo, remote_nb, &npages, local_nb, oti, capa);
+ rc = obd_preprw(req->rq_svc_thread->t_env, OBD_BRW_WRITE, exp,
+ &repbody->oa, objcount, ioo, remote_nb, &npages,
+ local_nb, oti, capa);
if (rc != 0)
GOTO(out_lock, rc);
}
/* Must commit after prep above in all cases */
- rc = obd_commitrw(OBD_BRW_WRITE, exp, &repbody->oa, objcount, ioo,
- remote_nb, npages, local_nb, oti, rc);
+ rc = obd_commitrw(req->rq_svc_thread->t_env, OBD_BRW_WRITE, exp,
+ &repbody->oa, objcount, ioo, remote_nb, npages,
+ local_nb, oti, rc);
if (rc == -ENOTCONN)
/* quota acquire process has been given up because
* either the client has been evicted or the client
/* OBD will also check if KEY_IS(KEY_GRANT_SHRINK), and will cast val to
* a struct ost_body * value */
- rc = obd_set_info_async(exp, keylen, key, vallen, val, NULL);
+ rc = obd_set_info_async(req->rq_svc_thread->t_env, exp, keylen,
+ key, vallen, val, NULL);
out:
lustre_msg_set_status(req->rq_repmsg, 0);
RETURN(rc);
RETURN(rc);
}
- rc = obd_get_info(exp, keylen, key, &replylen, NULL, NULL);
+ rc = obd_get_info(req->rq_svc_thread->t_env, exp, keylen, key,
+ &replylen, NULL, NULL);
if (rc)
RETURN(rc);
RETURN(-ENOMEM);
/* call again to fill in the reply buffer */
- rc = obd_get_info(exp, keylen, key, &replylen, reply, NULL);
+ rc = obd_get_info(req->rq_svc_thread->t_env, exp, keylen, key,
+ &replylen, reply, NULL);
lustre_msg_set_status(req->rq_repmsg, 0);
RETURN(rc);
int rc = 0;
ENTRY;
- rc = obd_get_info(lock->l_export, sizeof(KEY_SYNC_LOCK_CANCEL),
+ rc = obd_get_info(NULL, lock->l_export, sizeof(KEY_SYNC_LOCK_CANCEL),
KEY_SYNC_LOCK_CANCEL, &len, &sync_lock_cancel, NULL);
if (!rc && flag == LDLM_CB_CANCELING &&
oa->o_valid = OBD_MD_FLID|OBD_MD_FLGROUP;
oinfo->oi_oa = oa;
- rc = obd_sync(lock->l_export, oinfo,
+ rc = obd_sync(NULL, lock->l_export, oinfo,
lock->l_policy_data.l_extent.start,
lock->l_policy_data.l_extent.end, NULL);
if (rc)
RETURN(err);
}
-static int ost_health_check(struct obd_device *obd)
+static int ost_health_check(const struct lu_env *env, struct obd_device *obd)
{
struct ost_obd *ost = &obd->u.ost;
int rc = 0;