struct file *mds_lov_objid_filp;
struct file *mds_health_check_filp;
unsigned long *mds_client_bitmap;
- struct semaphore mds_orphan_recovery_sem;
struct upcall_cache *mds_group_hash;
struct lustre_quota_info mds_quota_info;
RETURN(rc);
CDEBUG(D_CONFIG, "llog init with %d targets\n", count);
- LASSERT(lov->desc.ld_tgt_count == count);
+ /* count may not match ld_tgt_count during dynamic ost add */
for (i = 0, ctgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, ctgt++) {
struct obd_device *child;
if (!ctgt->ltd_active)
LASSERT(!lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb)));
- sema_init(&mds->mds_orphan_recovery_sem, 1);
sema_init(&mds->mds_epoch_sem, 1);
spin_lock_init(&mds->mds_transno_lock);
mds->mds_max_mdsize = sizeof(struct lov_mds_md);
/* Only do this at first add (idx), or the first time after recovery */
if (idx != MDSLOV_NO_INDEX || 1/*FIXME*/) {
CDEBUG(D_CONFIG, "reset llogs idx=%d\n", idx);
- /* These two must be atomic */
- down(&mds->mds_orphan_recovery_sem);
- obd_llog_finish(obd, old_count);
+ /* Note that this will cause multiple mds/lov/osc_llog_init's
+ with no llog_cleanup's, so fns should deal with that. */
llog_cat_initialize(obd, mds->mds_lov_desc.ld_tgt_count);
- up(&mds->mds_orphan_recovery_sem);
}
RETURN(rc);
RETURN(-EFAULT);
if (obd->obd_llog_ctxt[index]) {
- /* During an mds_lov_add_ost, we try to tear down and resetup llogs.
- But the mdt teardown does not flow down to the lov/osc's as the
- setup does, because the lov/osc must clean up only when they are
- done, not when the mdt is done. So instead, we just assume that
- if the lov llogs are already set up then we must cleanup first. */
+ /* mds_lov_update_mds might call here multiple times. So if the
+ llog is already set up then don't to do it again. */
CDEBUG(D_CONFIG, "obd %s ctxt %d already set up\n",
obd->obd_name, index);
- llog_cleanup(obd->obd_llog_ctxt[index]);
+ ctxt = obd->obd_llog_ctxt[index];
+ LASSERT(ctxt->loc_obd == obd);
+ LASSERT(ctxt->loc_exp == disk_obd->obd_self_export);
+ LASSERT(ctxt->loc_logops == op);
+ RETURN(0);
}
-
+
OBD_ALLOC(ctxt, sizeof(*ctxt));
if (!ctxt)
RETURN(-ENOMEM);