cfs_proc_entry_t * root = NULL;
memset(&(root_table_header), 0, sizeof(struct ctl_table_header));
- CFS_INIT_LIST_HEAD(&(root_table_header.ctl_entry));
+ INIT_LIST_HEAD(&(root_table_header.ctl_entry));
INIT_PROCFS_LOCK();
proc_entry_cache = kmem_cache_create(NULL, sizeof(cfs_proc_entry_t),
#define OP_MIN 4
-static int do_proc_dointvec(struct ctl_table *table, int write, struct file *filp,
+static int do_proc_dointvec(struct ctl_table *table, int write,
void *buffer, size_t *lenp, int conv, int op)
{
int *i, vleft, first=1, neg, val;
if (write && first)
return -EINVAL;
*lenp -= left;
- memset(&(filp->f_pos) , 0, sizeof(loff_t));
- filp->f_pos += (loff_t)(*lenp);
return 0;
}
* proc_dointvec - read a vector of integers
* @table: the sysctl table
* @write: %TRUE if this is a write to the sysctl file
- * @filp: the file structure
* @buffer: the user buffer
* @lenp: the size of the user buffer
*
*
* Returns 0 on success.
*/
-int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
+int proc_dointvec(struct ctl_table *table, int write,
void *buffer, size_t *lenp)
{
- return do_proc_dointvec(table,write,filp,buffer,lenp,1,OP_SET);
+ return do_proc_dointvec(table,write,buffer,lenp,1,OP_SET);
}
* proc_dostring - read a string sysctl
* @table: the sysctl table
* @write: %TRUE if this is a write to the sysctl file
- * @filp: the file structure
* @buffer: the user buffer
* @lenp: the size of the user buffer
*
*
* Returns 0 on success.
*/
-int proc_dostring(struct ctl_table *table, int write, struct file *filp,
+int proc_dostring(struct ctl_table *table, int write,
void *buffer, size_t *lenp)
{
size_t len;
char *p, c;
if (!table->data || !table->maxlen || !*lenp ||
- (filp->f_pos && !write)) {
+ (!write)) {
*lenp = 0;
return 0;
}
if (copy_from_user(table->data, buffer, len))
return -EFAULT;
((char *) table->data)[len] = 0;
- filp->f_pos += *lenp;
} else {
len = (size_t)strlen(table->data);
if (len > (size_t)table->maxlen)
len++;
}
*lenp = len;
- filp->f_pos += len;
}
return 0;
}
int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
- cfs_list_t *tmp;
+ struct list_head *tmp;
if (nlen <= 0 || nlen >= CTL_MAXNAME)
return -ENOTDIR;
tmp = &root_table_header.ctl_entry;
do {
struct ctl_table_header *head =
- cfs_list_entry(tmp, struct ctl_table_header, ctl_entry);
+ list_entry(tmp, struct ctl_table_header, ctl_entry);
void *context = NULL;
int error = parse_table(name, nlen, oldval, oldlenp,
newval, newlen, head->ctl_table,
return NULL;
tmp->ctl_table = table;
- CFS_INIT_LIST_HEAD(&tmp->ctl_entry);
- cfs_list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry);
+ INIT_LIST_HEAD(&tmp->ctl_entry);
+ list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry);
#ifdef CONFIG_PROC_FS
register_proc_table(table, cfs_proc_sys);
#endif
*/
void unregister_sysctl_table(struct ctl_table_header * header)
{
- cfs_list_del(&header->ctl_entry);
+ list_del(&header->ctl_entry);
#ifdef CONFIG_PROC_FS
unregister_proc_table(header->ctl_table, cfs_proc_sys);
#endif
}
EXPORT_SYMBOL(seq_puts);
-cfs_list_t *seq_list_start(cfs_list_t *head, loff_t pos)
+struct list_head *seq_list_start(struct list_head *head, loff_t pos)
{
- cfs_list_t *lh;
+ struct list_head *lh;
- cfs_list_for_each(lh, head)
+ list_for_each(lh, head)
if (pos-- == 0)
return lh;
EXPORT_SYMBOL(seq_list_start);
-cfs_list_t *seq_list_start_head(cfs_list_t *head,
+struct list_head *seq_list_start_head(struct list_head *head,
loff_t pos)
{
if (!pos)
EXPORT_SYMBOL(seq_list_start_head);
-cfs_list_t *seq_list_next(void *v, cfs_list_t *head,
+struct list_head *seq_list_next(void *v, struct list_head *head,
loff_t *ppos)
{
- cfs_list_t *lh;
+ struct list_head *lh;
- lh = ((cfs_list_t *)v)->next;
+ lh = ((struct list_head *)v)->next;
++*ppos;
return lh == head ? NULL : lh;
}