#define CFS_SYMBOL_LEN 64
struct cfs_symbol {
- char name[CFS_SYMBOL_LEN];
- void *value;
- int ref;
- cfs_list_t sym_list;
+ char name[CFS_SYMBOL_LEN];
+ void *value;
+ int ref;
+ struct list_head sym_list;
};
extern int cfs_symbol_register(const char *, const void *);
* Proc emulator file system APIs
*/
-typedef int cfs_read_proc_t(char *page, char **start, off_t off,
+typedef int read_proc_t(char *page, char **start, off_t off,
int count, int *eof, void *data);
-typedef int cfs_write_proc_t(struct file *file, const char *buffer,
+typedef int write_proc_t(struct file *file, const char *buffer,
unsigned long count, void *data);
#define CFS_PROC_ENTRY_MAGIC 'CPEM'
struct cfs_proc_entry *parent;
struct _file_entry { // proc file / leaf entry
- cfs_read_proc_t * read_proc;
- cfs_write_proc_t * write_proc;
+ read_proc_t * read_proc;
+ write_proc_t * write_proc;
};
mode_t mode;
/* the mantaner of the cfs_sysctl_table trees */
struct ctl_table_header
{
- struct ctl_table * ctl_table;
- cfs_list_t ctl_entry;
+ struct ctl_table *ctl_table;
+ struct list_head ctl_entry;
};
/* proc root entries, support routines */
int seq_putc(struct seq_file *m, char c);
int seq_puts(struct seq_file *m, const char *s);
-int seq_printf(struct seq_file *, const char *, ...)
- __attribute__ ((format (printf,2,3)));
-
int seq_path(struct seq_file *, struct path *, char *);
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
* Helpers for iteration over list_head-s in seq_files
*/
-extern cfs_list_t *seq_list_start(cfs_list_t *head, loff_t pos);
-extern cfs_list_t *seq_list_start_head(cfs_list_t *head, loff_t pos);
-extern cfs_list_t *seq_list_next(void *v, cfs_list_t *head, loff_t *ppos);
+extern struct list_head *seq_list_start(struct list_head *head, loff_t pos);
+extern struct list_head *seq_list_start_head(struct list_head *head, loff_t pos);
+extern struct list_head *seq_list_next(void *v, struct list_head *head, loff_t *ppos);
/*
* declaration of proc kernel process routines
unsigned int flags;
spinlock_t guard;
- cfs_list_t waiters;
-
+ struct list_head waiters;
} wait_queue_head_t;
#define CFS_WAITQ_CHAN_NORMAL (0)
#define CFS_WAITQ_CHAN_FORWARD (1)
-
-
typedef struct cfs_waitlink_channel {
- cfs_list_t link;
- wait_queue_head_t * waitq;
- wait_queue_t * waitl;
+ struct list_head link;
+ wait_queue_head_t *waitq;
+ wait_queue_t *waitl;
} cfs_waitlink_channel_t;
struct cfs_waitlink {
unsigned int magic;
int flags;
event_t * event;
- cfs_atomic_t * hits;
+ atomic_t * hits;
cfs_waitlink_channel_t waitq[CFS_WAITQ_CHANNELS];
};
#define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t)))
struct group_info {
int ngroups;
- cfs_atomic_t usage;
+ atomic_t usage;
gid_t small_block[NGROUPS_SMALL];
int nblocks;
gid_t *blocks[0];
};
#define get_group_info(group_info) do { \
- cfs_atomic_inc(&(group_info)->usage); \
+ atomic_inc(&(group_info)->usage); \
} while (0)
#define put_group_info(group_info) do { \
- if (cfs_atomic_dec_and_test(&(group_info)->usage)) \
+ if (atomic_dec_and_test(&(group_info)->usage)) \
groups_free(group_info); \
} while (0)
HANDLE Tid; /* Thread id */
PETHREAD Tet; /* Pointer to ethread */
- cfs_atomic_t count; /* refer count */
- cfs_atomic_t hits; /* times of waken event singaled */
+ atomic_t count; /* refer count */
+ atomic_t hits; /* times of waken event singaled */
KIRQL irql; /* irql for rwlock ... */
#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
#if 0 /* defined in libcfs/libcfs_hash.h */
-static inline u32 cfs_hash_long(u32 val, unsigned int bits)
+static inline u32 hash_long(u32 val, unsigned int bits)
{
/* On some cpus multiply is faster, on others gcc will do shifts */
u32 hash = val * GOLDEN_RATIO_PRIME_32;