]> git.hungrycats.org Git - linux/commitdiff
Make sysctl pass the pos pointer around properly.
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 7 Aug 2004 16:43:47 +0000 (09:43 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 7 Aug 2004 16:43:47 +0000 (09:43 -0700)
Nobody ever fixed the big FIXME in sysctl - but we really need
to pass around the proper "loff_t *" to all the sysctl functions
if we want them to be well-behaved wrt the file pointer position.

This is all preparation for making direct f_pos accesses go
away.

33 files changed:
arch/ppc/kernel/ppc_htab.c
arch/s390/appldata/appldata_base.c
arch/s390/mm/cmm.c
drivers/cdrom/cdrom.c
drivers/char/random.c
drivers/cpufreq/cpufreq_userspace.c
drivers/net/wireless/arlan-proc.c
drivers/parport/procfs.c
fs/coda/sysctl.c
fs/xfs/linux-2.6/xfs_sysctl.c
include/linux/coda_proc.h
include/linux/hugetlb.h
include/linux/mmzone.h
include/linux/sysctl.h
include/linux/writeback.h
include/net/ip.h
include/net/ndisc.h
kernel/sysctl.c
mm/hugetlb.c
mm/page-writeback.c
mm/page_alloc.c
net/bridge/br_netfilter.c
net/decnet/dn_dev.c
net/decnet/sysctl_net_decnet.c
net/ipv4/devinet.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv6/addrconf.c
net/ipv6/ndisc.c
net/ipv6/route.c
net/irda/irsysctl.c
net/sunrpc/sysctl.c

index 29ff57bbab5486e50307d9d132ac95a5fc436242..91592c03ea8bb18eee5ccbf76eef6c5d72ae0dbf 100644 (file)
@@ -35,7 +35,7 @@ static int ppc_htab_show(struct seq_file *m, void *v);
 static ssize_t ppc_htab_write(struct file * file, const char __user * buffer,
                              size_t count, loff_t *ppos);
 int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp);
+                 void __user *buffer, size_t *lenp, loff_t *ppos);
 
 extern PTE *Hash, *Hash_end;
 extern unsigned long Hash_size, Hash_mask;
@@ -320,7 +320,7 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
 }
 
 int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer_arg, size_t *lenp)
+                 void __user *buffer_arg, size_t *lenp, loff_t *ppos)
 {
        int vleft, first=1, len, left, val;
        char __user *buffer = (char __user *) buffer_arg;
@@ -344,7 +344,7 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
        if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
                return -EFAULT;
 
-       if ( /*!table->maxlen ||*/ (filp->f_pos && !write)) {
+       if ( /*!table->maxlen ||*/ (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -435,6 +435,6 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
        if (write && first)
                return -EINVAL;
        *lenp -= left;
-       filp->f_pos += *lenp;
+       *ppos += *lenp;
        return 0;
 }
index 1395840ba98f7d3a03d6e49ca99ee572d2553ffd..3589f48ded47520b9de50b523b302d3e8187838c 100644 (file)
@@ -88,11 +88,11 @@ struct appldata_parameter_list {
  */
 static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
 static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
-                                 void __user *buffer, size_t *lenp);
+                                 void __user *buffer, size_t *lenp, loff_t *ppos);
 static int appldata_interval_handler(ctl_table *ctl, int write,
                                         struct file *filp,
                                         void __user *buffer,
-                                        size_t *lenp);
+                                        size_t *lenp, loff_t *ppos);
 
 static struct ctl_table_header *appldata_sysctl_header;
 static struct ctl_table appldata_table[] = {
@@ -315,12 +315,12 @@ __appldata_vtimer_setup(int cmd)
  */
 static int
 appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
-                          void __user *buffer, size_t *lenp)
+                          void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int len;
        char buf[2];
 
-       if (!*lenp || filp->f_pos) {
+       if (!*lenp || *ppos) {
                *lenp = 0;
                return 0;
        }
@@ -343,7 +343,7 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
        spin_unlock(&appldata_timer_lock);
 out:
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
        return 0;
 }
 
@@ -355,12 +355,12 @@ out:
  */
 static int
 appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
-                          void __user *buffer, size_t *lenp)
+                          void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int len, interval;
        char buf[16];
 
-       if (!*lenp || filp->f_pos) {
+       if (!*lenp || *ppos) {
                *lenp = 0;
                return 0;
        }
@@ -391,7 +391,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
                 interval);
 out:
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
        return 0;
 }
 
@@ -403,7 +403,7 @@ out:
  */
 static int
 appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
-                          void __user *buffer, size_t *lenp)
+                          void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        struct appldata_ops *ops = NULL, *tmp_ops;
        int rc, len, found;
@@ -429,7 +429,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
        }
        spin_unlock_bh(&appldata_ops_lock);
 
-       if (!*lenp || filp->f_pos) {
+       if (!*lenp || *ppos) {
                *lenp = 0;
                module_put(ops->owner);
                return 0;
@@ -488,7 +488,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
        spin_unlock_bh(&appldata_ops_lock);
 out:
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
        module_put(ops->owner);
        return 0;
 }
index 170da71fa2ff3c380da6bfa9cfdb1da41f7e9137..cb29503010616dc3afbe66074df8eb853ab238d9 100644 (file)
@@ -256,13 +256,13 @@ static struct ctl_table cmm_table[];
 
 static int
 cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
-                 void *buffer, size_t *lenp)
+                 void *buffer, size_t *lenp, loff_t *ppos)
 {
        char buf[16], *p;
        long pages;
        int len;
 
-       if (!*lenp || (filp->f_pos && !write)) {
+       if (!*lenp || (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -291,19 +291,19 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
                        return -EFAULT;
        }
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
        return 0;
 }
 
 static int
 cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
-                   void *buffer, size_t *lenp)
+                   void *buffer, size_t *lenp, loff_t *ppos)
 {
        char buf[64], *p;
        long pages, seconds;
        int len;
 
-       if (!*lenp || (filp->f_pos && !write)) {
+       if (!*lenp || (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -328,7 +328,7 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
                        return -EFAULT;
        }
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
        return 0;
 }
 
index bfdc4d24a2c718e4695a292a20fbbac0b066e1ba..360d4b64a42e535ea83e8a60165b46a51b0bfdc6 100644 (file)
@@ -2933,13 +2933,13 @@ struct cdrom_sysctl_settings {
 } cdrom_sysctl_settings;
 
 int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
-                           void __user *buffer, size_t *lenp)
+                           void __user *buffer, size_t *lenp, loff_t *ppos)
 {
         int pos;
        struct cdrom_device_info *cdi;
        char *info = cdrom_sysctl_settings.info;
        
-       if (!*lenp || (filp->f_pos && !write)) {
+       if (!*lenp || (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -3028,7 +3028,7 @@ int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
 
        strcpy(info+pos,"\n\n");
                
-        return proc_dostring(ctl, write, filp, buffer, lenp);
+        return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 }
 
 /* Unfortunately, per device settings are not implemented through
@@ -3060,13 +3060,13 @@ void cdrom_update_settings(void)
 }
 
 static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
-                               void __user *buffer, size_t *lenp)
+                               void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int *valp = ctl->data;
        int val = *valp;
        int ret;
        
-       ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+       ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
        if (write && *valp != val) {
        
index f51b541120e259e1cfb3cc9c339fcf7f36b36830..a86545f32d631b5e89a8cf05cf1f2f1fa71de3d3 100644 (file)
@@ -1894,13 +1894,13 @@ static int change_poolsize(int poolsize)
 }
 
 static int proc_do_poolsize(ctl_table *table, int write, struct file *filp,
-                           void __user *buffer, size_t *lenp)
+                           void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int     ret;
 
        sysctl_poolsize = random_state->poolinfo.POOLBYTES;
 
-       ret = proc_dointvec(table, write, filp, buffer, lenp);
+       ret = proc_dointvec(table, write, filp, buffer, lenp, ppos);
        if (ret || !write ||
            (sysctl_poolsize == random_state->poolinfo.POOLBYTES))
                return ret;
@@ -1945,7 +1945,7 @@ static int poolsize_strategy(ctl_table *table, int __user *name, int nlen,
  * sysctl system call, it is returned as 16 bytes of binary data.
  */
 static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
-                       void __user *buffer, size_t *lenp)
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        ctl_table       fake_table;
        unsigned char   buf[64], tmp_uuid[16], *uuid;
@@ -1967,7 +1967,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
        fake_table.data = buf;
        fake_table.maxlen = sizeof(buf);
 
-       return proc_dostring(&fake_table, write, filp, buffer, lenp);
+       return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos);
 }
 
 static int uuid_strategy(ctl_table *table, int __user *name, int nlen,
index 5102144709559f351faa672c6b257fddfcc4a2d7..161e8a27c6c56a1b96b18c82d70e9587e01746f9 100644 (file)
@@ -151,13 +151,13 @@ EXPORT_SYMBOL_GPL(cpufreq_setmax);
 /*********************** cpufreq_sysctl interface ********************/
 static int
 cpufreq_procctl(ctl_table *ctl, int write, struct file *filp,
-               void __user *buffer, size_t *lenp)
+               void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        char buf[16], *p;
        int cpu = (long) ctl->extra1;
        unsigned int len, left = *lenp;
 
-       if (!left || (filp->f_pos && !write) || !cpu_online(cpu)) {
+       if (!left || (*ppos && !write) || !cpu_online(cpu)) {
                *lenp = 0;
                return 0;
        }
@@ -183,7 +183,7 @@ cpufreq_procctl(ctl_table *ctl, int write, struct file *filp,
        }
 
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
        return 0;
 }
 
index b2e01523cb2b6a44b021ba3ad388ba2b5115f816..86da31cac5eeae555e0f921a628705b9c7af5b20 100644 (file)
@@ -399,7 +399,7 @@ static int arlan_setup_card_by_book(struct net_device *dev)
 static char arlan_drive_info[ARLAN_STR_SIZE] = "A655\n\0";
 
 static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
-                     void __user *buffer, size_t * lenp)
+                     void __user *buffer, size_t * lenp, loff_t *ppos)
 {
        int i;
        int retv, pos, devnum;
@@ -625,7 +625,7 @@ final:
        *lenp = pos;
 
        if (!write)
-               retv = proc_dostring(ctl, write, filp, buffer, lenp);
+               retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
        else
        {
                *lenp = 0;
@@ -636,7 +636,7 @@ final:
 
 
 static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp,
-                           void __user *buffer, size_t * lenp)
+                           void __user *buffer, size_t * lenp, loff_t *ppos)
 {
        int i;
        int retv, pos, devnum;
@@ -665,12 +665,12 @@ static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp
 
 final:
        *lenp = pos;
-       retv = proc_dostring(ctl, write, filp, buffer, lenp);
+       retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
        return retv;
 }
 
 static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp,
-                           void __user *buffer, size_t * lenp)
+                           void __user *buffer, size_t * lenp, loff_t *ppos)
 {
        int i;
        int retv, pos, devnum;
@@ -694,12 +694,12 @@ static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp
        SARLBNpln(u_char, txBuffer, 0x800);
 final:
        *lenp = pos;
-       retv = proc_dostring(ctl, write, filp, buffer, lenp);
+       retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
        return retv;
 }
 
 static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp,
-                           void __user *buffer, size_t * lenp)
+                           void __user *buffer, size_t * lenp, loff_t *ppos)
 {
        int i;
        int retv, pos, devnum;
@@ -722,12 +722,12 @@ static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp
        SARLBNpln(u_char, rxBuffer, 0x800);
 final:
        *lenp = pos;
-       retv = proc_dostring(ctl, write, filp, buffer, lenp);
+       retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
        return retv;
 }
 
 static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
-                       void __user *buffer, size_t * lenp)
+                       void __user *buffer, size_t * lenp, loff_t *ppos)
 {
        int i;
        int retv, pos, devnum;
@@ -752,7 +752,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
 
 final:
        *lenp = pos;
-       retv = proc_dostring(ctl, write, filp, buffer, lenp);
+       retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
        return retv;
 }
 
@@ -763,7 +763,7 @@ final:
 static char conf_reset_result[200];
 
 static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
-                   void __user *buffer, size_t * lenp)
+                   void __user *buffer, size_t * lenp, loff_t *ppos)
 {
        int pos = 0;
        int devnum = ctl->procname[6] - '0';
@@ -784,11 +784,11 @@ static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
                return -1;
 
        *lenp = pos;
-       return proc_dostring(ctl, write, filp, buffer, lenp);
+       return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 }
 
 static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
-                      void __user *buffer, size_t * lenp)
+                      void __user *buffer, size_t * lenp, loff_t *ppos)
 {
        int pos = 0;
        int devnum = ctl->procname[5] - '0';
@@ -807,7 +807,7 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
        } else
                return -1;
        *lenp = pos + 3;
-       return proc_dostring(ctl, write, filp, buffer, lenp);
+       return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 }
 
 
index afa6ac45a5dab1cefb4f78edfae6d552f93e4b46..061097fd811738551d0b4f56c5ced80e34dca626 100644 (file)
@@ -33,7 +33,7 @@
 #define PARPORT_MAX_SPINTIME_VALUE 1000
 
 static int do_active_device(ctl_table *table, int write, struct file *filp,
-                     void __user *result, size_t *lenp)
+                     void __user *result, size_t *lenp, loff_t *ppos)
 {
        struct parport *port = (struct parport *)table->extra1;
        char buffer[256];
@@ -43,7 +43,7 @@ static int do_active_device(ctl_table *table, int write, struct file *filp,
        if (write)              /* can't happen anyway */
                return -EACCES;
 
-       if (filp->f_pos) {
+       if (*ppos) {
                *lenp = 0;
                return 0;
        }
@@ -63,14 +63,14 @@ static int do_active_device(ctl_table *table, int write, struct file *filp,
        else
                *lenp = len;
 
-       filp->f_pos += len;
+       *ppos += len;
 
        return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 #ifdef CONFIG_PARPORT_1284
 static int do_autoprobe(ctl_table *table, int write, struct file *filp,
-                       void __user *result, size_t *lenp)
+                       void __user *result, size_t *lenp, loff_t *ppos)
 {
        struct parport_device_info *info = table->extra2;
        const char *str;
@@ -80,7 +80,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
        if (write) /* permissions stop this */
                return -EACCES;
 
-       if (filp->f_pos) {
+       if (*ppos) {
                *lenp = 0;
                return 0;
        }
@@ -105,7 +105,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
        else
                *lenp = len;
 
-       filp->f_pos += len;
+       *ppos += len;
 
        return copy_to_user (result, buffer, len) ? -EFAULT : 0;
 }
@@ -113,13 +113,13 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
 
 static int do_hardware_base_addr (ctl_table *table, int write,
                                  struct file *filp, void __user *result,
-                                 size_t *lenp)
+                                 size_t *lenp, loff_t *ppos)
 {
        struct parport *port = (struct parport *)table->extra1;
        char buffer[20];
        int len = 0;
 
-       if (filp->f_pos) {
+       if (*ppos) {
                *lenp = 0;
                return 0;
        }
@@ -134,20 +134,20 @@ static int do_hardware_base_addr (ctl_table *table, int write,
        else
                *lenp = len;
 
-       filp->f_pos += len;
+       *ppos += len;
 
        return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 static int do_hardware_irq (ctl_table *table, int write,
                            struct file *filp, void __user *result,
-                           size_t *lenp)
+                           size_t *lenp, loff_t *ppos)
 {
        struct parport *port = (struct parport *)table->extra1;
        char buffer[20];
        int len = 0;
 
-       if (filp->f_pos) {
+       if (*ppos) {
                *lenp = 0;
                return 0;
        }
@@ -162,20 +162,20 @@ static int do_hardware_irq (ctl_table *table, int write,
        else
                *lenp = len;
 
-       filp->f_pos += len;
+       *ppos += len;
 
        return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 static int do_hardware_dma (ctl_table *table, int write,
                            struct file *filp, void __user *result,
-                           size_t *lenp)
+                           size_t *lenp, loff_t *ppos)
 {
        struct parport *port = (struct parport *)table->extra1;
        char buffer[20];
        int len = 0;
 
-       if (filp->f_pos) {
+       if (*ppos) {
                *lenp = 0;
                return 0;
        }
@@ -190,20 +190,20 @@ static int do_hardware_dma (ctl_table *table, int write,
        else
                *lenp = len;
 
-       filp->f_pos += len;
+       *ppos += len;
 
        return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 static int do_hardware_modes (ctl_table *table, int write,
                              struct file *filp, void __user *result,
-                             size_t *lenp)
+                             size_t *lenp, loff_t *ppos)
 {
        struct parport *port = (struct parport *)table->extra1;
        char buffer[40];
        int len = 0;
 
-       if (filp->f_pos) {
+       if (*ppos) {
                *lenp = 0;
                return 0;
        }
@@ -229,7 +229,7 @@ static int do_hardware_modes (ctl_table *table, int write,
        else
                *lenp = len;
 
-       filp->f_pos += len;
+       *ppos += len;
 
        return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
index 60fc6f9ce2404cb5c6cc22b99be6f7506cafdeef..fd98626ba280cbfc84f5eb089746dd157e78da02 100644 (file)
@@ -69,12 +69,12 @@ void reset_coda_cache_inv_stats( void )
 }
 
 int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
-                            void __user * buffer, size_t * lenp )
+                            void __user * buffer, size_t * lenp, loff_t * ppos )
 {
        if ( write ) {
                reset_coda_vfs_stats();
 
-               filp->f_pos += *lenp;
+               *ppos += *lenp;
        } else {
                *lenp = 0;
        }
@@ -84,12 +84,12 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
 
 int do_reset_coda_cache_inv_stats( ctl_table * table, int write, 
                                   struct file * filp, void __user * buffer, 
-                                  size_t * lenp )
+                                  size_t * lenp, loff_t * ppos )
 {
        if ( write ) {
                reset_coda_cache_inv_stats();
 
-               filp->f_pos += *lenp;
+               *ppos += *lenp;
        } else {
                *lenp = 0;
        }
index 570d1a942507ad72fc881bbdb1c1e232a5f354b1..4a173d3d8916bd12166af53371585ce2cb3e5100 100644 (file)
@@ -46,12 +46,13 @@ xfs_stats_clear_proc_handler(
        int             write,
        struct file     *filp,
        void            *buffer,
-       size_t          *lenp)
+       size_t          *lenp,
+       loff_t          *ppos)
 {
        int             c, ret, *valp = ctl->data;
        __uint32_t      vn_active;
 
-       ret = proc_dointvec_minmax(ctl, write, filp, buffer, lenp);
+       ret = proc_dointvec_minmax(ctl, write, filp, buffer, lenp, ppos);
 
        if (!ret && write && *valp) {
                printk("XFS Clearing xfsstats\n");
index 5bf75216379037e4c23f681509f451699228d91a..c061a22ed86d5153cde5fc8ffba84f3cbcfedd2c 100644 (file)
@@ -82,10 +82,10 @@ void reset_coda_cache_inv_stats( void );
  * data structure for /proc/sys/... files 
  */
 int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
-                            void __user * buffer, size_t * lenp );
+                            void __user * buffer, size_t * lenp, loff_t * ppos );
 int do_reset_coda_cache_inv_stats( ctl_table * table, int write, 
                                   struct file * filp, void __user * buffer, 
-                                  size_t * lenp );
+                                  size_t * lenp, loff_t * ppos );
 
 /* these functions are called to form the content of /proc/fs/coda/... files */
 int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset,
index 5e578c036157af3b55dc98342f31af9ae1e3293c..954af9d82768c16e5db6c75e988e8c4c73d53085 100644 (file)
@@ -12,7 +12,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
        return vma->vm_flags & VM_HUGETLB;
 }
 
-int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *);
+int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
 int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
 int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
 void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
index 8958b0e6af06d1d189e3c06cb5a966de106a254b..8a23709fe18a0ec41e7ef550144a260c9679ba07 100644 (file)
@@ -374,9 +374,9 @@ static inline int is_normal(struct zone *zone)
 struct ctl_table;
 struct file;
 int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, 
-                                       void __user *, size_t *);
+                                       void __user *, size_t *, loff_t *);
 int lower_zone_protection_sysctl_handler(struct ctl_table *, int, struct file *,
-                                       void __user *, size_t *);
+                                       void __user *, size_t *, loff_t *);
 
 #include <linux/topology.h>
 /* Returns the number of the current Node. */
index 38acd5d4b691935ef52c37e82a179895a204e48e..70ac59e6a41f112b28b4766f2eb8c95e58c4f374 100644 (file)
@@ -762,24 +762,24 @@ typedef int ctl_handler (ctl_table *table, int __user *name, int nlen,
                         void **context);
 
 typedef int proc_handler (ctl_table *ctl, int write, struct file * filp,
-                         void __user *buffer, size_t *lenp);
+                         void __user *buffer, size_t *lenp, loff_t *ppos);
 
 extern int proc_dostring(ctl_table *, int, struct file *,
-                        void __user *, size_t *);
+                        void __user *, size_t *, loff_t *);
 extern int proc_dointvec(ctl_table *, int, struct file *,
-                        void __user *, size_t *);
+                        void __user *, size_t *, loff_t *);
 extern int proc_dointvec_bset(ctl_table *, int, struct file *,
-                             void __user *, size_t *);
+                             void __user *, size_t *, loff_t *);
 extern int proc_dointvec_minmax(ctl_table *, int, struct file *,
-                               void __user *, size_t *);
+                               void __user *, size_t *, loff_t *);
 extern int proc_dointvec_jiffies(ctl_table *, int, struct file *,
-                                void __user *, size_t *);
+                                void __user *, size_t *, loff_t *);
 extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *,
-                                       void __user *, size_t *);
+                                       void __user *, size_t *, loff_t *);
 extern int proc_doulongvec_minmax(ctl_table *, int, struct file *,
-                                 void __user *, size_t *);
+                                 void __user *, size_t *, loff_t *);
 extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int,
-                                     struct file *, void __user *, size_t *);
+                                     struct file *, void __user *, size_t *, loff_t *);
 
 extern int do_sysctl (int __user *name, int nlen,
                      void __user *oldval, size_t __user *oldlenp,
index f557b55e8b0a8ef593d9f367f65e21ea6b8421d4..e4450070ac78529608e65cc27014e0d5be0f1eba 100644 (file)
@@ -86,7 +86,7 @@ extern int laptop_mode;
 struct ctl_table;
 struct file;
 int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *,
-                                     void __user *, size_t *);
+                                     void __user *, size_t *, loff_t *);
 
 void page_writeback_init(void);
 void balance_dirty_pages_ratelimited(struct address_space *mapping);
index 70bb6f887988a715572959323cafd509456eff3b..bacccde1c0788d988914503bcb4b5c35ed57a737 100644 (file)
@@ -301,7 +301,7 @@ extern int ipv4_proc_init(void);
  */
 int ipv4_doint_and_flush(ctl_table *ctl, int write,
                         struct file* filp, void __user *buffer,
-                        size_t *lenp);
+                        size_t *lenp, loff_t *ppos);
 int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
                                  void __user *oldval, size_t __user *oldlenp,
                                  void __user *newval, size_t newlen, 
index 95684d3363c1bec63ffe12f942e6ba09c1bb13f4..61d7033bca7fd8d8dcacbca3a1a7a24b924a2b9c 100644 (file)
@@ -103,7 +103,8 @@ extern int                  ndisc_ifinfo_sysctl_change(ctl_table *ctl,
                                                           int write,
                                                           struct file * filp,
                                                           void __user *buffer,
-                                                          size_t *lenp);
+                                                          size_t *lenp,
+                                                          loff_t *ppos);
 #endif
 
 extern void                    inet6_ifinfo_notify(int event,
index e7435ba0f35b15b2fbc6f8164da2b52c8883605a..2a643c00e9ad6cee17ed9ee0022709abf9489f4e 100644 (file)
@@ -123,7 +123,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);
+                 void __user *buffer, size_t *lenp, loff_t *ppos);
 
 static ctl_table root_table[];
 static struct ctl_table_header root_table_header =
@@ -1287,11 +1287,7 @@ static ssize_t do_rw_proc(int write, struct file * file, char __user * buf,
        
        res = count;
 
-       /*
-        * FIXME: we need to pass on ppos to the handler.
-        */
-
-       error = (*table->proc_handler) (table, write, file, buf, &res);
+       error = (*table->proc_handler) (table, write, file, buf, &res, ppos);
        if (error)
                return error;
        return res;
@@ -1341,14 +1337,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)
+                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        size_t len;
        char __user *p;
        char c;
        
        if (!table->data || !table->maxlen || !*lenp ||
-           (filp->f_pos && !write)) {
+           (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -1368,7 +1364,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;
-               filp->f_pos += *lenp;
+               *ppos += *lenp;
        } else {
                len = strlen(table->data);
                if (len > table->maxlen)
@@ -1384,7 +1380,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
                        len++;
                }
                *lenp = len;
-               filp->f_pos += len;
+               *ppos += len;
        }
        return 0;
 }
@@ -1395,17 +1391,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)
+                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int r;
 
        if (!write) {
                down_read(&uts_sem);
-               r=proc_dostring(table,0,filp,buffer,lenp);
+               r=proc_dostring(table,0,filp,buffer,lenp, ppos);
                up_read(&uts_sem);
        } else {
                down_write(&uts_sem);
-               r=proc_dostring(table,1,filp,buffer,lenp);
+               r=proc_dostring(table,1,filp,buffer,lenp, ppos);
                up_write(&uts_sem);
        }
        return r;
@@ -1431,7 +1427,7 @@ 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, 
+                 void __user *buffer, size_t *lenp, loff_t *ppos,
                  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
                              int write, void *data),
                  void *data)
@@ -1445,7 +1441,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
        char __user *s = buffer;
        
        if (!table->data || !table->maxlen || !*lenp ||
-           (filp->f_pos && !write)) {
+           (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -1534,7 +1530,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
        if (write && first)
                return -EINVAL;
        *lenp -= left;
-       filp->f_pos += *lenp;
+       *ppos += *lenp;
        return 0;
 #undef TMPBUFLEN
 }
@@ -1553,9 +1549,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)
+                    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
                            NULL,NULL);
 }
 
@@ -1601,7 +1597,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)
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int op;
 
@@ -1610,7 +1606,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,
+       return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
                                do_proc_dointvec_bset_conv,&op);
 }
 
@@ -1660,19 +1656,20 @@ 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)
+                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        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,
+       return do_proc_dointvec(table, write, filp, buffer, lenp, ppos,
                                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,
+                                    void __user *buffer,
+                                    size_t *lenp, loff_t *ppos,
                                     unsigned long convmul,
                                     unsigned long convdiv)
 {
@@ -1684,7 +1681,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
        char __user *s = buffer;
        
        if (!table->data || !table->maxlen || !*lenp ||
-           (filp->f_pos && !write)) {
+           (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -1769,7 +1766,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
        if (write && first)
                return -EINVAL;
        *lenp -= left;
-       filp->f_pos += *lenp;
+       *ppos += *lenp;
        return 0;
 #undef TMPBUFLEN
 }
@@ -1791,9 +1788,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)
+                          void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, 1l, 1l);
+    return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos, 1l, 1l);
 }
 
 /**
@@ -1815,10 +1812,11 @@ 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)
+                                     void __user *buffer,
+                                     size_t *lenp, loff_t *ppos)
 {
     return do_proc_doulongvec_minmax(table, write, filp, buffer,
-                                    lenp, HZ, 1000l);
+                                    lenp, ppos, HZ, 1000l);
 }
 
 
@@ -1880,9 +1878,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)
+                         void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
                            do_proc_dointvec_jiffies_conv,NULL);
 }
 
@@ -1902,65 +1900,66 @@ 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)
+                                void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
                            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)
+                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-                           void __user *buffer, size_t *lenp)
+                           void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp)
+                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-                       void __user *buffer, size_t *lenp)
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp)
+                   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp)
+                   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp)
+                   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp)
+                   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
                                      struct file *filp,
-                                     void __user *buffer, size_t *lenp)
+                                     void __user *buffer,
+                                     size_t *lenp, loff_t *ppos)
 {
     return -ENOSYS;
 }
@@ -2111,50 +2110,51 @@ 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)
+                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-                 void __user *buffer, size_t *lenp)
+                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-                       void __user *buffer, size_t *lenp)
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp)
+                   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-                         void __user *buffer, size_t *lenp)
+                         void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-                         void __user *buffer, size_t *lenp)
+                         void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-                   void __user *buffer, size_t *lenp)
+                   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
                                      struct file *filp,
-                                     void __user *buffer, size_t *lenp)
+                                     void __user *buffer,
+                                     size_t *lenp, loff_t *ppos)
 {
     return -ENOSYS;
 }
index 1c1cf7daceac1c0adc768bc6bf6a35ce4200537b..6c522e127033d5d630e22df9717fccc71e3dd02e 100644 (file)
@@ -191,9 +191,9 @@ static unsigned long set_max_huge_pages(unsigned long count)
 #ifdef CONFIG_SYSCTL
 int hugetlb_sysctl_handler(struct ctl_table *table, int write,
                           struct file *file, void __user *buffer,
-                          size_t *length)
+                          size_t *length, loff_t *ppos)
 {
-       proc_doulongvec_minmax(table, write, file, buffer, length);
+       proc_doulongvec_minmax(table, write, file, buffer, length, ppos);
        max_huge_pages = set_max_huge_pages(max_huge_pages);
        return 0;
 }
index a2aa511adf9a4fc05c8df1ff290b0a7414722c12..343998d46bb03344d27845a79b6c20096e1508ca 100644 (file)
@@ -399,9 +399,9 @@ static void wb_kupdate(unsigned long arg)
  * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs
  */
 int dirty_writeback_centisecs_handler(ctl_table *table, int write,
-               struct file *file, void __user *buffer, size_t *length)
+               struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
 {
-       proc_dointvec(table, write, file, buffer, length);
+       proc_dointvec(table, write, file, buffer, length, ppos);
        if (dirty_writeback_centisecs) {
                mod_timer(&wb_timer,
                        jiffies + (dirty_writeback_centisecs * HZ) / 100);
index 60522982ad3f92f8a994682a928ed062a6a9845f..6708f4f80b43567e9297b8e0f58fe56fde979f09 100644 (file)
@@ -1955,9 +1955,9 @@ module_init(init_per_zone_pages_min)
  *     changes.
  */
 int min_free_kbytes_sysctl_handler(ctl_table *table, int write, 
-               struct file *file, void __user *buffer, size_t *length)
+               struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
 {
-       proc_dointvec(table, write, file, buffer, length);
+       proc_dointvec(table, write, file, buffer, length, ppos);
        setup_per_zone_pages_min();
        setup_per_zone_protection();
        return 0;
@@ -1969,9 +1969,9 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
  *     whenever sysctl_lower_zone_protection changes.
  */
 int lower_zone_protection_sysctl_handler(ctl_table *table, int write,
-                struct file *file, void __user *buffer, size_t *length)
+                struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
 {
-       proc_dointvec_minmax(table, write, file, buffer, length);
+       proc_dointvec_minmax(table, write, file, buffer, length, ppos);
        setup_per_zone_protection();
        return 0;
 }
index 7313d06c93284e326c88862c8787d3312d86b6f1..404dda32b2f94483c9761154b4f7a0057374b4c7 100644 (file)
@@ -800,11 +800,11 @@ static struct nf_hook_ops br_nf_ops[] = {
 #ifdef CONFIG_SYSCTL
 static
 int brnf_sysctl_call_tables(ctl_table *ctl, int write, struct file * filp,
-                       void __user *buffer, size_t *lenp)
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int ret;
 
-       ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+       ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
        if (write && *(int *)(ctl->data))
                *(int *)(ctl->data) = 1;
index 6b6e49a9eb23d77193a3d7c039ce57a42cc8ad55..11b0f0c6d45ce9e5a23d7ca1fc4fdd63436ad4ef 100644 (file)
@@ -161,7 +161,7 @@ static int min_priority[1];
 static int max_priority[] = { 127 }; /* From DECnet spec */
 
 static int dn_forwarding_proc(ctl_table *, int, struct file *,
-                       void __user *, size_t *);
+                       void __user *, size_t *, loff_t *);
 static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
                        void __user *oldval, size_t __user *oldlenp,
                        void __user *newval, size_t newlen,
@@ -362,7 +362,8 @@ static void dn_dev_check_default(struct net_device *dev)
 
 static int dn_forwarding_proc(ctl_table *table, int write, 
                                struct file *filep,
-                               void __user *buffer, size_t *lenp)
+                               void __user *buffer,
+                               size_t *lenp, loff_t *ppos)
 {
 #ifdef CONFIG_DECNET_ROUTER
        struct net_device *dev = table->extra1;
@@ -376,7 +377,7 @@ static int dn_forwarding_proc(ctl_table *table, int write,
        dn_db = dev->dn_ptr;
        old = dn_db->parms.forwarding;
 
-       err = proc_dointvec(table, write, filep, buffer, lenp);
+       err = proc_dointvec(table, write, filep, buffer, lenp, ppos);
 
        if ((err >= 0) && write) {
                if (dn_db->parms.forwarding < 0)
index 65ce3bb9563bbe48cd5a8c3178693015a10880ee..02bca49cb5084b60c4779b6d5badab8dde35ac93 100644 (file)
@@ -162,13 +162,14 @@ static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen
 
 static int dn_node_address_handler(ctl_table *table, int write, 
                                struct file *filp,
-                               void __user *buffer, size_t *lenp)
+                               void __user *buffer,
+                               size_t *lenp, loff_t *ppos)
 {
        char addr[DN_ASCBUF_LEN];
        size_t len;
        dn_address dnaddr;
 
-       if (!*lenp || (filp->f_pos && !write)) {
+       if (!*lenp || (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -191,7 +192,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
 
                dn_dev_devices_on();
 
-               filp->f_pos += len;
+               *ppos += len;
 
                return 0;
        }
@@ -206,7 +207,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
                return -EFAULT;
 
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
 
        return 0;
 }
@@ -273,13 +274,14 @@ static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen,
 
 static int dn_def_dev_handler(ctl_table *table, int write, 
                                struct file * filp,
-                               void __user *buffer, size_t *lenp)
+                               void __user *buffer,
+                               size_t *lenp, loff_t *ppos)
 {
        size_t len;
        struct net_device *dev;
        char devname[17];
 
-       if (!*lenp || (filp->f_pos && !write)) {
+       if (!*lenp || (*ppos && !write)) {
                *lenp = 0;
                return 0;
        }
@@ -307,7 +309,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
                        dev_put(dev);
                        return -ENODEV;
                }
-               filp->f_pos += *lenp;
+               *ppos += *lenp;
 
                return 0;
        }
@@ -329,7 +331,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
                return -EFAULT;
 
        *lenp = len;
-       filp->f_pos += len;
+       *ppos += len;
 
        return 0;
 }
index 2dc4e7a8ade8265abb79757b1a1fafbb6304cd80..4781dea42dfec2d5076579855462763407a36892 100644 (file)
@@ -1151,11 +1151,11 @@ void inet_forward_change(void)
 
 static int devinet_sysctl_forward(ctl_table *ctl, int write,
                                  struct file* filp, void __user *buffer,
-                                 size_t *lenp)
+                                 size_t *lenp, loff_t *ppos)
 {
        int *valp = ctl->data;
        int val = *valp;
-       int ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+       int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
        if (write && *valp != val) {
                if (valp == &ipv4_devconf.forwarding)
@@ -1169,11 +1169,11 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
 
 int ipv4_doint_and_flush(ctl_table *ctl, int write,
                         struct file* filp, void __user *buffer,
-                        size_t *lenp)
+                        size_t *lenp, loff_t *ppos)
 {
        int *valp = ctl->data;
        int val = *valp;
-       int ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+       int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
        if (write && *valp != val)
                rt_cache_flush(0);
index 5df55ca9eef06e54a1b91b0fbd5335de9ecd2fa2..d90a7935623ff0bb6f1b6f630552c5833778843f 100644 (file)
@@ -1347,13 +1347,13 @@ static int ip_vs_zero_all(void)
 
 static int
 proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
-                    void __user *buffer, size_t *lenp)
+                    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int *valp = table->data;
        int val = *valp;
        int rc;
 
-       rc = proc_dointvec(table, write, filp, buffer, lenp);
+       rc = proc_dointvec(table, write, filp, buffer, lenp, ppos);
        if (write && (*valp != val)) {
                if ((*valp < 0) || (*valp > 3)) {
                        /* Restore the correct value */
@@ -1370,7 +1370,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
 
 static int
 proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
-                      void __user *buffer, size_t *lenp)
+                      void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int *valp = table->data;
        int val[2];
@@ -1379,7 +1379,7 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
        /* backup the value first */
        memcpy(val, valp, sizeof(val));
 
-       rc = proc_dointvec(table, write, filp, buffer, lenp);
+       rc = proc_dointvec(table, write, filp, buffer, lenp, ppos);
        if (write && (valp[0] < 0 || valp[1] < 0 || valp[0] >= valp[1])) {
                /* Restore the correct value */
                memcpy(valp, val, sizeof(val));
index 37c9d31c3880243b8303fbddb4abba4f6bc042de..15d9eca5384eaa682012c8aa4448ba85321c3394 100644 (file)
@@ -2498,10 +2498,10 @@ static int flush_delay;
 
 static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write,
                                        struct file *filp, void __user *buffer,
-                                       size_t *lenp)
+                                       size_t *lenp, loff_t *ppos)
 {
        if (write) {
-               proc_dointvec(ctl, write, filp, buffer, lenp);
+               proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
                rt_cache_flush(flush_delay);
                return 0;
        } 
index 6b0b74430e288662a7565119631148d1899d7213..55cc269224db07d4a7034da4907a397709d34a21 100644 (file)
@@ -62,12 +62,12 @@ extern ctl_table ipv4_route_table[];
 
 static
 int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
-                       void __user *buffer, size_t *lenp)
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int val = ipv4_devconf.forwarding;
        int ret;
 
-       ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+       ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
        if (write && ipv4_devconf.forwarding != val)
                inet_forward_change();
index 1305cf851707953cb59bf2c8b6ad1d0c8abec804..40ad73c5cbb7602caa6c7468e574ccb9afa78570 100644 (file)
@@ -3003,13 +3003,13 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
 
 static
 int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
-                          void __user *buffer, size_t *lenp)
+                          void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int *valp = ctl->data;
        int val = *valp;
        int ret;
 
-       ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+       ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
        if (write && *valp != val && valp != &ipv6_devconf_dflt.forwarding) {
                struct inet6_dev *idev = NULL;
index 3e8767628a959d5844e2405b8ab5fc87837368b9..b278e5a04ca826890a780485c827c2a6d2fc9274 100644 (file)
@@ -1423,7 +1423,7 @@ static struct notifier_block ndisc_netdev_notifier = {
 };
 
 #ifdef CONFIG_SYSCTL
-int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp)
+int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        struct net_device *dev = ctl->extra1;
        struct inet6_dev *idev;
@@ -1433,7 +1433,7 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
                inet6_ifinfo_notify(RTM_NEWLINK, idev);
                in6_dev_put(idev);
        }
-       return proc_dointvec(ctl, write, filp, buffer, lenp);
+       return proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 }
 #endif
 
index 143543f262a6deb0a1bbf78a6da990b8ed3f40a1..2017c69dc9f3b0a6a07b345d99ad31ce0c2e9641 100644 (file)
@@ -1924,10 +1924,10 @@ static int flush_delay;
 
 static
 int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp,
-                             void __user *buffer, size_t *lenp)
+                             void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        if (write) {
-               proc_dointvec(ctl, write, filp, buffer, lenp);
+               proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
                if (flush_delay < 0)
                        flush_delay = 0;
                fib6_run_gc((unsigned long)flush_delay);
index 995f4e15cce5a02f09d5828b2ba0c39425ff5cfe..cdcb320b56d1efb6a3af7449c8aabb5ccb51befc 100644 (file)
@@ -78,11 +78,11 @@ static int min_lap_keepalive_time = 100;    /* 100us */
  * us on that - Jean II */
 
 static int do_devname(ctl_table *table, int write, struct file *filp,
-                     void __user *buffer, size_t *lenp)
+                     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int ret;
 
-       ret = proc_dostring(table, write, filp, buffer, lenp);
+       ret = proc_dostring(table, write, filp, buffer, lenp, ppos);
        if (ret == 0 && write) {
                struct ias_value *val;
 
index e69a7fbb489cd1d9f43960c78c55ce9b5cf35167..1b9616a12e245405427606c494941327664e52c6 100644 (file)
@@ -58,14 +58,14 @@ rpc_unregister_sysctl(void)
 
 static int
 proc_dodebug(ctl_table *table, int write, struct file *file,
-                               void __user *buffer, size_t *lenp)
+                               void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        char            tmpbuf[20], c, *s;
        char __user *p;
        unsigned int    value;
        size_t          left, len;
 
-       if ((file->f_pos && !write) || !*lenp) {
+       if ((*ppos && !write) || !*lenp) {
                *lenp = 0;
                return 0;
        }
@@ -115,7 +115,7 @@ proc_dodebug(ctl_table *table, int write, struct file *file,
 
 done:
        *lenp -= left;
-       file->f_pos += *lenp;
+       *ppos += *lenp;
        return 0;
 }