struct obd_device * class_find_client_obd(struct obd_uuid *tgt_uuid,
const char * typ_name,
struct obd_uuid *grp_uuid);
-struct obd_device * class_find_client_notype(struct obd_uuid *tgt_uuid,
- struct obd_uuid *grp_uuid);
struct obd_device * class_devices_in_group(struct obd_uuid *grp_uuid,
int *next);
struct obd_device * class_num2obd(int num);
+int class_notify_sptlrpc_conf(const char *fsname, int namelen);
+
char *obd_export_nid2str(struct obd_export *exp);
int obd_export_evict_by_nid(struct obd_device *obd, const char *nid);
void obd_zombie_impexp_stop(void);
void obd_zombie_impexp_cull(void);
void obd_zombie_barrier(void);
+void obd_exports_barrier(struct obd_device *obd);
/* obd_config.c */
int class_process_config(struct lustre_cfg *lcfg);
const char *scope, const void *source);
void class_decref(struct obd_device *obd,
const char *scope, const void *source);
+void dump_exports(struct obd_device *obd);
/*obdecho*/
#ifdef LPROCFS
/* Passed as data param to class_config_parse_llog */
struct config_llog_instance {
char * cfg_instance;
+ char * cfg_obdname;
struct super_block *cfg_sb;
struct obd_uuid cfg_uuid;
int cfg_last_idx; /* for partial llog processing */
struct config_llog_instance cld_cfg;
struct list_head cld_list_chain;
atomic_t cld_refcount;
+ struct config_llog_data *cld_sptlrpc;/* depended sptlrpc log */
struct obd_export *cld_mgcexp;
unsigned int cld_stopping:1, /* we were told to stop watching */
- cld_lostlock:1; /* lock not requeued */
+ cld_lostlock:1, /* lock not requeued */
+ cld_is_sptlrpc:1;
};
struct lustre_profile {
int class_disconnect(struct obd_export *exp);
void class_fail_export(struct obd_export *exp);
void class_disconnect_exports(struct obd_device *obddev);
-int class_disconnect_stale_exports(struct obd_device *,
- int (*test_export)(struct obd_export *));
int class_manual_cleanup(struct obd_device *obd);
+void class_disconnect_stale_exports(struct obd_device *,
+ int (*test_export)(struct obd_export *),
+ enum obd_option flags);
+
+static inline enum obd_option exp_flags_from_obd(struct obd_device *obd)
+{
+ return ((obd->obd_fail ? OBD_OPT_FAILOVER : 0) |
+ (obd->obd_force ? OBD_OPT_FORCE : 0) |
+ (obd->obd_abort_recovery ? OBD_OPT_ABORT_RECOV : 0) |
+ 0);
+}
void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid);
void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj);
ldt = obd->obd_type->typ_lu;
if (ldt != NULL) {
+ struct lu_context session_ctx;
struct lu_env env;
+ lu_context_init(&session_ctx, LCT_SESSION);
+ session_ctx.lc_thread = NULL;
+ lu_context_enter(&session_ctx);
rc = lu_env_init(&env, ldt->ldt_ctx_tags);
if (rc == 0) {
+ env.le_ses = &session_ctx;
d = ldt->ldt_ops->ldto_device_alloc(&env, ldt, cfg);
lu_env_fini(&env);
if (!IS_ERR(d)) {
} else
rc = PTR_ERR(d);
}
+ lu_context_exit(&session_ctx);
+ lu_context_fini(&session_ctx);
+
} else {
OBD_CHECK_DT_OP(obd, setup, -EOPNOTSUPP);
OBD_COUNTER_INCREMENT(obd, setup);
OBD_CHECK_DEV(obd);
+ obd->obd_process_conf = 1;
ldt = obd->obd_type->typ_lu;
d = obd->obd_lu_dev;
if (ldt != NULL && d != NULL) {
rc = OBP(obd, process_config)(obd, datalen, data);
}
OBD_COUNTER_INCREMENT(obd, process_config);
+ obd->obd_process_conf = 0;
RETURN(rc);
}
RETURN(rc);
}
+static inline int obd_create_async(struct obd_export *exp,
+ struct obd_info *oinfo,
+ struct lov_stripe_md **ea,
+ struct obd_trans_info *oti)
+{
+ int rc;
+ ENTRY;
+
+ EXP_CHECK_DT_OP(exp, create_async);
+ EXP_COUNTER_INCREMENT(exp, create_async);
+
+ rc = OBP(exp->exp_obd, create_async)(exp, oinfo, ea, oti);
+ RETURN(rc);
+}
+
static inline int obd_create(struct obd_export *exp, struct obdo *obdo,
struct lov_stripe_md **ea,
struct obd_trans_info *oti)
static inline int obd_destroy(struct obd_export *exp, struct obdo *obdo,
struct lov_stripe_md *ea,
struct obd_trans_info *oti,
- struct obd_export *md_exp)
+ struct obd_export *md_exp, void *capa)
{
int rc;
ENTRY;
EXP_CHECK_DT_OP(exp, destroy);
EXP_COUNTER_INCREMENT(exp, destroy);
- rc = OBP(exp->exp_obd, destroy)(exp, obdo, ea, oti, md_exp);
+ rc = OBP(exp->exp_obd, destroy)(exp, obdo, ea, oti, md_exp, capa);
RETURN(rc);
}
}
static inline int obd_connect(const struct lu_env *env,
- struct lustre_handle *conn,struct obd_device *obd,
+ struct obd_export **exp,struct obd_device *obd,
struct obd_uuid *cluuid,
struct obd_connect_data *d,
void *localdata)
OBD_CHECK_DT_OP(obd, connect, -EOPNOTSUPP);
OBD_COUNTER_INCREMENT(obd, connect);
- rc = OBP(obd, connect)(env, conn, obd, cluuid, d, localdata);
+ rc = OBP(obd, connect)(env, exp, obd, cluuid, d, localdata);
/* check that only subset is granted */
LASSERT(ergo(d != NULL,
(d->ocd_connect_flags & ocf) == d->ocd_connect_flags));
RETURN(rc);
}
+static inline void obd_getref(struct obd_device *obd)
+{
+ ENTRY;
+ if (OBT(obd) && OBP(obd, getref)) {
+ OBD_COUNTER_INCREMENT(obd, getref);
+ OBP(obd, getref)(obd);
+ }
+ EXIT;
+}
+
+static inline void obd_putref(struct obd_device *obd)
+{
+ ENTRY;
+ if (OBT(obd) && OBP(obd, putref)) {
+ OBD_COUNTER_INCREMENT(obd, putref);
+ OBP(obd, putref)(obd);
+ }
+ EXIT;
+}
+
static inline int obd_init_export(struct obd_export *exp)
{
int rc = 0;
*/
onu = &observer->obd_upcall;
if (onu->onu_upcall != NULL)
- rc2 = onu->onu_upcall(observer, observed, ev, onu->onu_owner);
+ rc2 = onu->onu_upcall(observer, observed, ev,
+ onu->onu_owner, NULL);
else
rc2 = 0;
EXP_CHECK_DT_OP(exp, quotacheck);
EXP_COUNTER_INCREMENT(exp, quotacheck);
- rc = OBP(exp->exp_obd, quotacheck)(exp, oqctl);
+ rc = OBP(exp->exp_obd, quotacheck)(exp->exp_obd, exp, oqctl);
RETURN(rc);
}
EXP_CHECK_DT_OP(exp, quotactl);
EXP_COUNTER_INCREMENT(exp, quotactl);
- rc = OBP(exp->exp_obd, quotactl)(exp, oqctl);
+ rc = OBP(exp->exp_obd, quotactl)(exp->exp_obd, exp, oqctl);
+ RETURN(rc);
+}
+
+static inline int obd_quota_adjust_qunit(struct obd_export *exp,
+ struct quota_adjust_qunit *oqaq,
+ struct lustre_quota_ctxt *qctxt)
+{
+#if defined(LPROCFS) && defined(HAVE_QUOTA_SUPPORT)
+ struct timeval work_start;
+ struct timeval work_end;
+ long timediff;
+#endif
+ int rc;
+ ENTRY;
+
+#if defined(LPROCFS) && defined(HAVE_QUOTA_SUPPORT)
+ if (qctxt)
+ do_gettimeofday(&work_start);
+#endif
+ EXP_CHECK_DT_OP(exp, quota_adjust_qunit);
+ EXP_COUNTER_INCREMENT(exp, quota_adjust_qunit);
+
+ rc = OBP(exp->exp_obd, quota_adjust_qunit)(exp, oqaq, qctxt);
+
+#if defined(LPROCFS) && defined(HAVE_QUOTA_SUPPORT)
+ if (qctxt) {
+ do_gettimeofday(&work_end);
+ timediff = cfs_timeval_sub(&work_end, &work_start, NULL);
+ lprocfs_counter_add(qctxt->lqc_stats, LQUOTA_ADJUST_QUNIT,
+ timediff);
+ }
+#endif
RETURN(rc);
}
}
static inline int md_set_lock_data(struct obd_export *exp,
- __u64 *lockh, void *data)
+ __u64 *lockh, void *data, __u32 *bits)
{
ENTRY;
EXP_CHECK_MD_OP(exp, set_lock_data);
EXP_MD_COUNTER_INCREMENT(exp, set_lock_data);
- RETURN(MDP(exp->exp_obd, set_lock_data)(exp, lockh, data));
+ RETURN(MDP(exp->exp_obd, set_lock_data)(exp, lockh, data, bits));
}
static inline int md_cancel_unused(struct obd_export *exp,
RETURN(rc);
}
+static inline int md_unpack_capa(struct obd_export *exp,
+ struct ptlrpc_request *req,
+ const struct req_msg_field *field,
+ struct obd_capa **oc)
+{
+ int rc;
+ ENTRY;
+ EXP_CHECK_MD_OP(exp, unpack_capa);
+ EXP_MD_COUNTER_INCREMENT(exp, unpack_capa);
+ rc = MDP(exp->exp_obd, unpack_capa)(exp, req, field, oc);
+ RETURN(rc);
+}
+
static inline int md_intent_getattr_async(struct obd_export *exp,
struct md_enqueue_info *minfo,
struct ldlm_enqueue_info *einfo)