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);
}