Whamcloud - gitweb
LU-6245 libcfs: remove typedefs in libcfs source code 02/17202/6
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 10 Feb 2016 14:39:45 +0000 (09:39 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 14 Mar 2016 02:39:08 +0000 (02:39 +0000)
Convert most of the typdefs used in libcfs source code
to a standard struct. Only a few left which will be
completely removed in later patches. The typedef
function pointers will be the only ones remaining.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Change-Id: I5c9efa10d23904c456154d5afbb80c4197e91641
Reviewed-on: http://review.whamcloud.com/17202
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
29 files changed:
libcfs/include/libcfs/bitmap.h
libcfs/include/libcfs/libcfs_debug.h
libcfs/include/libcfs/libcfs_hash.h
libcfs/include/libcfs/libcfs_heap.h
libcfs/include/libcfs/libcfs_workitem.h
libcfs/libcfs/hash.c
libcfs/libcfs/heap.c
libcfs/libcfs/linux/linux-tracefile.c
libcfs/libcfs/tracefile.c
libcfs/libcfs/tracefile.h
libcfs/libcfs/workitem.c
lnet/klnds/gnilnd/gnilnd.h
lnet/selftest/selftest.h
lustre/include/lustre_dlm.h
lustre/include/lustre_net.h
lustre/include/lustre_nrs.h
lustre/include/lustre_nrs_crr.h
lustre/include/lustre_nrs_orr.h
lustre/include/lustre_nrs_tbf.h
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c
lustre/lod/lod_internal.h
lustre/lod/lod_lov.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_orr.c
lustre/ptlrpc/nrs_tbf.c
lustre/quota/lquota_internal.h

index e6f156e..639f4c9 100644 (file)
 #ifndef _LIBCFS_BITMAP_H_
 #define _LIBCFS_BITMAP_H_
 
-typedef struct {
-       unsigned int  size;
+struct cfs_bitmap {
+       unsigned int size;
        unsigned long data[0];
-} cfs_bitmap_t;
+};
 
 #define CFS_BITMAP_SIZE(nbits) \
-     (((nbits/BITS_PER_LONG)+1)*sizeof(long)+sizeof(cfs_bitmap_t))
+       (((nbits / BITS_PER_LONG) + 1) * sizeof(long) + \
+       sizeof(struct cfs_bitmap))
 
 static inline
-cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
+struct cfs_bitmap *CFS_ALLOCATE_BITMAP(int size)
 {
-       cfs_bitmap_t *ptr;
+       struct cfs_bitmap *ptr;
 
        LIBCFS_ALLOC(ptr, CFS_BITMAP_SIZE(size));
        if (ptr == NULL)
@@ -58,7 +59,7 @@ cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
        RETURN(ptr);
 }
 
-static inline void CFS_RESET_BITMAP(cfs_bitmap_t *bitmap)
+static inline void CFS_RESET_BITMAP(struct cfs_bitmap *bitmap)
 {
        if (bitmap->size > 0) {
                int nbits = bitmap->size;
@@ -71,38 +72,38 @@ static inline void CFS_RESET_BITMAP(cfs_bitmap_t *bitmap)
 #define CFS_FREE_BITMAP(ptr)   LIBCFS_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))
 
 static inline
-void cfs_bitmap_set(cfs_bitmap_t *bitmap, int nbit)
+void cfs_bitmap_set(struct cfs_bitmap *bitmap, int nbit)
 {
        set_bit(nbit, bitmap->data);
 }
 
 static inline
-void cfs_bitmap_clear(cfs_bitmap_t *bitmap, int nbit)
+void cfs_bitmap_clear(struct cfs_bitmap *bitmap, int nbit)
 {
        test_and_clear_bit(nbit, bitmap->data);
 }
 
 static inline
-int cfs_bitmap_check(cfs_bitmap_t *bitmap, int nbit)
+int cfs_bitmap_check(struct cfs_bitmap *bitmap, int nbit)
 {
        return test_bit(nbit, bitmap->data);
 }
 
 static inline
-int cfs_bitmap_test_and_clear(cfs_bitmap_t *bitmap, int nbit)
+int cfs_bitmap_test_and_clear(struct cfs_bitmap *bitmap, int nbit)
 {
        return test_and_clear_bit(nbit, bitmap->data);
 }
 
 /* return 0 is bitmap has none set bits */
 static inline
-int cfs_bitmap_check_empty(cfs_bitmap_t *bitmap)
+int cfs_bitmap_check_empty(struct cfs_bitmap *bitmap)
 {
        return find_first_bit(bitmap->data, bitmap->size) == bitmap->size;
 }
 
 static inline
-void cfs_bitmap_copy(cfs_bitmap_t *new, cfs_bitmap_t *old)
+void cfs_bitmap_copy(struct cfs_bitmap *new, struct cfs_bitmap *old)
 {
        size_t newsize;
 
index 73b8c00..f390367 100644 (file)
@@ -173,19 +173,19 @@ struct ptldebug_header {
 #define CDEBUG_DEFAULT_MAX_DELAY (cfs_time_seconds(600))         /* jiffies */
 #define CDEBUG_DEFAULT_MIN_DELAY ((cfs_time_seconds(1) + 1) / 2) /* jiffies */
 #define CDEBUG_DEFAULT_BACKOFF   2
-typedef struct {
-        cfs_time_t      cdls_next;
-        unsigned int    cdls_delay;
-        int             cdls_count;
-} cfs_debug_limit_state_t;
+struct cfs_debug_limit_state {
+       cfs_time_t      cdls_next;
+       unsigned int    cdls_delay;
+       int             cdls_count;
+};
 
 struct libcfs_debug_msg_data {
-        const char               *msg_file;
-        const char               *msg_fn;
-        int                      msg_subsys;
-        int                      msg_line;
-        int                      msg_mask;
-        cfs_debug_limit_state_t  *msg_cdls;
+       const char                      *msg_file;
+       const char                      *msg_fn;
+       int                              msg_subsys;
+       int                              msg_line;
+       int                              msg_mask;
+       struct cfs_debug_limit_state    *msg_cdls;
 };
 
 #define LIBCFS_DEBUG_MSG_DATA_INIT(data, mask, cdls)        \
@@ -234,11 +234,11 @@ do {                                                                    \
 
 #  define CDEBUG(mask, format, ...) __CDEBUG(NULL, mask, format, ## __VA_ARGS__)
 
-#  define CDEBUG_LIMIT(mask, format, ...)      \
-do {                                            \
-        static cfs_debug_limit_state_t cdls;    \
-                                                \
-        __CDEBUG(&cdls, mask, format, ## __VA_ARGS__);\
+#  define CDEBUG_LIMIT(mask, format, ...)                              \
+do {                                                                   \
+       static struct cfs_debug_limit_state cdls;                       \
+                                                                       \
+       __CDEBUG(&cdls, mask, format, ## __VA_ARGS__);                  \
 } while (0)
 
 # else /* !CDEBUG_ENABLED */
index f076b37..28bb503 100644 (file)
@@ -245,7 +245,7 @@ struct cfs_hash {
         /** # of iterators (caller of cfs_hash_for_each_*) */
         __u32                       hs_iterators;
        /** rehash workitem */
-       cfs_workitem_t                  hs_rehash_wi;
+       struct cfs_workitem             hs_rehash_wi;
        /** refcount on this hash table */
        atomic_t                        hs_refcount;
        /** rehash buckets-table */
@@ -262,7 +262,7 @@ struct cfs_hash {
         /** bits when we found the max depth */
         unsigned int                hs_dep_bits;
         /** workitem to output max depth */
-        cfs_workitem_t              hs_dep_wi;
+       struct cfs_workitem         hs_dep_wi;
 #endif
         /** name of htable */
         char                        hs_name[0];
index 8a9a855..239e9e0 100644 (file)
  * the tree (as this is an implementation of a min-heap) to be removed by users
  * for consumption.
  *
- * Users of the heap should embed a \e cfs_binheap_node_t object instance on
- * every object of the set that they wish the binary heap instance to handle,
- * and (at a minimum) provide a cfs_binheap_ops_t::hop_compare() implementation
- * which is used by the heap as the binary predicate during its internal sorting
- * operations.
+ * Users of the heap should embed a \e struct cfs_binheap_node object instance
+ * on every object of the set that they wish the binary heap instance to handle,
+ * and (at a minimum) provide a struct cfs_binheap_ops::hop_compare()
+ * implementation which is used by the heap as the binary predicate during its
+ * internal sorting operations.
  *
  * The current implementation enforces no locking scheme, and so assumes the
  * user caters for locking between calls to insert, delete and lookup
  * Binary heap node.
  *
  * Objects of this type are embedded into objects of the ordered set that is to
- * be maintained by a \e cfs_binheap_t instance.
+ * be maintained by a \e struct cfs_binheap instance.
  */
-typedef struct {
+struct cfs_binheap_node {
        /** Index into the binary tree */
        unsigned int    chn_index;
-} cfs_binheap_node_t;
+};
 
 #define CBH_SHIFT      9
 #define CBH_SIZE       (1 << CBH_SHIFT)                    /* # ptrs per level */
 #define CBH_MASK       (CBH_SIZE - 1)
-#define CBH_NOB        (CBH_SIZE * sizeof(cfs_binheap_node_t *))
+#define CBH_NOB        (CBH_SIZE * sizeof(struct cfs_binheap_node *))
 
 #define CBH_POISON     0xdeadbeef
 
@@ -87,7 +87,7 @@ struct cfs_binheap;
 /**
  * Binary heap operations.
  */
-typedef struct {
+struct cfs_binheap_ops {
        /**
         * Called right before inserting a node into the binary heap.
         *
@@ -100,7 +100,7 @@ typedef struct {
         * \retval != 0 error
         */
        int             (*hop_enter)(struct cfs_binheap *h,
-                                    cfs_binheap_node_t *e);
+                                    struct cfs_binheap_node *e);
        /**
         * Called right after removing a node from the binary heap.
         *
@@ -110,7 +110,7 @@ typedef struct {
         * \param[in] e The node
         */
        void            (*hop_exit)(struct cfs_binheap *h,
-                                   cfs_binheap_node_t *e);
+                                   struct cfs_binheap_node *e);
        /**
         * A binary predicate which is called during internal heap sorting
         * operations, and used in order to determine the relevant ordering of
@@ -127,22 +127,22 @@ typedef struct {
         * \see cfs_binheap_bubble()
         * \see cfs_biheap_sink()
         */
-       int             (*hop_compare)(cfs_binheap_node_t *a,
-                                      cfs_binheap_node_t *b);
-} cfs_binheap_ops_t;
+       int             (*hop_compare)(struct cfs_binheap_node *a,
+                                      struct cfs_binheap_node *b);
+};
 
 /**
  * Binary heap object.
  *
- * Sorts elements of type \e cfs_binheap_node_t
+ * Sorts elements of type \e struct cfs_binheap_node
  */
-typedef struct cfs_binheap {
+struct cfs_binheap {
        /** Triple indirect */
-       cfs_binheap_node_t  ****cbh_elements3;
+       struct cfs_binheap_node  ****cbh_elements3;
        /** double indirect */
-       cfs_binheap_node_t   ***cbh_elements2;
+       struct cfs_binheap_node   ***cbh_elements2;
        /** single indirect */
-       cfs_binheap_node_t    **cbh_elements1;
+       struct cfs_binheap_node    **cbh_elements1;
        /** # elements referenced */
        unsigned int            cbh_nelements;
        /** high water mark */
@@ -150,46 +150,48 @@ typedef struct cfs_binheap {
        /** user flags */
        unsigned int            cbh_flags;
        /** operations table */
-       cfs_binheap_ops_t      *cbh_ops;
+       struct cfs_binheap_ops *cbh_ops;
        /** private data */
        void                   *cbh_private;
        /** associated CPT table */
        struct cfs_cpt_table   *cbh_cptab;
-       /** associated CPT id of this cfs_binheap_t::cbh_cptab */
+       /** associated CPT id of this struct cfs_binheap::cbh_cptab */
        int                     cbh_cptid;
-} cfs_binheap_t;
+};
 
-void cfs_binheap_destroy(cfs_binheap_t *h);
-cfs_binheap_t *cfs_binheap_create(cfs_binheap_ops_t *ops, unsigned int flags,
-                                 unsigned count, void *arg,
-                                 struct cfs_cpt_table *cptab, int cptid);
-cfs_binheap_node_t *cfs_binheap_find(cfs_binheap_t *h, unsigned int idx);
-int cfs_binheap_insert(cfs_binheap_t *h, cfs_binheap_node_t *e);
-void cfs_binheap_remove(cfs_binheap_t *h, cfs_binheap_node_t *e);
-void cfs_binheap_relocate(cfs_binheap_t *h, cfs_binheap_node_t *e);
+void cfs_binheap_destroy(struct cfs_binheap *h);
+struct cfs_binheap *
+cfs_binheap_create(struct cfs_binheap_ops *ops, unsigned int flags,
+                  unsigned count, void *arg, struct cfs_cpt_table *cptab,
+                  int cptid);
+struct cfs_binheap_node *
+cfs_binheap_find(struct cfs_binheap *h, unsigned int idx);
+int cfs_binheap_insert(struct cfs_binheap *h, struct cfs_binheap_node *e);
+void cfs_binheap_remove(struct cfs_binheap *h, struct cfs_binheap_node *e);
+void cfs_binheap_relocate(struct cfs_binheap *h, struct cfs_binheap_node *e);
 
 static inline int
-cfs_binheap_size(cfs_binheap_t *h)
+cfs_binheap_size(struct cfs_binheap *h)
 {
        return h->cbh_nelements;
 }
 
 static inline int
-cfs_binheap_is_empty(cfs_binheap_t *h)
+cfs_binheap_is_empty(struct cfs_binheap *h)
 {
        return h->cbh_nelements == 0;
 }
 
-static inline cfs_binheap_node_t *
-cfs_binheap_root(cfs_binheap_t *h)
+static inline struct cfs_binheap_node *
+cfs_binheap_root(struct cfs_binheap *h)
 {
        return cfs_binheap_find(h, 0);
 }
 
-static inline cfs_binheap_node_t *
-cfs_binheap_remove_root(cfs_binheap_t *h)
+static inline struct cfs_binheap_node *
+cfs_binheap_remove_root(struct cfs_binheap *h)
 {
-       cfs_binheap_node_t *e = cfs_binheap_find(h, 0);
+       struct cfs_binheap_node *e = cfs_binheap_find(h, 0);
 
        if (e != NULL)
                cfs_binheap_remove(h, e);
index a800a9b..b80f162 100644 (file)
@@ -73,7 +73,8 @@ int cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab, int cpt,
 struct cfs_workitem;
 
 typedef int (*cfs_wi_action_t) (struct cfs_workitem *);
-typedef struct cfs_workitem {
+
+struct cfs_workitem {
        /** chain on runq or rerunq */
        struct list_head        wi_list;
        /** working function */
@@ -84,10 +85,10 @@ typedef struct cfs_workitem {
        unsigned short          wi_running:1;
        /** scheduled */
        unsigned short          wi_scheduled:1;
-} cfs_workitem_t;
+};
 
 static inline void
-cfs_wi_init(cfs_workitem_t *wi, void *data, cfs_wi_action_t action)
+cfs_wi_init(struct cfs_workitem *wi, void *data, cfs_wi_action_t action)
 {
        INIT_LIST_HEAD(&wi->wi_list);
 
@@ -97,9 +98,9 @@ cfs_wi_init(cfs_workitem_t *wi, void *data, cfs_wi_action_t action)
        wi->wi_action    = action;
 }
 
-void cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi);
-int  cfs_wi_deschedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi);
-void cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi);
+void cfs_wi_schedule(struct cfs_wi_sched *sched, struct cfs_workitem *wi);
+int  cfs_wi_deschedule(struct cfs_wi_sched *sched, struct cfs_workitem *wi);
+void cfs_wi_exit(struct cfs_wi_sched *sched, struct cfs_workitem *wi);
 
 int  cfs_wi_startup(void);
 void cfs_wi_shutdown(void);
index 02575fb..c3d662f 100644 (file)
@@ -965,10 +965,10 @@ cfs_hash_buckets_realloc(struct cfs_hash *hs, struct cfs_hash_bucket **old_bkts,
  * @flags    - CFS_HASH_REHASH enable synamic hash resizing
  *           - CFS_HASH_SORT enable chained hash sort
  */
-static int cfs_hash_rehash_worker(cfs_workitem_t *wi);
+static int cfs_hash_rehash_worker(struct cfs_workitem *wi);
 
 #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1
-static int cfs_hash_dep_print(cfs_workitem_t *wi)
+static int cfs_hash_dep_print(struct cfs_workitem *wi)
 {
        struct cfs_hash *hs = container_of(wi, struct cfs_hash, hs_dep_wi);
        int         dep;
@@ -1895,7 +1895,7 @@ cfs_hash_rehash_bd(struct cfs_hash *hs, struct cfs_hash_bd *old)
 }
 
 static int
-cfs_hash_rehash_worker(cfs_workitem_t *wi)
+cfs_hash_rehash_worker(struct cfs_workitem *wi)
 {
        struct cfs_hash         *hs =
                container_of(wi, struct cfs_hash, hs_rehash_wi);
index ed87fa7..f784fb9 100644 (file)
@@ -51,7 +51,7 @@ do {                                                                  \
 
 /**
  * Grows the capacity of a binary heap so that it can handle a larger number of
- * \e cfs_binheap_node_t objects.
+ * \e struct cfs_binheap_node objects.
  *
  * \param[in] h The binary heap
  *
@@ -59,10 +59,10 @@ do {                                                                        \
  * \retval -ENOMEM OOM error
  */
 static int
-cfs_binheap_grow(cfs_binheap_t *h)
+cfs_binheap_grow(struct cfs_binheap *h)
 {
-       cfs_binheap_node_t ***frag1 = NULL;
-       cfs_binheap_node_t  **frag2;
+       struct cfs_binheap_node ***frag1 = NULL;
+       struct cfs_binheap_node  **frag2;
        int hwm = h->cbh_hwm;
 
        /* need a whole new chunk of pointers */
@@ -155,12 +155,12 @@ cfs_binheap_grow(cfs_binheap_t *h)
  * \retval valid-pointer A newly-created and initialized binary heap object
  * \retval NULL                 error
  */
-cfs_binheap_t *
-cfs_binheap_create(cfs_binheap_ops_t *ops, unsigned int flags,
+struct cfs_binheap *
+cfs_binheap_create(struct cfs_binheap_ops *ops, unsigned int flags,
                   unsigned count, void *arg, struct cfs_cpt_table *cptab,
                   int cptid)
 {
-       cfs_binheap_t *h;
+       struct cfs_binheap *h;
 
        LASSERT(ops != NULL);
        LASSERT(ops->hop_compare != NULL);
@@ -202,7 +202,7 @@ EXPORT_SYMBOL(cfs_binheap_create);
  * \param[in] h The binary heap object
  */
 void
-cfs_binheap_destroy(cfs_binheap_t *h)
+cfs_binheap_destroy(struct cfs_binheap *h)
 {
        int idx0;
        int idx1;
@@ -253,8 +253,8 @@ EXPORT_SYMBOL(cfs_binheap_destroy);
  *
  * \retval valid-pointer A double pointer to a heap pointer entry
  */
-static cfs_binheap_node_t **
-cfs_binheap_pointer(cfs_binheap_t *h, unsigned int idx)
+static struct cfs_binheap_node **
+cfs_binheap_pointer(struct cfs_binheap *h, unsigned int idx)
 {
        if (idx < CBH_SIZE)
                return &(h->cbh_elements1[idx]);
@@ -278,8 +278,8 @@ cfs_binheap_pointer(cfs_binheap_t *h, unsigned int idx)
  * \retval valid-pointer The requested heap node
  * \retval NULL                 Supplied index is out of bounds
  */
-cfs_binheap_node_t *
-cfs_binheap_find(cfs_binheap_t *h, unsigned int idx)
+struct cfs_binheap_node *
+cfs_binheap_find(struct cfs_binheap *h, unsigned int idx)
 {
        if (idx >= h->cbh_nelements)
                return NULL;
@@ -298,12 +298,12 @@ EXPORT_SYMBOL(cfs_binheap_find);
  * \retval 0 The position of \a e in the tree was not changed
  */
 static int
-cfs_binheap_bubble(cfs_binheap_t *h, cfs_binheap_node_t *e)
+cfs_binheap_bubble(struct cfs_binheap *h, struct cfs_binheap_node *e)
 {
        unsigned int         cur_idx = e->chn_index;
-       cfs_binheap_node_t **cur_ptr;
+       struct cfs_binheap_node **cur_ptr;
        unsigned int         parent_idx;
-       cfs_binheap_node_t **parent_ptr;
+       struct cfs_binheap_node **parent_ptr;
        int                  did_sth = 0;
 
        cur_ptr = cfs_binheap_pointer(h, cur_idx);
@@ -341,17 +341,17 @@ cfs_binheap_bubble(cfs_binheap_t *h, cfs_binheap_node_t *e)
  * \retval 0 The position of \a e in the tree was not changed
  */
 static int
-cfs_binheap_sink(cfs_binheap_t *h, cfs_binheap_node_t *e)
+cfs_binheap_sink(struct cfs_binheap *h, struct cfs_binheap_node *e)
 {
        unsigned int         n = h->cbh_nelements;
        unsigned int         child_idx;
-       cfs_binheap_node_t **child_ptr;
-       cfs_binheap_node_t  *child;
+       struct cfs_binheap_node **child_ptr;
+       struct cfs_binheap_node  *child;
        unsigned int         child2_idx;
-       cfs_binheap_node_t **child2_ptr;
-       cfs_binheap_node_t  *child2;
+       struct cfs_binheap_node **child2_ptr;
+       struct cfs_binheap_node  *child2;
        unsigned int         cur_idx;
-       cfs_binheap_node_t **cur_ptr;
+       struct cfs_binheap_node **cur_ptr;
        int                  did_sth = 0;
 
        cur_idx = e->chn_index;
@@ -406,9 +406,9 @@ cfs_binheap_sink(cfs_binheap_t *h, cfs_binheap_node_t *e)
  * \retval != 0 error
  */
 int
-cfs_binheap_insert(cfs_binheap_t *h, cfs_binheap_node_t *e)
+cfs_binheap_insert(struct cfs_binheap *h, struct cfs_binheap_node *e)
 {
-       cfs_binheap_node_t **new_ptr;
+       struct cfs_binheap_node **new_ptr;
        unsigned int         new_idx = h->cbh_nelements;
        int                  rc;
 
@@ -442,12 +442,12 @@ EXPORT_SYMBOL(cfs_binheap_insert);
  * \param[in] e The node
  */
 void
-cfs_binheap_remove(cfs_binheap_t *h, cfs_binheap_node_t *e)
+cfs_binheap_remove(struct cfs_binheap *h, struct cfs_binheap_node *e)
 {
        unsigned int         n = h->cbh_nelements;
        unsigned int         cur_idx = e->chn_index;
-       cfs_binheap_node_t **cur_ptr;
-       cfs_binheap_node_t  *last;
+       struct cfs_binheap_node **cur_ptr;
+       struct cfs_binheap_node  *last;
 
        LASSERT(cur_idx != CBH_POISON);
        LASSERT(cur_idx < n);
@@ -480,7 +480,7 @@ EXPORT_SYMBOL(cfs_binheap_remove);
  * \param[in] e The node
  */
 void
-cfs_binheap_relocate(cfs_binheap_t *h, cfs_binheap_node_t *e)
+cfs_binheap_relocate(struct cfs_binheap *h, struct cfs_binheap_node *e)
 {
        if (!cfs_binheap_bubble(h, e))
                cfs_binheap_sink(h, e);
index 778a56f..4ce8e97 100644 (file)
@@ -132,7 +132,7 @@ void cfs_tracefile_write_unlock()
        up_write(&cfs_tracefile_sem);
 }
 
-cfs_trace_buf_type_t cfs_trace_buf_idx_get()
+enum cfs_trace_buf_type cfs_trace_buf_idx_get()
 {
        if (in_irq())
                return CFS_TCD_TYPE_IRQ;
index 5228bea..0c721a9 100644 (file)
@@ -275,7 +275,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
         int                        remain;
         int                        mask = msgdata->msg_mask;
         char                      *file = (char *)msgdata->msg_file;
-        cfs_debug_limit_state_t   *cdls = msgdata->msg_cdls;
+       struct cfs_debug_limit_state *cdls = msgdata->msg_cdls;
 
         if (strchr(file, '/'))
                 file = strrchr(file, '/') + 1;
index d189295..d2d92c8 100644 (file)
 
 #include <libcfs/libcfs.h>
 
-typedef enum {
+enum cfs_trace_buf_type {
        CFS_TCD_TYPE_PROC = 0,
        CFS_TCD_TYPE_SOFTIRQ,
        CFS_TCD_TYPE_IRQ,
        CFS_TCD_TYPE_MAX
-} cfs_trace_buf_type_t;
+};
 
 /* trace file lock routines */
 
@@ -267,7 +267,7 @@ extern int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking);
 extern void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking);
 
 extern char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
-extern cfs_trace_buf_type_t cfs_trace_buf_idx_get(void);
+extern enum cfs_trace_buf_type cfs_trace_buf_idx_get(void);
 
 static inline char *cfs_trace_get_console_buffer(void)
 {
index 1a4ca46..386ba17 100644 (file)
@@ -46,7 +46,7 @@
 
 #define CFS_WS_NAME_LEN         16
 
-typedef struct cfs_wi_sched {
+struct cfs_wi_sched {
        struct list_head                ws_list;        /* chain on global list */
        /** serialised workitems */
        spinlock_t                      ws_lock;
@@ -74,13 +74,13 @@ typedef struct cfs_wi_sched {
        unsigned int            ws_starting:1;
        /** scheduler name */
        char                    ws_name[CFS_WS_NAME_LEN];
-} cfs_wi_sched_t;
+};
 
 static struct cfs_workitem_data {
        /** serialize */
        spinlock_t              wi_glock;
        /** list of all schedulers */
-       struct list_head                wi_scheds;
+       struct list_head        wi_scheds;
        /** WI module is initialized */
        int                     wi_init;
        /** shutting down the whole WI module */
@@ -88,19 +88,19 @@ static struct cfs_workitem_data {
 } cfs_wi_data;
 
 static inline void
-cfs_wi_sched_lock(cfs_wi_sched_t *sched)
+cfs_wi_sched_lock(struct cfs_wi_sched *sched)
 {
        spin_lock(&sched->ws_lock);
 }
 
 static inline void
-cfs_wi_sched_unlock(cfs_wi_sched_t *sched)
+cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 {
        spin_unlock(&sched->ws_lock);
 }
 
 static inline int
-cfs_wi_sched_cansleep(cfs_wi_sched_t *sched)
+cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
        cfs_wi_sched_lock(sched);
        if (sched->ws_stopping) {
@@ -121,7 +121,7 @@ cfs_wi_sched_cansleep(cfs_wi_sched_t *sched)
  * 1. when it returns no one shall try to schedule the workitem.
  */
 void
-cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
+cfs_wi_exit(struct cfs_wi_sched *sched, struct cfs_workitem *wi)
 {
        LASSERT(!in_interrupt()); /* because we use plain spinlock */
        LASSERT(!sched->ws_stopping);
@@ -151,7 +151,7 @@ EXPORT_SYMBOL(cfs_wi_exit);
  * cancel schedule request of workitem \a wi
  */
 int
-cfs_wi_deschedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
+cfs_wi_deschedule(struct cfs_wi_sched *sched, struct cfs_workitem *wi)
 {
        int     rc;
 
@@ -192,7 +192,7 @@ EXPORT_SYMBOL(cfs_wi_deschedule);
  * be added, and even dynamic creation of serialised queues might be supported.
  */
 void
-cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
+cfs_wi_schedule(struct cfs_wi_sched *sched, struct cfs_workitem *wi)
 {
        LASSERT(!in_interrupt()); /* because we use plain spinlock */
        LASSERT(!sched->ws_stopping);
@@ -219,9 +219,9 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
 EXPORT_SYMBOL(cfs_wi_schedule);
 
 static int
-cfs_wi_scheduler (void *arg)
+cfs_wi_scheduler(void *arg)
 {
-       struct cfs_wi_sched     *sched = (cfs_wi_sched_t *)arg;
+       struct cfs_wi_sched *sched = (struct cfs_wi_sched *)arg;
 
        cfs_block_allsigs();
 
@@ -244,12 +244,12 @@ cfs_wi_scheduler (void *arg)
        while (!sched->ws_stopping) {
                int             nloops = 0;
                int             rc;
-               cfs_workitem_t *wi;
+               struct cfs_workitem *wi;
 
                while (!list_empty(&sched->ws_runq) &&
                       nloops < CFS_WI_RESCHED) {
                        wi = list_entry(sched->ws_runq.next,
-                                           cfs_workitem_t, wi_list);
+                                       struct cfs_workitem, wi_list);
                        LASSERT(wi->wi_scheduled && !wi->wi_running);
 
                        list_del_init(&wi->wi_list);
@@ -438,7 +438,7 @@ EXPORT_SYMBOL(cfs_wi_sched_create);
 int
 cfs_wi_startup(void)
 {
-       memset(&cfs_wi_data, 0, sizeof(cfs_wi_data));
+       memset(&cfs_wi_data, 0, sizeof(struct cfs_workitem_data));
 
        spin_lock_init(&cfs_wi_data.wi_glock);
        INIT_LIST_HEAD(&cfs_wi_data.wi_scheds);
index c27c48f..6cc2ac7 100644 (file)
@@ -1000,7 +1000,7 @@ do {                                                                          \
 #define GNIDBG_MSG(level, msg, fmt, args...)                                  \
 do {                                                                          \
        if ((level) & (D_ERROR | D_WARNING | D_NETERROR)) {                   \
-           static cfs_debug_limit_state_t cdls;                              \
+           static struct cfs_debug_limit_state cdls;                         \
            LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, level, &cdls);                \
            kgnilnd_debug_msg(&msgdata, level, &cdls, msg,                    \
                              "$$ "fmt" from %s ", ## args,                   \
@@ -1017,7 +1017,7 @@ do {                                                                          \
 #define GNIDBG_TOMSG(level, msg, fmt, args...)                                \
 do {                                                                          \
        if ((level) & (D_ERROR | D_WARNING | D_NETERROR)) {                   \
-           static cfs_debug_limit_state_t cdls;                              \
+           static struct cfs_debug_limit_state cdls;                         \
            LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, level, &cdls);                \
            kgnilnd_debug_msg(&msgdata, level, &cdls, msg,                    \
                              "$$ "fmt" ", ## args);                          \
@@ -1046,7 +1046,7 @@ do {                                                                           \
 #define GNIDBG_CONN(level, conn, fmt, args...)                                  \
 do {                                                                            \
        if ((level) & (D_ERROR | D_WARNING | D_NETERROR)) {                     \
-           static cfs_debug_limit_state_t cdls;                                \
+           static struct cfs_debug_limit_state cdls;                           \
            LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, level, &cdls);                  \
            kgnilnd_debug_conn(&msgdata, level, &cdls, conn,                    \
                               "$$ "fmt" ", ## args);                           \
@@ -1075,7 +1075,7 @@ do {                                                                           \
 #define GNIDBG_TX(level, tx, fmt, args...)                                      \
 do {                                                                            \
        if ((level) & (D_ERROR | D_WARNING | D_NETERROR)) {                     \
-           static cfs_debug_limit_state_t cdls;                                \
+           static struct cfs_debug_limit_state cdls;                           \
            LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, level, &cdls);                  \
            kgnilnd_debug_tx(&msgdata, level, &cdls, tx,                        \
                              "$$ "fmt" ", ## args);                            \
index 830418c..386da3b 100644 (file)
@@ -176,7 +176,7 @@ typedef int (*swi_action_t) (struct swi_workitem *);
 
 typedef struct swi_workitem {
        struct cfs_wi_sched     *swi_sched;
-        cfs_workitem_t       swi_workitem;
+       struct cfs_workitem       swi_workitem;
         swi_action_t         swi_action;
         int                  swi_state;
 } swi_workitem_t;
@@ -460,7 +460,7 @@ srpc_serv_is_framework(struct srpc_service *svc)
 }
 
 static inline int
-swi_wi_action(cfs_workitem_t *wi)
+swi_wi_action(struct cfs_workitem *wi)
 {
         swi_workitem_t *swi = container_of(wi, swi_workitem_t, swi_workitem);
 
index 5beb294..57ec18e 100644 (file)
@@ -1145,7 +1145,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
  * Rate-limited version of lock printing function.
  */
 #define LDLM_DEBUG_LIMIT(mask, lock, fmt, a...) do {                         \
-        static cfs_debug_limit_state_t _ldlm_cdls;                           \
+       static struct cfs_debug_limit_state _ldlm_cdls;                      \
         LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, &_ldlm_cdls);              \
         ldlm_lock_debug(&msgdata, mask, &_ldlm_cdls, lock, "### " fmt , ##a);\
 } while (0)
index 266105c..1a66ff1 100644 (file)
@@ -1299,7 +1299,7 @@ do {                                                                          \
 #define DEBUG_REQ(level, req, fmt, args...)                                   \
 do {                                                                          \
         if ((level) & (D_ERROR | D_WARNING)) {                                \
-                static cfs_debug_limit_state_t cdls;                          \
+               static struct cfs_debug_limit_state cdls;                     \
                 LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, level, &cdls);            \
                 debug_req(&msgdata, level, &cdls, req, "@@@ "fmt" ", ## args);\
         } else {                                                              \
index 6f913d2..00d0cdf 100644 (file)
@@ -700,7 +700,7 @@ struct ptlrpc_nrs_request {
        unsigned                        nr_enqueued:1;
        unsigned                        nr_started:1;
        unsigned                        nr_finalized:1;
-       cfs_binheap_node_t              nr_node;
+       struct cfs_binheap_node         nr_node;
 
        /**
         * Policy-specific fields, used for determining a request's scheduling
index 277e902..f057ec7 100644 (file)
@@ -44,7 +44,7 @@
  */
 struct nrs_crrn_net {
        struct ptlrpc_nrs_resource      cn_res;
-       cfs_binheap_t                  *cn_binheap;
+       struct cfs_binheap             *cn_binheap;
        struct cfs_hash                *cn_cli_hash;
        /**
         * Used when a new scheduling round commences, in order to synchronize
index eb69fa8..d9789b2 100644 (file)
@@ -106,7 +106,7 @@ struct nrs_orr_key {
  */
 struct nrs_orr_data {
        struct ptlrpc_nrs_resource      od_res;
-       cfs_binheap_t                  *od_binheap;
+       struct cfs_binheap             *od_binheap;
        struct cfs_hash                *od_obj_hash;
        struct kmem_cache              *od_cache;
        /**
index 04998c3..3d52f78 100644 (file)
@@ -79,7 +79,7 @@ struct nrs_tbf_client {
        /** List of queued requests. */
        struct list_head                 tc_list;
        /** Node in binary heap. */
-       cfs_binheap_node_t               tc_node;
+       struct cfs_binheap_node          tc_node;
        /** Whether the client is in heap. */
        bool                             tc_in_heap;
        /** Sequence of the newest rule. */
@@ -200,7 +200,7 @@ struct nrs_tbf_head {
        /**
         * Heap of queues.
         */
-       cfs_binheap_t                   *th_binheap;
+       struct cfs_binheap              *th_binheap;
        /**
         * Hash of clients.
         */
index f437e15..2a69432 100644 (file)
@@ -475,7 +475,7 @@ struct lfsck_tgt_descs {
        struct lfsck_tgt_desc_idx       *ltd_tgts_idx[TGT_PTRS];
 
        /* bitmap of TGTs available */
-       cfs_bitmap_t                    *ltd_tgts_bitmap;
+       struct cfs_bitmap                       *ltd_tgts_bitmap;
 
        /* for lfsck_tgt_desc::ltd_xxx_list */
        spinlock_t                       ltd_lock;
@@ -828,7 +828,7 @@ struct lfsck_assistant_data {
 
        struct lfsck_assistant_operations       *lad_ops;
 
-       cfs_bitmap_t                            *lad_bitmap;
+       struct cfs_bitmap                               *lad_bitmap;
 
        __u32                                    lad_touch_gen;
        int                                      lad_prefetched;
@@ -1405,7 +1405,7 @@ static inline void lfsck_lad_set_bitmap(const struct lu_env *env,
                                        __u32 index)
 {
        struct lfsck_assistant_data     *lad    = com->lc_data;
-       cfs_bitmap_t                    *bitmap = lad->lad_bitmap;
+       struct cfs_bitmap               *bitmap = lad->lad_bitmap;
 
        LASSERT(com->lc_lfsck->li_master);
        LASSERT(bitmap != NULL);
index a59dc24..fafe82f 100644 (file)
@@ -763,7 +763,7 @@ static int lfsck_layout_load_bitmap(const struct lu_env *env,
        struct dt_object                *obj    = com->lc_obj;
        struct lfsck_assistant_data     *lad    = com->lc_data;
        struct lfsck_layout             *lo     = com->lc_file_ram;
-       cfs_bitmap_t                    *bitmap = lad->lad_bitmap;
+       struct cfs_bitmap                       *bitmap = lad->lad_bitmap;
        loff_t                           pos    = com->lc_file_size;
        ssize_t                          size;
        __u32                            nbits;
@@ -781,7 +781,7 @@ static int lfsck_layout_load_bitmap(const struct lu_env *env,
 
        if (nbits > bitmap->size) {
                __u32 new_bits = bitmap->size;
-               cfs_bitmap_t *new_bitmap;
+               struct cfs_bitmap *new_bitmap;
 
                while (new_bits < nbits)
                        new_bits <<= 1;
@@ -889,7 +889,7 @@ static int lfsck_layout_store(const struct lu_env *env,
        struct lfsck_layout     *lo     = com->lc_file_disk;
        struct thandle          *th;
        struct dt_device        *dev    = lfsck_obj2dev(obj);
-       cfs_bitmap_t            *bitmap = NULL;
+       struct cfs_bitmap       *bitmap = NULL;
        loff_t                   pos;
        ssize_t                  size   = com->lc_file_size;
        __u32                    nbits  = 0;
index f6406e0..3d8e75b 100644 (file)
@@ -191,8 +191,8 @@ static int __lfsck_add_target(const struct lu_env *env,
        if (index >= ltds->ltd_tgts_bitmap->size) {
                __u32 newsize = max((__u32)ltds->ltd_tgts_bitmap->size,
                                    (__u32)BITS_PER_LONG);
-               cfs_bitmap_t *old_bitmap = ltds->ltd_tgts_bitmap;
-               cfs_bitmap_t *new_bitmap;
+               struct cfs_bitmap *old_bitmap = ltds->ltd_tgts_bitmap;
+               struct cfs_bitmap *new_bitmap;
 
                while (newsize < index + 1)
                        newsize <<= 1;
index 5db753b..af4f0b7 100644 (file)
@@ -271,7 +271,7 @@ static int lfsck_namespace_load_bitmap(const struct lu_env *env,
        struct dt_object                *obj    = com->lc_obj;
        struct lfsck_assistant_data     *lad    = com->lc_data;
        struct lfsck_namespace          *ns     = com->lc_file_ram;
-       cfs_bitmap_t                    *bitmap = lad->lad_bitmap;
+       struct cfs_bitmap                       *bitmap = lad->lad_bitmap;
        ssize_t                          size;
        __u32                            nbits;
        int                              rc;
@@ -288,7 +288,7 @@ static int lfsck_namespace_load_bitmap(const struct lu_env *env,
 
        if (nbits > bitmap->size) {
                __u32 new_bits = bitmap->size;
-               cfs_bitmap_t *new_bitmap;
+               struct cfs_bitmap *new_bitmap;
 
                while (new_bits < nbits)
                        new_bits <<= 1;
@@ -388,7 +388,7 @@ static int lfsck_namespace_store(const struct lu_env *env,
        struct lfsck_namespace          *ns     = com->lc_file_ram;
        struct lfsck_assistant_data     *lad    = com->lc_data;
        struct dt_device                *dev    = lfsck_obj2dev(obj);
-       cfs_bitmap_t                    *bitmap = NULL;
+       struct cfs_bitmap               *bitmap = NULL;
        struct thandle                  *handle;
        __u32                            nbits  = 0;
        int                              len    = com->lc_file_size;
index 869a44e..42b8ef4 100644 (file)
@@ -153,7 +153,7 @@ struct lod_tgt_descs {
        /* number of registered TGTs */
        __u32                   ltd_tgtnr;
        /* bitmap of TGTs available */
-       cfs_bitmap_t            *ltd_tgt_bitmap;
+       struct cfs_bitmap       *ltd_tgt_bitmap;
        /* TGTs scheduled to be deleted */
        __u32                   ltd_death_row;
        /* Table refcount used for delayed deletion */
index ee19042..0ed2fe8 100644 (file)
@@ -148,7 +148,7 @@ void lod_putref(struct lod_device *lod, struct lod_tgt_descs *ltd)
  */
 static int ltd_bitmap_resize(struct lod_tgt_descs *ltd, __u32 newsize)
 {
-       cfs_bitmap_t *new_bitmap, *old_bitmap = NULL;
+       struct cfs_bitmap *new_bitmap, *old_bitmap = NULL;
        int           rc = 0;
        ENTRY;
 
index 96be3b7..ea5e127 100644 (file)
@@ -72,7 +72,8 @@
  * \retval 0 e1 > e2
  * \retval 1 e1 <= e2
  */
-static int crrn_req_compare(cfs_binheap_node_t *e1, cfs_binheap_node_t *e2)
+static int
+crrn_req_compare(struct cfs_binheap_node *e1, struct cfs_binheap_node *e2)
 {
        struct ptlrpc_nrs_request *nrq1;
        struct ptlrpc_nrs_request *nrq2;
@@ -88,7 +89,7 @@ static int crrn_req_compare(cfs_binheap_node_t *e1, cfs_binheap_node_t *e2)
        return nrq1->nr_u.crr.cr_sequence < nrq2->nr_u.crr.cr_sequence;
 }
 
-static cfs_binheap_ops_t nrs_crrn_heap_ops = {
+static struct cfs_binheap_ops nrs_crrn_heap_ops = {
        .hop_enter      = NULL,
        .hop_exit       = NULL,
        .hop_compare    = crrn_req_compare,
@@ -414,7 +415,7 @@ struct ptlrpc_nrs_request *nrs_crrn_req_get(struct ptlrpc_nrs_policy *policy,
                                            bool peek, bool force)
 {
        struct nrs_crrn_net       *net = policy->pol_private;
-       cfs_binheap_node_t        *node = cfs_binheap_root(net->cn_binheap);
+       struct cfs_binheap_node   *node = cfs_binheap_root(net->cn_binheap);
        struct ptlrpc_nrs_request *nrq;
 
        nrq = unlikely(node == NULL) ? NULL :
@@ -576,7 +577,7 @@ static void nrs_crrn_req_del(struct ptlrpc_nrs_policy *policy,
         */
        if (unlikely(is_root)) {
                /** Peek at the next request to be served */
-               cfs_binheap_node_t *node = cfs_binheap_root(net->cn_binheap);
+               struct cfs_binheap_node *node = cfs_binheap_root(net->cn_binheap);
 
                /** No more requests */
                if (unlikely(node == NULL)) {
index a2570aa..b22a651 100644 (file)
@@ -524,7 +524,8 @@ static struct cfs_hash_ops nrs_trr_hash_ops = {
  * \retval 0 e1 > e2
  * \retval 1 e1 < e2
  */
-static int orr_req_compare(cfs_binheap_node_t *e1, cfs_binheap_node_t *e2)
+static int
+orr_req_compare(struct cfs_binheap_node *e1, struct cfs_binheap_node *e2)
 {
        struct ptlrpc_nrs_request *nrq1;
        struct ptlrpc_nrs_request *nrq2;
@@ -579,7 +580,7 @@ static int orr_req_compare(cfs_binheap_node_t *e1, cfs_binheap_node_t *e2)
 /**
  * ORR binary heap operations
  */
-static cfs_binheap_ops_t nrs_orr_heap_ops = {
+static struct cfs_binheap_ops nrs_orr_heap_ops = {
        .hop_enter      = NULL,
        .hop_exit       = NULL,
        .hop_compare    = orr_req_compare,
@@ -944,7 +945,7 @@ struct ptlrpc_nrs_request *nrs_orr_req_get(struct ptlrpc_nrs_policy *policy,
                                           bool peek, bool force)
 {
        struct nrs_orr_data       *orrd = policy->pol_private;
-       cfs_binheap_node_t        *node = cfs_binheap_root(orrd->od_binheap);
+       struct cfs_binheap_node   *node = cfs_binheap_root(orrd->od_binheap);
        struct ptlrpc_nrs_request *nrq;
 
        nrq = unlikely(node == NULL) ? NULL :
@@ -1119,7 +1120,7 @@ static void nrs_orr_req_del(struct ptlrpc_nrs_policy *policy,
         */
        if (unlikely(is_root)) {
                /** Peek at the next request to be served */
-               cfs_binheap_node_t *node = cfs_binheap_root(orrd->od_binheap);
+               struct cfs_binheap_node *node = cfs_binheap_root(orrd->od_binheap);
 
                /** No more requests */
                if (unlikely(node == NULL)) {
index 7f92e10..3d8dcfb 100644 (file)
@@ -416,7 +416,8 @@ nrs_tbf_command(struct ptlrpc_nrs_policy *policy,
  * \retval 0 e1 > e2
  * \retval 1 e1 < e2
  */
-static int tbf_cli_compare(cfs_binheap_node_t *e1, cfs_binheap_node_t *e2)
+static int
+tbf_cli_compare(struct cfs_binheap_node *e1, struct cfs_binheap_node *e2)
 {
        struct nrs_tbf_client *cli1;
        struct nrs_tbf_client *cli2;
@@ -443,7 +444,7 @@ static int tbf_cli_compare(cfs_binheap_node_t *e1, cfs_binheap_node_t *e2)
 /**
  * TBF binary heap operations
  */
-static cfs_binheap_ops_t nrs_tbf_heap_ops = {
+static struct cfs_binheap_ops nrs_tbf_heap_ops = {
        .hop_enter      = NULL,
        .hop_exit       = NULL,
        .hop_compare    = tbf_cli_compare,
@@ -1376,7 +1377,7 @@ struct ptlrpc_nrs_request *nrs_tbf_req_get(struct ptlrpc_nrs_policy *policy,
        struct nrs_tbf_head       *head = policy->pol_private;
        struct ptlrpc_nrs_request *nrq = NULL;
        struct nrs_tbf_client     *cli;
-       cfs_binheap_node_t        *node;
+       struct cfs_binheap_node   *node;
 
        assert_spin_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock);
 
index 9309a90..31897da 100644 (file)
@@ -339,7 +339,7 @@ void lquota_lqe_debug0(struct lquota_entry *lqe,
        __attribute__ ((format (printf, 3, 4)));
 
 #define LQUOTA_DEBUG_LIMIT(mask, lqe, fmt, a...) do {                          \
-       static cfs_debug_limit_state_t _lquota_cdls;                           \
+       static struct cfs_debug_limit_state _lquota_cdls;                      \
        LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, &_lquota_cdls);              \
        lquota_lqe_debug(&msgdata, mask, &_lquota_cdls, lqe, "$$$ "fmt" ",     \
                         ##a);                                                 \