#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)
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;
#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;
#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) \
# 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 */
/** # 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 */
/** 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];
* 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
/**
* Binary heap operations.
*/
-typedef struct {
+struct cfs_binheap_ops {
/**
* Called right before inserting a node into the binary heap.
*
* \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.
*
* \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
* \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 */
/** 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);
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 */
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);
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);
* @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;
}
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);
/**
* 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
*
* \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 */
* \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);
* \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;
*
* \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]);
* \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;
* \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);
* \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;
* \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;
* \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);
* \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);
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;
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;
#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 */
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)
{
#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;
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 */
} 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) {
* 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);
* 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;
* 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);
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();
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);
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);
#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, \
#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); \
#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); \
#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); \
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;
}
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);
* 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)
#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 { \
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
*/
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
*/
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;
/**
/** 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. */
/**
* Heap of queues.
*/
- cfs_binheap_t *th_binheap;
+ struct cfs_binheap *th_binheap;
/**
* Hash of clients.
*/
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;
struct lfsck_assistant_operations *lad_ops;
- cfs_bitmap_t *lad_bitmap;
+ struct cfs_bitmap *lad_bitmap;
__u32 lad_touch_gen;
int lad_prefetched;
__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);
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;
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;
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;
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;
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;
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;
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;
/* 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 */
*/
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;
* \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;
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,
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 :
*/
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)) {
* \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;
/**
* 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,
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 :
*/
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)) {
* \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;
/**
* 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,
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);
__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); \