/* --- lu_device_type operations --- */
int cmm_upcall(const struct lu_env *env, struct md_device *md,
- enum md_upcall_event ev)
+ enum md_upcall_event ev, void *data)
{
int rc;
ENTRY;
CERROR("can not init md size %d\n", rc);
/* fall through */
default:
- rc = md_do_upcall(env, md, ev);
+ rc = md_do_upcall(env, md, ev, data);
}
RETURN(rc);
}
}
int cmm_upcall(const struct lu_env *env, struct md_device *md,
- enum md_upcall_event ev);
+ enum md_upcall_event ev, void *data);
#ifdef HAVE_SPLIT_SUPPORT
* Disable transacrions for split, since there will be so many trans in
* this one ops, conflict with current recovery design.
*/
- rc = cmm_upcall(env, &cmm->cmm_md_dev, MD_NO_TRANS);
+ rc = cmm_upcall(env, &cmm->cmm_md_dev, MD_NO_TRANS, NULL);
if (rc) {
CERROR("Can't disable trans for split, rc %d\n", rc);
GOTO(out, rc);
static int mdc_obd_update(struct obd_device *host,
struct obd_device *watched,
- enum obd_notify_event ev, void *owner)
+ enum obd_notify_event ev, void *owner, void *data)
{
struct mdc_device *mc = owner;
int rc = 0;
int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp);
int cl_ocd_update(struct obd_device *host,
struct obd_device *watched,
- enum obd_notify_event ev, void *owner);
+ enum obd_notify_event ev, void *owner, void *data);
struct ccc_grouplock {
struct lu_env *cg_env;
ctxt->loc_gen.mnt_cnt = obd->u.filter.fo_mount_count;
else
ctxt->loc_gen.mnt_cnt = 0;
+ ctxt->loc_gen.conn_cnt++;
}
static inline int llog_gen_lt(struct llog_gen a, struct llog_gen b)
return(a.conn_cnt < b.conn_cnt ? 1 : 0);
}
-#define LLOG_GEN_INC(gen) ((gen).conn_cnt ++)
#define LLOG_PROC_BREAK 0x0001
#define LLOG_DEL_RECORD 0x0002
struct md_device *mu_upcall_dev;
/** upcall function */
int (*mu_upcall)(const struct lu_env *env, struct md_device *md,
- enum md_upcall_event ev);
+ enum md_upcall_event ev, void *data);
};
struct md_device {
}
static inline int md_do_upcall(const struct lu_env *env, struct md_device *m,
- enum md_upcall_event ev)
+ enum md_upcall_event ev, void *data)
{
int rc = 0;
down_read(&m->md_upcall.mu_upcall_sem);
if (m->md_upcall.mu_upcall_dev != NULL &&
m->md_upcall.mu_upcall_dev->md_upcall.mu_upcall != NULL) {
rc = m->md_upcall.mu_upcall_dev->md_upcall.mu_upcall(env,
- m->md_upcall.mu_upcall_dev, ev);
+ m->md_upcall.mu_upcall_dev,
+ ev, data);
}
up_read(&m->md_upcall.mu_upcall_sem);
return rc;
*/
struct obd_notify_upcall {
int (*onu_upcall)(struct obd_device *host, struct obd_device *watched,
- enum obd_notify_event ev, void *owner);
+ enum obd_notify_event ev, void *owner, void *data);
/* Opaque datum supplied by upper layer listener */
void *onu_owner;
};
*/
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;
*/
int cl_ocd_update(struct obd_device *host,
struct obd_device *watched,
- enum obd_notify_event ev, void *owner)
+ enum obd_notify_event ev, void *owner, void *data)
{
struct lustre_client_ocd *lco;
struct client_obd *cli;
#include "mdd_internal.h"
static int mdd_notify(struct obd_device *host, struct obd_device *watched,
- enum obd_notify_event ev, void *owner)
+ enum obd_notify_event ev, void *owner, void *data)
{
struct mdd_device *mdd = owner;
int rc = 0;
case OBD_NOTIFY_ACTIVE:
case OBD_NOTIFY_SYNC:
case OBD_NOTIFY_SYNC_NONBLOCK:
- rc = md_do_upcall(NULL, &mdd->mdd_md_dev, MD_LOV_SYNC);
+ rc = md_do_upcall(NULL, &mdd->mdd_md_dev,
+ MD_LOV_SYNC, data);
break;
case OBD_NOTIFY_CONFIG:
- rc = md_do_upcall(NULL, &mdd->mdd_md_dev, MD_LOV_CONFIG);
+ rc = md_do_upcall(NULL, &mdd->mdd_md_dev,
+ MD_LOV_CONFIG, data);
break;
#ifdef HAVE_QUOTA_SUPPORT
case OBD_NOTIFY_QUOTA:
- rc = md_do_upcall(NULL, &mdd->mdd_md_dev, MD_LOV_QUOTA);
+ rc = md_do_upcall(NULL, &mdd->mdd_md_dev,
+ MD_LOV_QUOTA, data);
break;
#endif
default:
if (obd->obd_upcall.onu_owner) {
LASSERT(obd->obd_upcall.onu_upcall != NULL);
rc = obd->obd_upcall.onu_upcall(obd, NULL, ev,
- obd->obd_upcall.onu_owner);
+ obd->obd_upcall.onu_owner,
+ &mds->mds_mount_count);
}
out:
OBD_FREE(ld, sizeof(*ld));
*/
LASSERT(obd->obd_upcall.onu_upcall != NULL);
rc = obd->obd_upcall.onu_upcall(obd, NULL, OBD_NOTIFY_QUOTA,
- obd->obd_upcall.onu_owner);
+ obd->obd_upcall.onu_owner,NULL);
}
#endif
EXIT;
}
static int mdt_upcall(const struct lu_env *env, struct md_device *md,
- enum md_upcall_event ev)
+ enum md_upcall_event ev, void *data)
{
struct mdt_device *m = mdt_dev(&md->md_lu_dev);
struct md_device *next = m->mdt_child;
CDEBUG(D_INFO, "get max mdsize %d max cookiesize %d\n",
m->mdt_max_mdsize, m->mdt_max_cookiesize);
mdt_allow_cli(m, CONFIG_SYNC);
+ if (data)
+ (*(__u64 *)data) = m->mdt_mount_count;
break;
case MD_NO_TRANS:
mti = lu_context_key_get(&env->le_ctx, &mdt_thread_key);
obd->obd_last_committed = mdt->mdt_last_transno;
spin_unlock(&mdt->mdt_transno_lock);
- mdt->mdt_mount_count++;
+ mdt->mdt_mount_count = mount_count + 1;
lsd->lsd_mount_count = mdt->mdt_mount_count;
/* save it, so mount count and last_transno is current */
ctxt = llog_group_get_ctxt(olg, index);
if (!ctxt)
RETURN(-ENODEV);
- llog_gen_init(ctxt);
if (logid && logid->lgl_oid) {
rc = llog_create(ctxt, &handle, logid, NULL);
}
/* FIXME what value for gen->conn_cnt */
- LLOG_GEN_INC(ctxt->loc_gen);
+ llog_gen_init(ctxt);
/* first add llog_gen_rec */
OBD_ALLOC_PTR(lgr);
if (req == NULL)
RETURN(-ENOMEM);
+ CDEBUG(D_OTHER, "%s mount_count %llu, connection count %llu\n",
+ ctxt->loc_exp->exp_obd->obd_type->typ_name,
+ ctxt->loc_gen.mnt_cnt, ctxt->loc_gen.conn_cnt);
+
req_body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_CONN_BODY);
req_body->lgdc_gen = ctxt->loc_gen;
req_body->lgdc_logid = ctxt->loc_handle->lgh_id;
run_test 20a "|X| open(O_CREAT), unlink, replay, close (test mds_cleanup_orphans)"
test_20b() { # bug 10480
- # XXX increase the debug level temporary
- DEBUG_SAVED=$PTLDEBUG
- DEBUG_MB_SAVED=$DEBUG_SIZE
- PTLDEBUG=0x33f1404
- DEBUG_SIZE=150
- do_nodes $(comma_list $(nodes_list)) "$LCTL set_param debug=$PTLDEBUG; $LCTL set_param debug_mb=$DEBUG_SIZE"
BEFOREUSED=`df -P $DIR | tail -1 | awk '{ print $3 }'`
dd if=/dev/zero of=$DIR/$tfile bs=4k count=10000 &
log "before $BEFOREUSED, after $AFTERUSED"
[ $AFTERUSED -gt $((BEFOREUSED + 20)) ] && \
error "after $AFTERUSED > before $BEFOREUSED"
- # XXX decrease it back
- PTLDEBUG=$DEBUG_SAVED
- DEBUG_SIZE=$DEBUG_MB_SAVED
- do_nodes $(comma_list $(nodes_list)) "$LCTL set_param debug=$PTLDEBUG; $LCTL set_param debug_mb=$DEBUG_SIZE"
return 0
}
run_test 20b "write, unlink, eviction, replay, (test mds_cleanup_orphans)"