Whamcloud - gitweb
LU-16796 libcfs: Remove reference to LASSERT_ATOMIC_POS
[fs/lustre-release.git] / lustre / ptlrpc / sec.c
index bd152ba..7f616c9 100644 (file)
@@ -310,7 +310,7 @@ void sptlrpc_cli_ctx_put(struct ptlrpc_cli_ctx *ctx, int sync)
        struct ptlrpc_sec *sec = ctx->cc_sec;
 
        LASSERT(sec);
-       LASSERT_ATOMIC_POS(&ctx->cc_refcount);
+       LASSERT(atomic_read(&(ctx)->cc_refcount) > 0);
 
        if (!atomic_dec_and_test(&ctx->cc_refcount))
                return;
@@ -1307,7 +1307,7 @@ EXPORT_SYMBOL(sptlrpc_sec_destroy);
 
 static void sptlrpc_sec_kill(struct ptlrpc_sec *sec)
 {
-       LASSERT_ATOMIC_POS(&sec->ps_refcount);
+       LASSERT(atomic_read(&(sec)->ps_refcount) > 0);
 
        if (sec->ps_policy->sp_cops->kill_sec) {
                sec->ps_policy->sp_cops->kill_sec(sec);
@@ -1328,7 +1328,7 @@ EXPORT_SYMBOL(sptlrpc_sec_get);
 void sptlrpc_sec_put(struct ptlrpc_sec *sec)
 {
        if (sec) {
-               LASSERT_ATOMIC_POS(&sec->ps_refcount);
+               LASSERT(atomic_read(&(sec)->ps_refcount) > 0);
 
                if (atomic_dec_and_test(&sec->ps_refcount)) {
                        sptlrpc_gc_del_sec(sec);
@@ -1410,7 +1410,7 @@ static void sptlrpc_import_sec_install(struct obd_import *imp,
 {
        struct ptlrpc_sec *old_sec;
 
-       LASSERT_ATOMIC_POS(&sec->ps_refcount);
+       LASSERT(atomic_read(&(sec)->ps_refcount) > 0);
 
        write_lock(&imp->imp_sec_lock);
        old_sec = imp->imp_sec;
@@ -1588,7 +1588,7 @@ int sptlrpc_cli_alloc_reqbuf(struct ptlrpc_request *req, int msgsize)
        LASSERT(ctx->cc_sec);
        LASSERT(ctx->cc_sec->ps_policy);
        LASSERT(req->rq_reqmsg == NULL);
-       LASSERT_ATOMIC_POS(&ctx->cc_refcount);
+       LASSERT(atomic_read(&(ctx)->cc_refcount) > 0);
 
        policy = ctx->cc_sec->ps_policy;
        rc = policy->sp_cops->alloc_reqbuf(ctx->cc_sec, req, msgsize);
@@ -1616,7 +1616,7 @@ void sptlrpc_cli_free_reqbuf(struct ptlrpc_request *req)
        LASSERT(ctx);
        LASSERT(ctx->cc_sec);
        LASSERT(ctx->cc_sec->ps_policy);
-       LASSERT_ATOMIC_POS(&ctx->cc_refcount);
+       LASSERT(atomic_read(&(ctx)->cc_refcount) > 0);
 
        if (req->rq_reqbuf == NULL && req->rq_clrbuf == NULL)
                return;
@@ -1740,7 +1740,7 @@ void sptlrpc_cli_free_repbuf(struct ptlrpc_request *req)
        LASSERT(ctx);
        LASSERT(ctx->cc_sec);
        LASSERT(ctx->cc_sec->ps_policy);
-       LASSERT_ATOMIC_POS(&ctx->cc_refcount);
+       LASSERT(atomic_read(&(ctx)->cc_refcount) > 0);
 
        if (req->rq_repbuf == NULL)
                return;
@@ -2390,7 +2390,7 @@ void sptlrpc_svc_ctx_decref(struct ptlrpc_request *req)
        if (ctx == NULL)
                return;
 
-       LASSERT_ATOMIC_POS(&ctx->sc_refcount);
+       LASSERT(atomic_read(&(ctx)->sc_refcount) > 0);
        if (atomic_dec_and_test(&ctx->sc_refcount)) {
                if (ctx->sc_policy->sp_sops->free_ctx)
                        ctx->sc_policy->sp_sops->free_ctx(ctx);
@@ -2405,7 +2405,7 @@ void sptlrpc_svc_ctx_invalidate(struct ptlrpc_request *req)
        if (ctx == NULL)
                return;
 
-       LASSERT_ATOMIC_POS(&ctx->sc_refcount);
+       LASSERT(atomic_read(&(ctx)->sc_refcount) > 0);
        if (ctx->sc_policy->sp_sops->invalidate_ctx)
                ctx->sc_policy->sp_sops->invalidate_ctx(ctx);
 }