Whamcloud - gitweb
LU-5427 lbuild: Fix compilation with MPSS 3.3
[fs/lustre-release.git] / libcfs / libcfs / winnt / winnt-proc.c
index 33ec3aa..6364371 100644 (file)
@@ -83,8 +83,8 @@ spinlock_t                    proc_fs_lock;
 struct mutex                           proc_fs_lock;
 
 #define INIT_PROCFS_LOCK()      cfs_init_mutex(&proc_fs_lock)
-#define LOCK_PROCFS()           cfs_mutex_down(&proc_fs_lock)
-#define UNLOCK_PROCFS()         cfs_mutex_up(&proc_fs_lock)
+#define LOCK_PROCFS()           mutex_lock(&proc_fs_lock)
+#define UNLOCK_PROCFS()         mutex_unlock(&proc_fs_lock)
 
 #endif
 
@@ -787,7 +787,7 @@ int proc_init_fs()
     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),
@@ -1055,7 +1055,7 @@ unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
 #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;
@@ -1162,8 +1162,6 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil
     if (write && first)
         return -EINVAL;
     *lenp -= left;
-    memset(&(filp->f_pos) , 0, sizeof(loff_t));
-    filp->f_pos += (loff_t)(*lenp);
     return 0;
 }
 
@@ -1171,7 +1169,6 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil
  * 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
  *
@@ -1180,10 +1177,10 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil
  *
  * 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);
 }
 
 
@@ -1191,7 +1188,6 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
  * 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
  *
@@ -1204,14 +1200,14 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
  *
  * 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;
     }
@@ -1231,7 +1227,6 @@ int proc_dostring(struct ctl_table *table, int write, struct file *filp,
        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)
@@ -1247,7 +1242,6 @@ int proc_dostring(struct ctl_table *table, int write, struct file *filp,
             len++;
         }
         *lenp = len;
-        filp->f_pos += len;
     }
     return 0;
 }
@@ -1345,7 +1339,7 @@ repeat:
 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;
@@ -1357,7 +1351,7 @@ int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
     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,
@@ -1449,8 +1443,8 @@ register_sysctl_table(struct ctl_table *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
@@ -1466,7 +1460,7 @@ register_sysctl_table(struct ctl_table *table)
  */
 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
@@ -2270,11 +2264,11 @@ int seq_puts(struct seq_file *m, const char *s)
 }
 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;
 
@@ -2283,7 +2277,7 @@ cfs_list_t *seq_list_start(cfs_list_t *head, loff_t pos)
 
 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)
@@ -2294,12 +2288,12 @@ cfs_list_t *seq_list_start_head(cfs_list_t *head,
 
 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;
 }