Whamcloud - gitweb
LU-16796 libcfs: Remove reference to LASSERT_ATOMIC_ZERO 04/51004/6
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Tue, 16 May 2023 03:00:49 +0000 (08:30 +0530)
committerOleg Drokin <green@whamcloud.com>
Tue, 1 Aug 2023 06:14:58 +0000 (06:14 +0000)
This patch removes all reference to LASSERT_ATOMIC_ZERO macro.

Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I73259599d1dee6277fadf66181699f1282274a80
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51004
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_private.h
lustre/ldlm/ldlm_lib.c
lustre/ptlrpc/sec.c

index 53ff128..9b80be4 100644 (file)
@@ -246,22 +246,6 @@ int libcfs_debug_cleanup(void);
 int libcfs_debug_clear_buffer(void);
 int libcfs_debug_mark_buffer(const char *text);
 
-#define LASSERT_ATOMIC_ENABLED          (1)
-
-#if LASSERT_ATOMIC_ENABLED
-
-/** assert value of @a is equal to @v */
-#define LASSERT_ATOMIC_EQ(a, v)                                \
-       LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a)));
-
-#else /* !LASSERT_ATOMIC_ENABLED */
-
-#define LASSERT_ATOMIC_EQ(a, v)                 do {} while (0)
-
-#endif /* LASSERT_ATOMIC_ENABLED */
-
-#define LASSERT_ATOMIC_ZERO(a)                  LASSERT_ATOMIC_EQ(a, 0)
-
 #define CFS_ALLOC_PTR(ptr)      LIBCFS_ALLOC(ptr, sizeof(*(ptr)));
 #define CFS_ALLOC_PTR_ARRAY(ptr, count)                        \
        LIBCFS_ALLOC(ptr, (count) * sizeof(*(ptr)))
index 38e3632..ee248fe 100644 (file)
@@ -1675,10 +1675,10 @@ void target_destroy_export(struct obd_export *exp)
        if (imp != NULL)
                client_destroy_import(imp);
 
-       LASSERT_ATOMIC_ZERO(&exp->exp_locks_count);
-       LASSERT_ATOMIC_ZERO(&exp->exp_rpc_count);
-       LASSERT_ATOMIC_ZERO(&exp->exp_cb_count);
-       LASSERT_ATOMIC_ZERO(&exp->exp_replay_count);
+       LASSERT(atomic_read(&exp->exp_locks_count) == 0);
+       LASSERT(atomic_read(&exp->exp_rpc_count) == 0);
+       LASSERT(atomic_read(&exp->exp_cb_count) == 0);
+       LASSERT(atomic_read(&exp->exp_replay_count) == 0);
 }
 EXPORT_SYMBOL(target_destroy_export);
 
index 101a472..ab747f8 100644 (file)
@@ -1289,8 +1289,8 @@ static void sec_cop_destroy_sec(struct ptlrpc_sec *sec)
 {
        struct ptlrpc_sec_policy *policy = sec->ps_policy;
 
-       LASSERT_ATOMIC_ZERO(&sec->ps_refcount);
-       LASSERT_ATOMIC_ZERO(&sec->ps_nctx);
+       LASSERT(atomic_read(&sec->ps_refcount) == 0);
+       LASSERT(atomic_read(&sec->ps_nctx) == 0);
        LASSERT(policy->sp_cops->destroy_sec);
 
        CDEBUG(D_SEC, "%s@%p: being destroyed\n", sec->ps_policy->sp_name, sec);