Whamcloud - gitweb
LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error
[fs/lustre-release.git] / libcfs / include / libcfs / libcfs_hash.h
index 64feebf..6fe31a6 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
+#include <linux/refcount.h>
 #include <libcfs/linux/linux-hash.h>
 
 /** disable debug */
@@ -250,8 +251,8 @@ struct cfs_hash {
         /** workitem to output max depth */
        struct work_struct              hs_dep_work;
 #endif
-        /** name of htable */
-        char                        hs_name[0];
+       /** name of htable */
+       char                        hs_name[];
 };
 
 struct cfs_hash_lock_ops {
@@ -610,10 +611,10 @@ void cfs_hash_bd_move_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd_old,
 
 static inline int
 cfs_hash_bd_dec_and_lock(struct cfs_hash *hs, struct cfs_hash_bd *bd,
-                        atomic_t *condition)
+                        refcount_t *condition)
 {
        LASSERT(cfs_hash_with_spin_bktlock(hs));
-       return atomic_dec_and_lock(condition, &bd->bd_bucket->hsb_lock.spin);
+       return refcount_dec_and_lock(condition, &bd->bd_bucket->hsb_lock.spin);
 }
 
 static inline struct hlist_head *