Commit f7a4bc7e authored by Linus Torvalds's avatar Linus Torvalds

Make sysctl pass the pos pointer around properly.

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.
parent 24e25979
...@@ -35,7 +35,7 @@ static int ppc_htab_show(struct seq_file *m, void *v); ...@@ -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, static ssize_t ppc_htab_write(struct file * file, const char __user * buffer,
size_t count, loff_t *ppos); size_t count, loff_t *ppos);
int proc_dol2crvec(ctl_table *table, int write, struct file *filp, 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 PTE *Hash, *Hash_end;
extern unsigned long Hash_size, Hash_mask; extern unsigned long Hash_size, Hash_mask;
...@@ -320,7 +320,7 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer, ...@@ -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, 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; int vleft, first=1, len, left, val;
char __user *buffer = (char __user *) buffer_arg; char __user *buffer = (char __user *) buffer_arg;
...@@ -344,7 +344,7 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp, ...@@ -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)) if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
return -EFAULT; return -EFAULT;
if ( /*!table->maxlen ||*/ (filp->f_pos && !write)) { if ( /*!table->maxlen ||*/ (*ppos && !write)) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -435,6 +435,6 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp, ...@@ -435,6 +435,6 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
if (write && first) if (write && first)
return -EINVAL; return -EINVAL;
*lenp -= left; *lenp -= left;
filp->f_pos += *lenp; *ppos += *lenp;
return 0; return 0;
} }
...@@ -88,11 +88,11 @@ struct appldata_parameter_list { ...@@ -88,11 +88,11 @@ struct appldata_parameter_list {
*/ */
static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata"; static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, 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, static int appldata_interval_handler(ctl_table *ctl, int write,
struct file *filp, struct file *filp,
void __user *buffer, void __user *buffer,
size_t *lenp); size_t *lenp, loff_t *ppos);
static struct ctl_table_header *appldata_sysctl_header; static struct ctl_table_header *appldata_sysctl_header;
static struct ctl_table appldata_table[] = { static struct ctl_table appldata_table[] = {
...@@ -315,12 +315,12 @@ __appldata_vtimer_setup(int cmd) ...@@ -315,12 +315,12 @@ __appldata_vtimer_setup(int cmd)
*/ */
static int static int
appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, 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; int len;
char buf[2]; char buf[2];
if (!*lenp || filp->f_pos) { if (!*lenp || *ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -343,7 +343,7 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -343,7 +343,7 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
spin_unlock(&appldata_timer_lock); spin_unlock(&appldata_timer_lock);
out: out:
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
...@@ -355,12 +355,12 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -355,12 +355,12 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
*/ */
static int static int
appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, 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; int len, interval;
char buf[16]; char buf[16];
if (!*lenp || filp->f_pos) { if (!*lenp || *ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -391,7 +391,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -391,7 +391,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
interval); interval);
out: out:
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
...@@ -403,7 +403,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -403,7 +403,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
*/ */
static int static int
appldata_generic_handler(ctl_table *ctl, int write, struct file *filp, 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; struct appldata_ops *ops = NULL, *tmp_ops;
int rc, len, found; int rc, len, found;
...@@ -429,7 +429,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -429,7 +429,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
} }
spin_unlock_bh(&appldata_ops_lock); spin_unlock_bh(&appldata_ops_lock);
if (!*lenp || filp->f_pos) { if (!*lenp || *ppos) {
*lenp = 0; *lenp = 0;
module_put(ops->owner); module_put(ops->owner);
return 0; return 0;
...@@ -488,7 +488,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -488,7 +488,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
spin_unlock_bh(&appldata_ops_lock); spin_unlock_bh(&appldata_ops_lock);
out: out:
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
module_put(ops->owner); module_put(ops->owner);
return 0; return 0;
} }
......
...@@ -256,13 +256,13 @@ static struct ctl_table cmm_table[]; ...@@ -256,13 +256,13 @@ static struct ctl_table cmm_table[];
static int static int
cmm_pages_handler(ctl_table *ctl, int write, struct file *filp, 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; char buf[16], *p;
long pages; long pages;
int len; int len;
if (!*lenp || (filp->f_pos && !write)) { if (!*lenp || (*ppos && !write)) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -291,19 +291,19 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -291,19 +291,19 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT; return -EFAULT;
} }
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
static int static int
cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp, 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; char buf[64], *p;
long pages, seconds; long pages, seconds;
int len; int len;
if (!*lenp || (filp->f_pos && !write)) { if (!*lenp || (*ppos && !write)) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -328,7 +328,7 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -328,7 +328,7 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT; return -EFAULT;
} }
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
......
...@@ -2933,13 +2933,13 @@ struct cdrom_sysctl_settings { ...@@ -2933,13 +2933,13 @@ struct cdrom_sysctl_settings {
} cdrom_sysctl_settings; } cdrom_sysctl_settings;
int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp, 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; int pos;
struct cdrom_device_info *cdi; struct cdrom_device_info *cdi;
char *info = cdrom_sysctl_settings.info; char *info = cdrom_sysctl_settings.info;
if (!*lenp || (filp->f_pos && !write)) { if (!*lenp || (*ppos && !write)) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -3028,7 +3028,7 @@ int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp, ...@@ -3028,7 +3028,7 @@ int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
strcpy(info+pos,"\n\n"); 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 /* Unfortunately, per device settings are not implemented through
...@@ -3060,13 +3060,13 @@ void cdrom_update_settings(void) ...@@ -3060,13 +3060,13 @@ void cdrom_update_settings(void)
} }
static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp, 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 *valp = ctl->data;
int val = *valp; int val = *valp;
int ret; int ret;
ret = proc_dointvec(ctl, write, filp, buffer, lenp); ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
if (write && *valp != val) { if (write && *valp != val) {
......
...@@ -1894,13 +1894,13 @@ static int change_poolsize(int poolsize) ...@@ -1894,13 +1894,13 @@ static int change_poolsize(int poolsize)
} }
static int proc_do_poolsize(ctl_table *table, int write, struct file *filp, 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; int ret;
sysctl_poolsize = random_state->poolinfo.POOLBYTES; 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 || if (ret || !write ||
(sysctl_poolsize == random_state->poolinfo.POOLBYTES)) (sysctl_poolsize == random_state->poolinfo.POOLBYTES))
return ret; return ret;
...@@ -1945,7 +1945,7 @@ static int poolsize_strategy(ctl_table *table, int __user *name, int nlen, ...@@ -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. * 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, 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; ctl_table fake_table;
unsigned char buf[64], tmp_uuid[16], *uuid; 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, ...@@ -1967,7 +1967,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
fake_table.data = buf; fake_table.data = buf;
fake_table.maxlen = sizeof(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, static int uuid_strategy(ctl_table *table, int __user *name, int nlen,
......
...@@ -151,13 +151,13 @@ EXPORT_SYMBOL_GPL(cpufreq_setmax); ...@@ -151,13 +151,13 @@ EXPORT_SYMBOL_GPL(cpufreq_setmax);
/*********************** cpufreq_sysctl interface ********************/ /*********************** cpufreq_sysctl interface ********************/
static int static int
cpufreq_procctl(ctl_table *ctl, int write, struct file *filp, 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; char buf[16], *p;
int cpu = (long) ctl->extra1; int cpu = (long) ctl->extra1;
unsigned int len, left = *lenp; unsigned int len, left = *lenp;
if (!left || (filp->f_pos && !write) || !cpu_online(cpu)) { if (!left || (*ppos && !write) || !cpu_online(cpu)) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -183,7 +183,7 @@ cpufreq_procctl(ctl_table *ctl, int write, struct file *filp, ...@@ -183,7 +183,7 @@ cpufreq_procctl(ctl_table *ctl, int write, struct file *filp,
} }
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
......
...@@ -399,7 +399,7 @@ static int arlan_setup_card_by_book(struct net_device *dev) ...@@ -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 char arlan_drive_info[ARLAN_STR_SIZE] = "A655\n\0";
static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp, 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 i;
int retv, pos, devnum; int retv, pos, devnum;
...@@ -625,7 +625,7 @@ static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp, ...@@ -625,7 +625,7 @@ static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
*lenp = pos; *lenp = pos;
if (!write) if (!write)
retv = proc_dostring(ctl, write, filp, buffer, lenp); retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
else else
{ {
*lenp = 0; *lenp = 0;
...@@ -636,7 +636,7 @@ static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp, ...@@ -636,7 +636,7 @@ static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp, 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 i;
int retv, pos, devnum; int retv, pos, devnum;
...@@ -665,12 +665,12 @@ static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp ...@@ -665,12 +665,12 @@ static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp
final: final:
*lenp = pos; *lenp = pos;
retv = proc_dostring(ctl, write, filp, buffer, lenp); retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
return retv; return retv;
} }
static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp, 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 i;
int retv, pos, devnum; int retv, pos, devnum;
...@@ -694,12 +694,12 @@ static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp ...@@ -694,12 +694,12 @@ static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp
SARLBNpln(u_char, txBuffer, 0x800); SARLBNpln(u_char, txBuffer, 0x800);
final: final:
*lenp = pos; *lenp = pos;
retv = proc_dostring(ctl, write, filp, buffer, lenp); retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
return retv; return retv;
} }
static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp, 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 i;
int retv, pos, devnum; int retv, pos, devnum;
...@@ -722,12 +722,12 @@ static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp ...@@ -722,12 +722,12 @@ static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp
SARLBNpln(u_char, rxBuffer, 0x800); SARLBNpln(u_char, rxBuffer, 0x800);
final: final:
*lenp = pos; *lenp = pos;
retv = proc_dostring(ctl, write, filp, buffer, lenp); retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
return retv; return retv;
} }
static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp, 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 i;
int retv, pos, devnum; int retv, pos, devnum;
...@@ -752,7 +752,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp, ...@@ -752,7 +752,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
final: final:
*lenp = pos; *lenp = pos;
retv = proc_dostring(ctl, write, filp, buffer, lenp); retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
return retv; return retv;
} }
...@@ -763,7 +763,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp, ...@@ -763,7 +763,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
static char conf_reset_result[200]; static char conf_reset_result[200];
static int arlan_configure(ctl_table * ctl, int write, struct file *filp, 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 pos = 0;
int devnum = ctl->procname[6] - '0'; int devnum = ctl->procname[6] - '0';
...@@ -784,11 +784,11 @@ static int arlan_configure(ctl_table * ctl, int write, struct file *filp, ...@@ -784,11 +784,11 @@ static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
return -1; return -1;
*lenp = pos; *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, 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 pos = 0;
int devnum = ctl->procname[5] - '0'; int devnum = ctl->procname[5] - '0';
...@@ -807,7 +807,7 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp, ...@@ -807,7 +807,7 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
} else } else
return -1; return -1;
*lenp = pos + 3; *lenp = pos + 3;
return proc_dostring(ctl, write, filp, buffer, lenp); return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define PARPORT_MAX_SPINTIME_VALUE 1000 #define PARPORT_MAX_SPINTIME_VALUE 1000
static int do_active_device(ctl_table *table, int write, struct file *filp, 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; struct parport *port = (struct parport *)table->extra1;
char buffer[256]; char buffer[256];
...@@ -43,7 +43,7 @@ static int do_active_device(ctl_table *table, int write, struct file *filp, ...@@ -43,7 +43,7 @@ static int do_active_device(ctl_table *table, int write, struct file *filp,
if (write) /* can't happen anyway */ if (write) /* can't happen anyway */
return -EACCES; return -EACCES;
if (filp->f_pos) { if (*ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -63,14 +63,14 @@ static int do_active_device(ctl_table *table, int write, struct file *filp, ...@@ -63,14 +63,14 @@ static int do_active_device(ctl_table *table, int write, struct file *filp,
else else
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return copy_to_user(result, buffer, len) ? -EFAULT : 0; return copy_to_user(result, buffer, len) ? -EFAULT : 0;
} }
#ifdef CONFIG_PARPORT_1284 #ifdef CONFIG_PARPORT_1284
static int do_autoprobe(ctl_table *table, int write, struct file *filp, 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; struct parport_device_info *info = table->extra2;
const char *str; const char *str;
...@@ -80,7 +80,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp, ...@@ -80,7 +80,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
if (write) /* permissions stop this */ if (write) /* permissions stop this */
return -EACCES; return -EACCES;
if (filp->f_pos) { if (*ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -105,7 +105,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp, ...@@ -105,7 +105,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
else else
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return copy_to_user (result, buffer, len) ? -EFAULT : 0; 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, ...@@ -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, static int do_hardware_base_addr (ctl_table *table, int write,
struct file *filp, void __user *result, struct file *filp, void __user *result,
size_t *lenp) size_t *lenp, loff_t *ppos)
{ {
struct parport *port = (struct parport *)table->extra1; struct parport *port = (struct parport *)table->extra1;
char buffer[20]; char buffer[20];
int len = 0; int len = 0;
if (filp->f_pos) { if (*ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -134,20 +134,20 @@ static int do_hardware_base_addr (ctl_table *table, int write, ...@@ -134,20 +134,20 @@ static int do_hardware_base_addr (ctl_table *table, int write,
else else
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return copy_to_user(result, buffer, len) ? -EFAULT : 0; return copy_to_user(result, buffer, len) ? -EFAULT : 0;
} }
static int do_hardware_irq (ctl_table *table, int write, static int do_hardware_irq (ctl_table *table, int write,
struct file *filp, void __user *result, struct file *filp, void __user *result,
size_t *lenp) size_t *lenp, loff_t *ppos)
{ {
struct parport *port = (struct parport *)table->extra1; struct parport *port = (struct parport *)table->extra1;
char buffer[20]; char buffer[20];
int len = 0; int len = 0;
if (filp->f_pos) { if (*ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -162,20 +162,20 @@ static int do_hardware_irq (ctl_table *table, int write, ...@@ -162,20 +162,20 @@ static int do_hardware_irq (ctl_table *table, int write,
else else
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return copy_to_user(result, buffer, len) ? -EFAULT : 0; return copy_to_user(result, buffer, len) ? -EFAULT : 0;
} }
static int do_hardware_dma (ctl_table *table, int write, static int do_hardware_dma (ctl_table *table, int write,
struct file *filp, void __user *result, struct file *filp, void __user *result,
size_t *lenp) size_t *lenp, loff_t *ppos)
{ {
struct parport *port = (struct parport *)table->extra1; struct parport *port = (struct parport *)table->extra1;
char buffer[20]; char buffer[20];
int len = 0; int len = 0;
if (filp->f_pos) { if (*ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -190,20 +190,20 @@ static int do_hardware_dma (ctl_table *table, int write, ...@@ -190,20 +190,20 @@ static int do_hardware_dma (ctl_table *table, int write,
else else
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return copy_to_user(result, buffer, len) ? -EFAULT : 0; return copy_to_user(result, buffer, len) ? -EFAULT : 0;
} }
static int do_hardware_modes (ctl_table *table, int write, static int do_hardware_modes (ctl_table *table, int write,
struct file *filp, void __user *result, struct file *filp, void __user *result,
size_t *lenp) size_t *lenp, loff_t *ppos)
{ {
struct parport *port = (struct parport *)table->extra1; struct parport *port = (struct parport *)table->extra1;
char buffer[40]; char buffer[40];
int len = 0; int len = 0;
if (filp->f_pos) { if (*ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -229,7 +229,7 @@ static int do_hardware_modes (ctl_table *table, int write, ...@@ -229,7 +229,7 @@ static int do_hardware_modes (ctl_table *table, int write,
else else
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return copy_to_user(result, buffer, len) ? -EFAULT : 0; return copy_to_user(result, buffer, len) ? -EFAULT : 0;
} }
......
...@@ -69,12 +69,12 @@ void reset_coda_cache_inv_stats( void ) ...@@ -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, 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 ) { if ( write ) {
reset_coda_vfs_stats(); reset_coda_vfs_stats();
filp->f_pos += *lenp; *ppos += *lenp;
} else { } else {
*lenp = 0; *lenp = 0;
} }
...@@ -84,12 +84,12 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, ...@@ -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, int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
struct file * filp, void __user * buffer, struct file * filp, void __user * buffer,
size_t * lenp ) size_t * lenp, loff_t * ppos )
{ {
if ( write ) { if ( write ) {
reset_coda_cache_inv_stats(); reset_coda_cache_inv_stats();
filp->f_pos += *lenp; *ppos += *lenp;
} else { } else {
*lenp = 0; *lenp = 0;
} }
......
...@@ -46,12 +46,13 @@ xfs_stats_clear_proc_handler( ...@@ -46,12 +46,13 @@ xfs_stats_clear_proc_handler(
int write, int write,
struct file *filp, struct file *filp,
void *buffer, void *buffer,
size_t *lenp) size_t *lenp,
loff_t *ppos)
{ {
int c, ret, *valp = ctl->data; int c, ret, *valp = ctl->data;
__uint32_t vn_active; __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) { if (!ret && write && *valp) {
printk("XFS Clearing xfsstats\n"); printk("XFS Clearing xfsstats\n");
......
...@@ -82,10 +82,10 @@ void reset_coda_cache_inv_stats( void ); ...@@ -82,10 +82,10 @@ void reset_coda_cache_inv_stats( void );
* data structure for /proc/sys/... files * data structure for /proc/sys/... files
*/ */
int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, 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, int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
struct file * filp, void __user * buffer, 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 */ /* 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, int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset,
......
...@@ -12,7 +12,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) ...@@ -12,7 +12,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
return vma->vm_flags & VM_HUGETLB; 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 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); 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); void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
......
...@@ -374,9 +374,9 @@ static inline int is_normal(struct zone *zone) ...@@ -374,9 +374,9 @@ static inline int is_normal(struct zone *zone)
struct ctl_table; struct ctl_table;
struct file; struct file;
int min_free_kbytes_sysctl_handler(struct ctl_table *, int, 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 *, 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> #include <linux/topology.h>
/* Returns the number of the current Node. */ /* Returns the number of the current Node. */
......
...@@ -762,24 +762,24 @@ typedef int ctl_handler (ctl_table *table, int __user *name, int nlen, ...@@ -762,24 +762,24 @@ typedef int ctl_handler (ctl_table *table, int __user *name, int nlen,
void **context); void **context);
typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, 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 *, 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 *, 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 *, 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 *, 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 *, 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 *, 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 *, 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, 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, extern int do_sysctl (int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
......
...@@ -86,7 +86,7 @@ extern int laptop_mode; ...@@ -86,7 +86,7 @@ extern int laptop_mode;
struct ctl_table; struct ctl_table;
struct file; struct file;
int dirty_writeback_centisecs_handler(struct ctl_table *, int, 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 page_writeback_init(void);
void balance_dirty_pages_ratelimited(struct address_space *mapping); void balance_dirty_pages_ratelimited(struct address_space *mapping);
......
...@@ -301,7 +301,7 @@ extern int ipv4_proc_init(void); ...@@ -301,7 +301,7 @@ extern int ipv4_proc_init(void);
*/ */
int ipv4_doint_and_flush(ctl_table *ctl, int write, int ipv4_doint_and_flush(ctl_table *ctl, int write,
struct file* filp, void __user *buffer, 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, int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void __user *newval, size_t newlen,
......
...@@ -103,7 +103,8 @@ extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl, ...@@ -103,7 +103,8 @@ extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl,
int write, int write,
struct file * filp, struct file * filp,
void __user *buffer, void __user *buffer,
size_t *lenp); size_t *lenp,
loff_t *ppos);
#endif #endif
extern void inet6_ifinfo_notify(int event, extern void inet6_ifinfo_notify(int event,
......
This diff is collapsed.
...@@ -191,9 +191,9 @@ static unsigned long set_max_huge_pages(unsigned long count) ...@@ -191,9 +191,9 @@ static unsigned long set_max_huge_pages(unsigned long count)
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
int hugetlb_sysctl_handler(struct ctl_table *table, int write, int hugetlb_sysctl_handler(struct ctl_table *table, int write,
struct file *file, void __user *buffer, 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); max_huge_pages = set_max_huge_pages(max_huge_pages);
return 0; return 0;
} }
......
...@@ -399,9 +399,9 @@ static void wb_kupdate(unsigned long arg) ...@@ -399,9 +399,9 @@ static void wb_kupdate(unsigned long arg)
* sysctl handler for /proc/sys/vm/dirty_writeback_centisecs * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs
*/ */
int dirty_writeback_centisecs_handler(ctl_table *table, int write, 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) { if (dirty_writeback_centisecs) {
mod_timer(&wb_timer, mod_timer(&wb_timer,
jiffies + (dirty_writeback_centisecs * HZ) / 100); jiffies + (dirty_writeback_centisecs * HZ) / 100);
......
...@@ -1955,9 +1955,9 @@ module_init(init_per_zone_pages_min) ...@@ -1955,9 +1955,9 @@ module_init(init_per_zone_pages_min)
* changes. * changes.
*/ */
int min_free_kbytes_sysctl_handler(ctl_table *table, int write, 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_pages_min();
setup_per_zone_protection(); setup_per_zone_protection();
return 0; return 0;
...@@ -1969,9 +1969,9 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write, ...@@ -1969,9 +1969,9 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
* whenever sysctl_lower_zone_protection changes. * whenever sysctl_lower_zone_protection changes.
*/ */
int lower_zone_protection_sysctl_handler(ctl_table *table, int write, 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(); setup_per_zone_protection();
return 0; return 0;
} }
......
...@@ -800,11 +800,11 @@ static struct nf_hook_ops br_nf_ops[] = { ...@@ -800,11 +800,11 @@ static struct nf_hook_ops br_nf_ops[] = {
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
static static
int brnf_sysctl_call_tables(ctl_table *ctl, int write, struct file * filp, 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; int ret;
ret = proc_dointvec(ctl, write, filp, buffer, lenp); ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
if (write && *(int *)(ctl->data)) if (write && *(int *)(ctl->data))
*(int *)(ctl->data) = 1; *(int *)(ctl->data) = 1;
......
...@@ -161,7 +161,7 @@ static int min_priority[1]; ...@@ -161,7 +161,7 @@ static int min_priority[1];
static int max_priority[] = { 127 }; /* From DECnet spec */ static int max_priority[] = { 127 }; /* From DECnet spec */
static int dn_forwarding_proc(ctl_table *, int, struct file *, 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, static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp, void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen, void __user *newval, size_t newlen,
...@@ -362,7 +362,8 @@ static void dn_dev_check_default(struct net_device *dev) ...@@ -362,7 +362,8 @@ static void dn_dev_check_default(struct net_device *dev)
static int dn_forwarding_proc(ctl_table *table, int write, static int dn_forwarding_proc(ctl_table *table, int write,
struct file *filep, struct file *filep,
void __user *buffer, size_t *lenp) void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
#ifdef CONFIG_DECNET_ROUTER #ifdef CONFIG_DECNET_ROUTER
struct net_device *dev = table->extra1; struct net_device *dev = table->extra1;
...@@ -376,7 +377,7 @@ static int dn_forwarding_proc(ctl_table *table, int write, ...@@ -376,7 +377,7 @@ static int dn_forwarding_proc(ctl_table *table, int write,
dn_db = dev->dn_ptr; dn_db = dev->dn_ptr;
old = dn_db->parms.forwarding; 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 ((err >= 0) && write) {
if (dn_db->parms.forwarding < 0) if (dn_db->parms.forwarding < 0)
......
...@@ -162,13 +162,14 @@ static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen ...@@ -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, static int dn_node_address_handler(ctl_table *table, int write,
struct file *filp, struct file *filp,
void __user *buffer, size_t *lenp) void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
char addr[DN_ASCBUF_LEN]; char addr[DN_ASCBUF_LEN];
size_t len; size_t len;
dn_address dnaddr; dn_address dnaddr;
if (!*lenp || (filp->f_pos && !write)) { if (!*lenp || (*ppos && !write)) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -191,7 +192,7 @@ static int dn_node_address_handler(ctl_table *table, int write, ...@@ -191,7 +192,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
dn_dev_devices_on(); dn_dev_devices_on();
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
...@@ -206,7 +207,7 @@ static int dn_node_address_handler(ctl_table *table, int write, ...@@ -206,7 +207,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
return -EFAULT; return -EFAULT;
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
...@@ -273,13 +274,14 @@ static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen, ...@@ -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, static int dn_def_dev_handler(ctl_table *table, int write,
struct file * filp, struct file * filp,
void __user *buffer, size_t *lenp) void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
size_t len; size_t len;
struct net_device *dev; struct net_device *dev;
char devname[17]; char devname[17];
if (!*lenp || (filp->f_pos && !write)) { if (!*lenp || (*ppos && !write)) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -307,7 +309,7 @@ static int dn_def_dev_handler(ctl_table *table, int write, ...@@ -307,7 +309,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
dev_put(dev); dev_put(dev);
return -ENODEV; return -ENODEV;
} }
filp->f_pos += *lenp; *ppos += *lenp;
return 0; return 0;
} }
...@@ -329,7 +331,7 @@ static int dn_def_dev_handler(ctl_table *table, int write, ...@@ -329,7 +331,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
return -EFAULT; return -EFAULT;
*lenp = len; *lenp = len;
filp->f_pos += len; *ppos += len;
return 0; return 0;
} }
......
...@@ -1151,11 +1151,11 @@ void inet_forward_change(void) ...@@ -1151,11 +1151,11 @@ void inet_forward_change(void)
static int devinet_sysctl_forward(ctl_table *ctl, int write, static int devinet_sysctl_forward(ctl_table *ctl, int write,
struct file* filp, void __user *buffer, struct file* filp, void __user *buffer,
size_t *lenp) size_t *lenp, loff_t *ppos)
{ {
int *valp = ctl->data; int *valp = ctl->data;
int val = *valp; 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 (write && *valp != val) {
if (valp == &ipv4_devconf.forwarding) if (valp == &ipv4_devconf.forwarding)
...@@ -1169,11 +1169,11 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, ...@@ -1169,11 +1169,11 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
int ipv4_doint_and_flush(ctl_table *ctl, int write, int ipv4_doint_and_flush(ctl_table *ctl, int write,
struct file* filp, void __user *buffer, struct file* filp, void __user *buffer,
size_t *lenp) size_t *lenp, loff_t *ppos)
{ {
int *valp = ctl->data; int *valp = ctl->data;
int val = *valp; 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 (write && *valp != val)
rt_cache_flush(0); rt_cache_flush(0);
......
...@@ -1347,13 +1347,13 @@ static int ip_vs_zero_all(void) ...@@ -1347,13 +1347,13 @@ static int ip_vs_zero_all(void)
static int static int
proc_do_defense_mode(ctl_table *table, int write, struct file * filp, 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 *valp = table->data;
int val = *valp; int val = *valp;
int rc; int rc;
rc = proc_dointvec(table, write, filp, buffer, lenp); rc = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if (write && (*valp != val)) { if (write && (*valp != val)) {
if ((*valp < 0) || (*valp > 3)) { if ((*valp < 0) || (*valp > 3)) {
/* Restore the correct value */ /* Restore the correct value */
...@@ -1370,7 +1370,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp, ...@@ -1370,7 +1370,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
static int static int
proc_do_sync_threshold(ctl_table *table, int write, struct file *filp, 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 *valp = table->data;
int val[2]; int val[2];
...@@ -1379,7 +1379,7 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp, ...@@ -1379,7 +1379,7 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
/* backup the value first */ /* backup the value first */
memcpy(val, valp, sizeof(val)); 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])) { if (write && (valp[0] < 0 || valp[1] < 0 || valp[0] >= valp[1])) {
/* Restore the correct value */ /* Restore the correct value */
memcpy(valp, val, sizeof(val)); memcpy(valp, val, sizeof(val));
......
...@@ -2498,10 +2498,10 @@ static int flush_delay; ...@@ -2498,10 +2498,10 @@ static int flush_delay;
static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write, static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write,
struct file *filp, void __user *buffer, struct file *filp, void __user *buffer,
size_t *lenp) size_t *lenp, loff_t *ppos)
{ {
if (write) { if (write) {
proc_dointvec(ctl, write, filp, buffer, lenp); proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
rt_cache_flush(flush_delay); rt_cache_flush(flush_delay);
return 0; return 0;
} }
......
...@@ -62,12 +62,12 @@ extern ctl_table ipv4_route_table[]; ...@@ -62,12 +62,12 @@ extern ctl_table ipv4_route_table[];
static static
int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp, 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 val = ipv4_devconf.forwarding;
int ret; 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) if (write && ipv4_devconf.forwarding != val)
inet_forward_change(); inet_forward_change();
......
...@@ -3003,13 +3003,13 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) ...@@ -3003,13 +3003,13 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
static static
int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp, 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 *valp = ctl->data;
int val = *valp; int val = *valp;
int ret; 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) { if (write && *valp != val && valp != &ipv6_devconf_dflt.forwarding) {
struct inet6_dev *idev = NULL; struct inet6_dev *idev = NULL;
......
...@@ -1423,7 +1423,7 @@ static struct notifier_block ndisc_netdev_notifier = { ...@@ -1423,7 +1423,7 @@ static struct notifier_block ndisc_netdev_notifier = {
}; };
#ifdef CONFIG_SYSCTL #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 net_device *dev = ctl->extra1;
struct inet6_dev *idev; struct inet6_dev *idev;
...@@ -1433,7 +1433,7 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f ...@@ -1433,7 +1433,7 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
inet6_ifinfo_notify(RTM_NEWLINK, idev); inet6_ifinfo_notify(RTM_NEWLINK, idev);
in6_dev_put(idev); in6_dev_put(idev);
} }
return proc_dointvec(ctl, write, filp, buffer, lenp); return proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
} }
#endif #endif
......
...@@ -1924,10 +1924,10 @@ static int flush_delay; ...@@ -1924,10 +1924,10 @@ static int flush_delay;
static static
int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp, 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) { if (write) {
proc_dointvec(ctl, write, filp, buffer, lenp); proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
if (flush_delay < 0) if (flush_delay < 0)
flush_delay = 0; flush_delay = 0;
fib6_run_gc((unsigned long)flush_delay); fib6_run_gc((unsigned long)flush_delay);
......
...@@ -78,11 +78,11 @@ static int min_lap_keepalive_time = 100; /* 100us */ ...@@ -78,11 +78,11 @@ static int min_lap_keepalive_time = 100; /* 100us */
* us on that - Jean II */ * us on that - Jean II */
static int do_devname(ctl_table *table, int write, struct file *filp, 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; int ret;
ret = proc_dostring(table, write, filp, buffer, lenp); ret = proc_dostring(table, write, filp, buffer, lenp, ppos);
if (ret == 0 && write) { if (ret == 0 && write) {
struct ias_value *val; struct ias_value *val;
......
...@@ -58,14 +58,14 @@ rpc_unregister_sysctl(void) ...@@ -58,14 +58,14 @@ rpc_unregister_sysctl(void)
static int static int
proc_dodebug(ctl_table *table, int write, struct file *file, 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 tmpbuf[20], c, *s;
char __user *p; char __user *p;
unsigned int value; unsigned int value;
size_t left, len; size_t left, len;
if ((file->f_pos && !write) || !*lenp) { if ((*ppos && !write) || !*lenp) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
...@@ -115,7 +115,7 @@ proc_dodebug(ctl_table *table, int write, struct file *file, ...@@ -115,7 +115,7 @@ proc_dodebug(ctl_table *table, int write, struct file *file,
done: done:
*lenp -= left; *lenp -= left;
file->f_pos += *lenp; *ppos += *lenp;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment