* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
static inline struct llog_commit_master
*lcm_get(struct llog_commit_master *lcm)
{
- LASSERT(cfs_atomic_read(&lcm->lcm_refcount) > 0);
cfs_atomic_inc(&lcm->lcm_refcount);
return lcm;
}
static inline void
lcm_put(struct llog_commit_master *lcm)
{
- if (!cfs_atomic_dec_and_test(&lcm->lcm_refcount)) {
- return ;
- }
- OBD_FREE_PTR(lcm);
+ LASSERT_ATOMIC_POS(&lcm->lcm_refcount);
+ if (cfs_atomic_dec_and_test(&lcm->lcm_refcount))
+ OBD_FREE_PTR(lcm);
}
struct llog_canceld_ctxt {
{
struct obd_device *obd = ctxt->loc_exp->exp_obd;
+ LASSERTF(obd->u.obt.obt_magic == OBT_MAGIC,
+ "%s: wrong obt magic %#x\n",
+ obd->obd_name, obd->u.obt.obt_magic);
ctxt->loc_gen.mnt_cnt = obd->u.obt.obt_mount_count;
ctxt->loc_gen.conn_cnt++;
}
static inline struct llog_ctxt *llog_ctxt_get(struct llog_ctxt *ctxt)
{
- LASSERT(cfs_atomic_read(&ctxt->loc_refcount) > 0);
cfs_atomic_inc(&ctxt->loc_refcount);
CDEBUG(D_INFO, "GETting ctxt %p : new refcount %d\n", ctxt,
cfs_atomic_read(&ctxt->loc_refcount));
{
if (ctxt == NULL)
return;
- LASSERT(cfs_atomic_read(&ctxt->loc_refcount) > 0);
- LASSERT(cfs_atomic_read(&ctxt->loc_refcount) < 0x5a5a5a);
+ LASSERT_ATOMIC_GT_LT(&ctxt->loc_refcount, 0, 0x5a5a5a);
CDEBUG(D_INFO, "PUTting ctxt %p : new refcount %d\n", ctxt,
cfs_atomic_read(&ctxt->loc_refcount) - 1);
__llog_ctxt_put(ctxt);
cfs_waitq_init(&olg->olg_waitq);
cfs_spin_lock_init(&olg->olg_lock);
cfs_sema_init(&olg->olg_cat_processing, 1);
- olg->olg_group = group;
+ olg->olg_seq = group;
}
static inline void llog_group_set_export(struct obd_llog_group *olg,
cfs_spin_lock(&olg->olg_lock);
if (olg->olg_exp != NULL && olg->olg_exp != exp)
CWARN("%s: export for group %d is changed: 0x%p -> 0x%p\n",
- exp->exp_obd->obd_name, olg->olg_group,
+ exp->exp_obd->obd_name, olg->olg_seq,
olg->olg_exp, exp);
olg->olg_exp = exp;
cfs_spin_unlock(&olg->olg_lock);