aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-07 09:43:47 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-07 09:43:47 -0700
commitf7a4bc7ee10c8e39e80b3e84f227a5752b0092d9 (patch)
treed0ee302ad03fd56ef4df6af5dfee6e77c28932ea /drivers
parent24e259799962e03efe3d1470346537ab1ce1b078 (diff)
downloadhistory-f7a4bc7ee10c8e39e80b3e84f227a5752b0092d9.tar.gz
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.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cdrom/cdrom.c10
-rw-r--r--drivers/char/random.c8
-rw-r--r--drivers/cpufreq/cpufreq_userspace.c6
-rw-r--r--drivers/net/wireless/arlan-proc.c28
-rw-r--r--drivers/parport/procfs.c36
5 files changed, 44 insertions, 44 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index bfdc4d24a2c718..360d4b64a42e53 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -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) {
diff --git a/drivers/char/random.c b/drivers/char/random.c
index f51b541120e259..a86545f32d631b 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -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,
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 5102144709559f..161e8a27c6c56a 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -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;
}
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c
index b2e01523cb2b6a..86da31cac5eeae 100644
--- a/drivers/net/wireless/arlan-proc.c
+++ b/drivers/net/wireless/arlan-proc.c
@@ -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);
}
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index afa6ac45a5dab1..061097fd811738 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -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;
}