This patch removes all reference to LASSERT_ATOMIC_GT_LT macro.
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I9acf820b32855e54369c18470fb1b73d7f08c41a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51157
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#define LASSERT_ATOMIC_EQ(a, v) \
LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a)));
-/** assert value of @a is great than @v1 and little than @v2 */
-#define LASSERT_ATOMIC_GT_LT(a, v1, v2) \
-do { \
- int __v = atomic_read(a); \
- LASSERTF(__v > v1 && __v < v2, "value: %d\n", __v); \
-} while (0)
-
#else /* !LASSERT_ATOMIC_ENABLED */
#define LASSERT_ATOMIC_EQ(a, v) do {} while (0)
-#define LASSERT_ATOMIC_GT_LT(a, v1, v2) do {} while (0)
#endif /* LASSERT_ATOMIC_ENABLED */
static inline void llog_ctxt_put(struct llog_ctxt *ctxt)
{
- if (ctxt == NULL)
+ int refcount;
+
+ if (!ctxt)
return;
- LASSERT_ATOMIC_GT_LT(&ctxt->loc_refcount, 0, LI_POISON);
+
+ refcount = atomic_read(&ctxt->loc_refcount);
+ LASSERT(refcount > 0 && refcount < LI_POISON);
+
CDEBUG(D_INFO, "PUTting ctxt %p : new refcount %d\n", ctxt,
atomic_read(&ctxt->loc_refcount) - 1);
__llog_ctxt_put(NULL, ctxt);
int ldlm_resource_putref(struct ldlm_resource *res)
{
struct ldlm_namespace *ns = ldlm_res_to_ns(res);
- struct cfs_hash_bd bd;
+ struct cfs_hash_bd bd;
+ int refcount;
+
+ refcount = atomic_read(&res->lr_refcount);
+ LASSERT(refcount > 0 && refcount < LI_POISON);
- LASSERT_ATOMIC_GT_LT(&res->lr_refcount, 0, LI_POISON);
CDEBUG(D_INFO, "putref res: %p count: %d\n",
res, atomic_read(&res->lr_refcount) - 1);