This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / kernel / sysctl.c
index d5c21ca..b77eb0a 100644 (file)
@@ -137,7 +137,7 @@ extern int sysctl_hz_timer;
 #if defined(CONFIG_PPC32) && defined(CONFIG_6xx)
 extern unsigned long powersave_nap;
 int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos);
+                 void *buffer, size_t *lenp);
 #endif
 
 #ifdef CONFIG_BSD_PROCESS_ACCT
@@ -147,7 +147,7 @@ extern int acct_parm[];
 static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t,
                       ctl_table *, void **);
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos);
+                 void __user *buffer, size_t *lenp);
 
 static ctl_table root_table[];
 static struct ctl_table_header root_table_header =
@@ -167,8 +167,6 @@ extern ctl_table random_table[];
 extern ctl_table pty_table[];
 #endif
 
-int sysctl_legacy_va_layout;
-
 /* /proc declarations: */
 
 #ifdef CONFIG_PROC_FS
@@ -349,7 +347,7 @@ static ctl_table kern_table[] = {
                .procname       = "tainted",
                .data           = &tainted,
                .maxlen         = sizeof(int),
-               .mode           = 0444,
+               .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
        {
@@ -850,16 +848,6 @@ static ctl_table vm_table[] = {
                .strategy       = &sysctl_intvec,
                .extra1         = &zero,
        },
-       {
-               .ctl_name       = VM_LEGACY_VA_LAYOUT,
-               .procname       = "legacy_va_layout",
-               .data           = &sysctl_legacy_va_layout,
-               .maxlen         = sizeof(sysctl_legacy_va_layout),
-               .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
-               .extra1         = &zero,
-       },
        { .ctl_name = 0 }
 };
 
@@ -1358,7 +1346,11 @@ static ssize_t do_rw_proc(int write, struct file * file, char __user * buf,
        
        res = count;
 
-       error = (*table->proc_handler) (table, write, file, buf, &res, ppos);
+       /*
+        * FIXME: we need to pass on ppos to the handler.
+        */
+
+       error = (*table->proc_handler) (table, write, file, buf, &res);
        if (error)
                return error;
        return res;
@@ -1408,14 +1400,14 @@ static ssize_t proc_writesys(struct file * file, const char __user * buf,
  * Returns 0 on success.
  */
 int proc_dostring(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos)
+                 void __user *buffer, size_t *lenp)
 {
        size_t len;
        char __user *p;
        char c;
        
        if (!table->data || !table->maxlen || !*lenp ||
-           (*ppos && !write)) {
+           (filp->f_pos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -1435,7 +1427,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
                if(copy_from_user(table->data, buffer, len))
                        return -EFAULT;
                ((char *) table->data)[len] = 0;
-               *ppos += *lenp;
+               filp->f_pos += *lenp;
        } else {
                len = strlen(table->data);
                if (len > table->maxlen)
@@ -1451,7 +1443,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
                        len++;
                }
                *lenp = len;
-               *ppos += len;
+               filp->f_pos += len;
        }
        return 0;
 }
@@ -1462,17 +1454,17 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
  */
  
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos)
+                 void __user *buffer, size_t *lenp)
 {
        int r;
 
        if (!write) {
                down_read(&uts_sem);
-               r=proc_dostring(table,0,filp,buffer,lenp, ppos);
+               r=proc_dostring(table,0,filp,buffer,lenp);
                up_read(&uts_sem);
        } else {
                down_write(&uts_sem);
-               r=proc_dostring(table,1,filp,buffer,lenp, ppos);
+               r=proc_dostring(table,1,filp,buffer,lenp);
                up_write(&uts_sem);
        }
        return r;
@@ -1498,12 +1490,12 @@ static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp,
 }
 
 static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos,
+                 void __user *buffer, size_t *lenp, 
                  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
                              int write, void *data),
                  void *data)
 {
-#define TMPBUFLEN 21
+#define TMPBUFLEN 20
        int *i, vleft, first=1, neg, val;
        unsigned long lval;
        size_t left, len;
@@ -1512,7 +1504,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
        char __user *s = buffer;
        
        if (!table->data || !table->maxlen || !*lenp ||
-           (*ppos && !write)) {
+           (filp->f_pos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -1601,7 +1593,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
        if (write && first)
                return -EINVAL;
        *lenp -= left;
-       *ppos += *lenp;
+       filp->f_pos += *lenp;
        return 0;
 #undef TMPBUFLEN
 }
@@ -1620,9 +1612,9 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
  * Returns 0 on success.
  */
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-                    void __user *buffer, size_t *lenp, loff_t *ppos)
+                    void __user *buffer, size_t *lenp)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,
                            NULL,NULL);
 }
 
@@ -1668,7 +1660,7 @@ static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp,
  */
  
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-                       void __user *buffer, size_t *lenp, loff_t *ppos)
+                       void __user *buffer, size_t *lenp)
 {
        int op;
 
@@ -1677,7 +1669,7 @@ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
        }
 
        op = (current->pid == 1) ? OP_SET : OP_AND;
-       return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
+       return do_proc_dointvec(table,write,filp,buffer,lenp,
                                do_proc_dointvec_bset_conv,&op);
 }
 
@@ -1727,24 +1719,23 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp,
  * Returns 0 on success.
  */
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos)
+                 void __user *buffer, size_t *lenp)
 {
        struct do_proc_dointvec_minmax_conv_param param = {
                .min = (int *) table->extra1,
                .max = (int *) table->extra2,
        };
-       return do_proc_dointvec(table, write, filp, buffer, lenp, ppos,
+       return do_proc_dointvec(table, write, filp, buffer, lenp,
                                do_proc_dointvec_minmax_conv, &param);
 }
 
 static int do_proc_doulongvec_minmax(ctl_table *table, int write,
                                     struct file *filp,
-                                    void __user *buffer,
-                                    size_t *lenp, loff_t *ppos,
+                                    void __user *buffer, size_t *lenp,
                                     unsigned long convmul,
                                     unsigned long convdiv)
 {
-#define TMPBUFLEN 21
+#define TMPBUFLEN 20
        unsigned long *i, *min, *max, val;
        int vleft, first=1, neg;
        size_t len, left;
@@ -1752,7 +1743,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
        char __user *s = buffer;
        
        if (!table->data || !table->maxlen || !*lenp ||
-           (*ppos && !write)) {
+           (filp->f_pos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -1837,7 +1828,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
        if (write && first)
                return -EINVAL;
        *lenp -= left;
-       *ppos += *lenp;
+       filp->f_pos += *lenp;
        return 0;
 #undef TMPBUFLEN
 }
@@ -1859,9 +1850,9 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
  * Returns 0 on success.
  */
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-                          void __user *buffer, size_t *lenp, loff_t *ppos)
+                          void __user *buffer, size_t *lenp)
 {
-    return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos, 1l, 1l);
+    return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, 1l, 1l);
 }
 
 /**
@@ -1883,11 +1874,10 @@ int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
  */
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
                                      struct file *filp,
-                                     void __user *buffer,
-                                     size_t *lenp, loff_t *ppos)
+                                     void __user *buffer, size_t *lenp)
 {
     return do_proc_doulongvec_minmax(table, write, filp, buffer,
-                                    lenp, ppos, HZ, 1000l);
+                                    lenp, HZ, 1000l);
 }
 
 
@@ -1949,9 +1939,9 @@ static int do_proc_dointvec_userhz_jiffies_conv(int *negp, unsigned long *lvalp,
  * Returns 0 on success.
  */
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-                         void __user *buffer, size_t *lenp, loff_t *ppos)
+                         void __user *buffer, size_t *lenp)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,
                            do_proc_dointvec_jiffies_conv,NULL);
 }
 
@@ -1971,66 +1961,65 @@ int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
  * Returns 0 on success.
  */
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-                                void __user *buffer, size_t *lenp, loff_t *ppos)
+                                void __user *buffer, size_t *lenp)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,
                            do_proc_dointvec_userhz_jiffies_conv,NULL);
 }
 
 #else /* CONFIG_PROC_FS */
 
 int proc_dostring(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos)
+                 void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-                           void __user *buffer, size_t *lenp, loff_t *ppos)
+                           void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos)
+                 void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-                       void __user *buffer, size_t *lenp, loff_t *ppos)
+                       void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp, loff_t *ppos)
+                   void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp, loff_t *ppos)
+                   void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp, loff_t *ppos)
+                   void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp, loff_t *ppos)
+                   void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
                                      struct file *filp,
-                                     void __user *buffer,
-                                     size_t *lenp, loff_t *ppos)
+                                     void __user *buffer, size_t *lenp)
 {
     return -ENOSYS;
 }
@@ -2181,51 +2170,50 @@ int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
 }
 
 int proc_dostring(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos)
+                 void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp, loff_t *ppos)
+                 void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-                       void __user *buffer, size_t *lenp, loff_t *ppos)
+                       void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp, loff_t *ppos)
+                   void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-                         void __user *buffer, size_t *lenp, loff_t *ppos)
+                         void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-                         void __user *buffer, size_t *lenp, loff_t *ppos)
+                         void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp, loff_t *ppos)
+                   void __user *buffer, size_t *lenp)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
                                      struct file *filp,
-                                     void __user *buffer,
-                                     size_t *lenp, loff_t *ppos)
+                                     void __user *buffer, size_t *lenp)
 {
     return -ENOSYS;
 }