Whamcloud - gitweb
LU-9679 libcfs: Add CFS_ALLOC_PTR_ARRAY and free
[fs/lustre-release.git] / libcfs / include / libcfs / libcfs_private.h
index 27db6b7..28db507 100644 (file)
@@ -343,8 +343,13 @@ do {                                                            \
 #define LASSERT_ATOMIC_ZERO(a)                  LASSERT_ATOMIC_EQ(a, 0)
 #define LASSERT_ATOMIC_POS(a)                   LASSERT_ATOMIC_GT(a, 0)
 
-#define CFS_ALLOC_PTR(ptr)      LIBCFS_ALLOC(ptr, sizeof (*(ptr)));
-#define CFS_FREE_PTR(ptr)       LIBCFS_FREE(ptr, sizeof (*(ptr)));
+#define CFS_ALLOC_PTR(ptr)      LIBCFS_ALLOC(ptr, sizeof(*(ptr)));
+#define CFS_ALLOC_PTR_ARRAY(ptr, count)                        \
+       LIBCFS_ALLOC(ptr, (count) * sizeof(*(ptr)))
+
+#define CFS_FREE_PTR(ptr)       LIBCFS_FREE(ptr, sizeof(*(ptr)));
+#define CFS_FREE_PTR_ARRAY(ptr, count)                 \
+       LIBCFS_FREE(ptr, (count) * sizeof(*(ptr)))
 
 /* implication */
 #define ergo(a, b) (!(a) || (b))