| From: |
| Linux Kernel Mailing List <linux-kernel@vger.kernel.org> |
| To: |
| bk-commits-head@vger.kernel.org |
| Subject: |
| Remove ESPIPE logic from drivers, letting the VFS layer handle it instead. |
| Date: |
| Sun, 08 Aug 2004 21:07:55 +0000 |
ChangeSet 1.1950, 2004/08/08 14:07:55-07:00, torvalds@ppc970.osdl.org
Remove ESPIPE logic from drivers, letting the VFS layer handle it instead.
This cleans up and simplifies drivers, and also allows us future
simplification in the VFS layer, since it removes knowledge about
internal VFS layer handling of "f_pos".
arch/ia64/kernel/perfmon.c | 13 +------------
arch/ppc/8xx_io/cs4218_tdm.c | 6 +++---
arch/ppc64/kernel/rtc.c | 10 ++--------
arch/um/drivers/harddog_kern.c | 6 +-----
drivers/bluetooth/hci_vhci.c | 2 +-
drivers/char/dtlk.c | 6 +-----
drivers/char/ftape/zftape/zftape-init.c | 1 +
drivers/char/ipmi/ipmi_watchdog.c | 10 +---------
drivers/char/scx200_gpio.c | 8 +-------
drivers/char/tipar.c | 5 +----
drivers/char/watchdog/acquirewdt.c | 6 +-----
drivers/char/watchdog/advantechwdt.c | 6 +-----
drivers/char/watchdog/alim1535_wdt.c | 6 +-----
drivers/char/watchdog/alim7101_wdt.c | 6 +-----
drivers/char/watchdog/eurotechwdt.c | 6 +-----
drivers/char/watchdog/i8xx_tco.c | 6 +-----
drivers/char/watchdog/ib700wdt.c | 6 +-----
drivers/char/watchdog/indydog.c | 6 +-----
drivers/char/watchdog/ixp2000_wdt.c | 6 +-----
drivers/char/watchdog/ixp4xx_wdt.c | 6 +-----
drivers/char/watchdog/machzwd.c | 6 +-----
drivers/char/watchdog/mixcomwd.c | 6 +-----
drivers/char/watchdog/pcwd.c | 12 ++----------
drivers/char/watchdog/pcwd_pci.c | 12 ++----------
drivers/char/watchdog/pcwd_usb.c | 12 ++----------
drivers/char/watchdog/sa1100_wdt.c | 5 +----
drivers/char/watchdog/sbc60xxwdt.c | 6 ++----
drivers/char/watchdog/sc1200wdt.c | 5 ++---
drivers/char/watchdog/sc520_wdt.c | 6 ++----
drivers/char/watchdog/scx200_wdt.c | 5 +----
drivers/char/watchdog/shwdt.c | 6 +-----
drivers/char/watchdog/softdog.c | 6 +-----
drivers/char/watchdog/w83627hf_wdt.c | 6 +-----
drivers/char/watchdog/w83877f_wdt.c | 6 +-----
drivers/char/watchdog/wafer5823wdt.c | 6 +-----
drivers/char/watchdog/wdt.c | 12 ++----------
drivers/char/watchdog/wdt285.c | 5 +----
drivers/char/watchdog/wdt977.c | 6 +-----
drivers/char/watchdog/wdt_pci.c | 12 ++----------
drivers/isdn/capi/capi.c | 8 +-------
drivers/isdn/hardware/eicon/divamnt.c | 5 +----
drivers/isdn/hardware/eicon/divasproc.c | 4 +---
drivers/isdn/hysdn/hysdn_procconf.c | 7 +------
drivers/isdn/hysdn/hysdn_proclog.c | 5 +----
drivers/isdn/i4l/isdn_common.c | 7 +------
drivers/s390/char/tape_char.c | 18 +-----------------
drivers/sbus/char/cpwatchdog.c | 5 +----
drivers/sbus/char/riowatchdog.c | 4 +---
drivers/scsi/osst.c | 13 +------------
drivers/usb/class/audio.c | 8 ++------
drivers/usb/class/usb-midi.c | 8 +-------
drivers/usb/media/dabusb.c | 2 +-
drivers/usb/misc/auerswald.c | 2 +-
drivers/usb/misc/legousbtower.c | 1 +
drivers/usb/misc/tiglusb.c | 2 +-
fs/devfs/base.c | 8 ++------
sound/oss/ad1889.c | 5 +----
sound/oss/ali5455.c | 8 ++------
sound/oss/au1000.c | 8 ++------
sound/oss/cmpci.c | 8 ++------
sound/oss/cs4281/cs4281m.c | 14 +++-----------
sound/oss/cs46xx.c | 13 ++-----------
sound/oss/emu10k1/audio.c | 8 +-------
sound/oss/emu10k1/midi.c | 8 +-------
sound/oss/es1370.c | 18 ++++--------------
sound/oss/es1371.c | 18 ++++--------------
sound/oss/esssolo1.c | 16 ++++------------
sound/oss/forte.c | 8 +-------
sound/oss/hal2.c | 8 ++------
sound/oss/i810_audio.c | 8 ++------
sound/oss/ite8172.c | 8 ++------
sound/oss/maestro.c | 8 ++------
sound/oss/maestro3.c | 8 ++------
sound/oss/nec_vrc5477.c | 9 +++------
sound/oss/rme96xx.c | 8 ++------
sound/oss/sonicvibes.c | 16 ++++------------
sound/oss/swarm_cs4297a.c | 20 ++++----------------
sound/oss/trident.c | 8 ++------
sound/oss/via82cxxx_audio.c | 14 ++------------
sound/oss/ymfpci.c | 8 ++------
80 files changed, 125 insertions(+), 504 deletions(-)
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
--- a/arch/ia64/kernel/perfmon.c 2004-08-08 15:06:07 -07:00
+++ b/arch/ia64/kernel/perfmon.c 2004-08-08 15:06:07 -07:00
@@ -1512,13 +1512,6 @@
mntput(pfmfs_mnt);
}
-static loff_t
-pfm_lseek(struct file *file, loff_t offset, int whence)
-{
- DPRINT(("pfm_lseek called\n"));
- return -ESPIPE;
-}
-
static ssize_t
pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos)
{
@@ -1545,10 +1538,6 @@
DPRINT(("message is too small ctx=%p (>=%ld)\n", ctx, sizeof(pfm_msg_t)));
return -EINVAL;
}
- /*
- * seeks are not allowed on message queues
- */
- if (ppos != &filp->f_pos) return -ESPIPE;
PROTECT_CTX(ctx, flags);
@@ -2141,7 +2130,7 @@
static struct file_operations pfm_file_ops = {
- .llseek = pfm_lseek,
+ .llseek = no_llseek,
.read = pfm_read,
.write = pfm_write,
.poll = pfm_poll,
diff -Nru a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
--- a/arch/ppc/8xx_io/cs4218_tdm.c 2004-08-08 15:06:07 -07:00
+++ b/arch/ppc/8xx_io/cs4218_tdm.c 2004-08-08 15:06:07 -07:00
@@ -1619,7 +1619,7 @@
static int mixer_open(struct inode *inode, struct file *file)
{
mixer.busy = 1;
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -2105,7 +2105,7 @@
sound_set_format(AFMT_MU_LAW);
}
- return 0;
+ return nonseekable_open(inode, file);
err_out_nobusy:
if (file->f_mode & FMODE_WRITE) {
@@ -2404,7 +2404,7 @@
len += sprintf(buffer+len, "\tsq.active = %d sq.syncing = %d\n",
sq.active, sq.syncing);
state.len = len;
- return 0;
+ return nonseekable_open(inode, file);
}
diff -Nru a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
--- a/arch/ppc64/kernel/rtc.c 2004-08-08 15:06:07 -07:00
+++ b/arch/ppc64/kernel/rtc.c 2004-08-08 15:06:07 -07:00
@@ -56,8 +56,6 @@
* ioctls.
*/
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin);
-
static ssize_t rtc_read(struct file *file, char *buf,
size_t count, loff_t *ppos);
@@ -81,11 +79,6 @@
* Now all the various file operations that we export.
*/
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin)
-{
- return -ESPIPE;
-}
-
static ssize_t rtc_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
@@ -171,6 +164,7 @@
static int rtc_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
return 0;
}
@@ -184,7 +178,7 @@
*/
static struct file_operations rtc_fops = {
.owner = THIS_MODULE,
- .llseek = rtc_llseek,
+ .llseek = no_llseek,
.read = rtc_read,
.ioctl = rtc_ioctl,
.open = rtc_open,
diff -Nru a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
--- a/arch/um/drivers/harddog_kern.c 2004-08-08 15:06:07 -07:00
+++ b/arch/um/drivers/harddog_kern.c 2004-08-08 15:06:07 -07:00
@@ -82,7 +82,7 @@
timer_alive = 1;
unlock_kernel();
- return 0;
+ return nonseekable_open(inode, file);
}
extern void stop_watchdog(int in_fd, int out_fd);
@@ -108,10 +108,6 @@
static ssize_t harddog_write(struct file *file, const char *data, size_t len,
loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/*
* Refresh the timer.
*/
diff -Nru a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
--- a/drivers/bluetooth/hci_vhci.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/bluetooth/hci_vhci.c 2004-08-08 15:06:07 -07:00
@@ -302,7 +302,7 @@
}
file->private_data = hci_vhci;
- return 0;
+ return nonseekable_open(inode, file);
}
static int hci_vhci_chr_close(struct inode *inode, struct file *file)
diff -Nru a/drivers/char/dtlk.c b/drivers/char/dtlk.c
--- a/drivers/char/dtlk.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/dtlk.c 2004-08-08 15:06:07 -07:00
@@ -176,10 +176,6 @@
}
#endif
- /* Can't seek (pwrite) on the DoubleTalk. */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (iminor(file->f_dentry->d_inode) != DTLK_MINOR)
return -EINVAL;
@@ -304,7 +300,7 @@
case DTLK_MINOR:
if (dtlk_busy)
return -EBUSY;
- return 0;
+ return nonseekable_open(inode, file);
default:
return -ENXIO;
diff -Nru a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
--- a/drivers/char/ftape/zftape/zftape-init.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/ftape/zftape/zftape-init.c 2004-08-08 15:06:07 -07:00
@@ -113,6 +113,7 @@
int result;
TRACE_FUN(ft_t_flow);
+ nonseekable_open(ino, filep);
TRACE(ft_t_flow, "called for minor %d", iminor(ino));
if ( test_and_set_bit(0,&busy_flag) ) {
TRACE_ABORT(-EBUSY, ft_t_warn, "failed: already busy");
diff -Nru a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
--- a/drivers/char/ipmi/ipmi_watchdog.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/ipmi/ipmi_watchdog.c 2004-08-08 15:06:07 -07:00
@@ -598,10 +598,6 @@
{
int rv;
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
rv = ipmi_heartbeat();
if (rv)
@@ -619,10 +615,6 @@
int rv = 0;
wait_queue_t wait;
- /* Can't seek (pread) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count <= 0)
return 0;
@@ -678,7 +670,7 @@
/* Don't start the timer now, let it start on the
first heartbeat. */
ipmi_start_timer_on_heartbeat = 1;
- return(0);
+ return nonseekable_open(ino, filep);
default:
return (-ENODEV);
diff -Nru a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
--- a/drivers/char/scx200_gpio.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/scx200_gpio.c 2004-08-08 15:06:07 -07:00
@@ -32,9 +32,6 @@
unsigned m = iminor(file->f_dentry->d_inode);
size_t i;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
for (i = 0; i < len; ++i) {
char c;
if (get_user(c, data+i))
@@ -83,9 +80,6 @@
unsigned m = iminor(file->f_dentry->d_inode);
int value;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
value = scx200_gpio_get(m);
if (put_user(value ? '1' : '0', buf))
return -EFAULT;
@@ -98,7 +92,7 @@
unsigned m = iminor(inode);
if (m > 63)
return -EINVAL;
- return 0;
+ return nonseekable_open(inode, file);
}
static int scx200_gpio_release(struct inode *inode, struct file *file)
diff -Nru a/drivers/char/tipar.c b/drivers/char/tipar.c
--- a/drivers/char/tipar.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/tipar.c 2004-08-08 15:06:07 -07:00
@@ -262,7 +262,7 @@
init_ti_parallel(minor);
parport_release(table[minor].dev);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
@@ -315,9 +315,6 @@
if (count == 0)
return 0;
-
- if (ppos != &file->f_pos)
- return -ESPIPE;
parport_claim_or_block(table[minor].dev);
diff -Nru a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c
--- a/drivers/char/watchdog/acquirewdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/acquirewdt.c 2004-08-08 15:06:07 -07:00
@@ -113,10 +113,6 @@
static ssize_t acq_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count) {
if (!nowayout) {
@@ -206,7 +202,7 @@
/* Activate */
acq_keepalive();
- return 0;
+ return nonseekable_open(inode, file);
}
static int acq_close(struct inode *inode, struct file *file)
diff -Nru a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c
--- a/drivers/char/watchdog/advantechwdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/advantechwdt.c 2004-08-08 15:06:07 -07:00
@@ -102,10 +102,6 @@
static ssize_t
advwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -200,7 +196,7 @@
*/
advwdt_ping();
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff -Nru a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c
--- a/drivers/char/watchdog/alim1535_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/alim1535_wdt.c 2004-08-08 15:06:07 -07:00
@@ -141,10 +141,6 @@
static ssize_t ali_write(struct file *file, const char __user *data,
size_t len, loff_t * ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
@@ -266,7 +262,7 @@
/* Activate */
ali_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/*
diff -Nru a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c
--- a/drivers/char/watchdog/alim7101_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/alim7101_wdt.c 2004-08-08 15:06:07 -07:00
@@ -150,10 +150,6 @@
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count) {
if (!nowayout) {
@@ -185,7 +181,7 @@
return -EBUSY;
/* Good, fire up the show */
wdt_startup();
- return 0;
+ return nonseekable_open(inode, file);
}
static int fop_close(struct inode * inode, struct file * file)
diff -Nru a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c
--- a/drivers/char/watchdog/eurotechwdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/eurotechwdt.c 2004-08-08 15:06:07 -07:00
@@ -199,10 +199,6 @@
static ssize_t eurwdt_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -310,7 +306,7 @@
eurwdt_timeout = WDT_TIMEOUT; /* initial timeout */
/* Activate the WDT */
eurwdt_activate_timer();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
diff -Nru a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
--- a/drivers/char/watchdog/i8xx_tco.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/i8xx_tco.c 2004-08-08 15:06:07 -07:00
@@ -193,7 +193,7 @@
*/
tco_timer_keepalive ();
tco_timer_start ();
- return 0;
+ return nonseekable_open(inode, file);
}
static int i8xx_tco_release (struct inode *inode, struct file *file)
@@ -215,10 +215,6 @@
static ssize_t i8xx_tco_write (struct file *file, const char __user *data,
size_t len, loff_t * ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
diff -Nru a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
--- a/drivers/char/watchdog/ib700wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/ib700wdt.c 2004-08-08 15:06:07 -07:00
@@ -141,10 +141,6 @@
static ssize_t
ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -228,7 +224,7 @@
/* Activate */
ibwdt_ping();
spin_unlock(&ibwdt_lock);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff -Nru a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c
--- a/drivers/char/watchdog/indydog.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/indydog.c 2004-08-08 15:06:07 -07:00
@@ -81,7 +81,7 @@
indydog_alive = 1;
printk(KERN_INFO "Started watchdog timer.\n");
- return 0;
+ return nonseekable_open(inode, file);
}
static int indydog_release(struct inode *inode, struct file *file)
@@ -98,10 +98,6 @@
static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* Refresh the timer. */
if (len) {
indydog_ping();
diff -Nru a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
--- a/drivers/char/watchdog/ixp2000_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/ixp2000_wdt.c 2004-08-08 15:06:07 -07:00
@@ -74,16 +74,12 @@
wdt_enable();
- return 0;
+ return nonseekable_open(inode, file);
}
static ssize_t
ixp2000_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff -Nru a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c
--- a/drivers/char/watchdog/ixp4xx_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/ixp4xx_wdt.c 2004-08-08 15:06:07 -07:00
@@ -69,16 +69,12 @@
wdt_enable();
- return 0;
+ return nonseekable_open(inode, file);
}
static ssize_t
ixp4xx_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff -Nru a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
--- a/drivers/char/watchdog/machzwd.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/machzwd.c 2004-08-08 15:06:07 -07:00
@@ -305,10 +305,6 @@
static ssize_t zf_write(struct file *file, const char __user *buf, size_t count,
loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character */
if(count){
@@ -389,7 +385,7 @@
zf_timer_on();
- return 0;
+ return nonseekable_open(inode, file);
}
static int zf_close(struct inode *inode, struct file *file)
diff -Nru a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
--- a/drivers/char/watchdog/mixcomwd.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/mixcomwd.c 2004-08-08 15:06:07 -07:00
@@ -108,7 +108,7 @@
mixcomwd_timer_alive=0;
}
}
- return 0;
+ return nonseekable_open(inode, file);
}
static int mixcomwd_release(struct inode *inode, struct file *file)
@@ -136,10 +136,6 @@
static ssize_t mixcomwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
{
- if (ppos != &file->f_pos) {
- return -ESPIPE;
- }
-
if(len)
{
if (!nowayout) {
diff -Nru a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
--- a/drivers/char/watchdog/pcwd.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/pcwd.c 2004-08-08 15:06:07 -07:00
@@ -485,10 +485,6 @@
static ssize_t pcwd_write(struct file *file, const char __user *buf, size_t len,
loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
@@ -523,7 +519,7 @@
/* Activate */
pcwd_start();
pcwd_keepalive();
- return(0);
+ return nonseekable_open(inode, file);
}
static int pcwd_close(struct inode *inode, struct file *file)
@@ -548,10 +544,6 @@
{
int temperature;
- /* Can't seek (pread) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (pcwd_get_temperature(&temperature))
return -EFAULT;
@@ -566,7 +558,7 @@
if (!supports_temp)
return -ENODEV;
- return 0;
+ return nonseekable_open(inode, file);
}
static int pcwd_temp_close(struct inode *inode, struct file *file)
diff -Nru a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c
--- a/drivers/char/watchdog/pcwd_pci.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/pcwd_pci.c 2004-08-08 15:06:07 -07:00
@@ -261,10 +261,6 @@
static ssize_t pcipcwd_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
@@ -392,7 +388,7 @@
/* Activate */
pcipcwd_start();
pcipcwd_keepalive();
- return 0;
+ return nonseekable_open(inode, file);
}
static int pcipcwd_release(struct inode *inode, struct file *file)
@@ -420,10 +416,6 @@
{
int temperature;
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (pcipcwd_get_temperature(&temperature))
return -EFAULT;
@@ -438,7 +430,7 @@
if (!pcipcwd_private.supports_temp)
return -ENODEV;
- return 0;
+ return nonseekable_open(inode, file);
}
static int pcipcwd_temp_release(struct inode *inode, struct file *file)
diff -Nru a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
--- a/drivers/char/watchdog/pcwd_usb.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/pcwd_usb.c 2004-08-08 15:06:07 -07:00
@@ -329,10 +329,6 @@
static ssize_t usb_pcwd_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
@@ -445,7 +441,7 @@
/* Activate */
usb_pcwd_start(usb_pcwd_device);
usb_pcwd_keepalive(usb_pcwd_device);
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_pcwd_release(struct inode *inode, struct file *file)
@@ -473,10 +469,6 @@
{
int temperature;
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
return -EFAULT;
@@ -488,7 +480,7 @@
static int usb_pcwd_temperature_open(struct inode *inode, struct file *file)
{
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
diff -Nru a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
--- a/drivers/char/watchdog/sa1100_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/sa1100_wdt.c 2004-08-08 15:06:07 -07:00
@@ -49,6 +49,7 @@
*/
static int sa1100dog_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
if (test_and_set_bit(1,&sa1100wdt_users))
return -EBUSY;
@@ -84,10 +85,6 @@
static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff -Nru a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c
--- a/drivers/char/watchdog/sbc60xxwdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/sbc60xxwdt.c 2004-08-08 15:06:07 -07:00
@@ -168,10 +168,6 @@
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count)
{
@@ -202,6 +198,8 @@
static int fop_open(struct inode * inode, struct file * file)
{
+ nonseekable_open(inode, file);
+
/* Just in case we're already talking to someone... */
if(test_and_set_bit(0, &wdt_is_open))
return -EBUSY;
diff -Nru a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
--- a/drivers/char/watchdog/sc1200wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/sc1200wdt.c 2004-08-08 15:06:07 -07:00
@@ -157,6 +157,8 @@
static int sc1200wdt_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
+
/* allow one at a time */
if (down_trylock(&open_sem))
return -EBUSY;
@@ -258,9 +260,6 @@
static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
{
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (len) {
if (!nowayout) {
size_t i;
diff -Nru a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c
--- a/drivers/char/watchdog/sc520_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/sc520_wdt.c 2004-08-08 15:06:07 -07:00
@@ -227,10 +227,6 @@
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count) {
if (!nowayout) {
@@ -258,6 +254,8 @@
static int fop_open(struct inode * inode, struct file * file)
{
+ nonseekable_open(inode, file);
+
/* Just in case we're already talking to someone... */
if(test_and_set_bit(0, &wdt_is_open))
return -EBUSY;
diff -Nru a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
--- a/drivers/char/watchdog/scx200_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/scx200_wdt.c 2004-08-08 15:06:07 -07:00
@@ -101,7 +101,7 @@
return -EBUSY;
scx200_wdt_enable();
- return 0;
+ return nonseekable_open(inode, file);
}
static int scx200_wdt_release(struct inode *inode, struct file *file)
@@ -135,9 +135,6 @@
static ssize_t scx200_wdt_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* check for a magic close character */
if (len)
{
diff -Nru a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c
--- a/drivers/char/watchdog/shwdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/shwdt.c 2004-08-08 15:06:07 -07:00
@@ -209,7 +209,7 @@
sh_wdt_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
@@ -248,10 +248,6 @@
static ssize_t sh_wdt_write(struct file *file, const char *buf,
size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
diff -Nru a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
--- a/drivers/char/watchdog/softdog.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/softdog.c 2004-08-08 15:06:07 -07:00
@@ -141,7 +141,7 @@
* Activate timer
*/
softdog_keepalive();
- return 0;
+ return nonseekable_open(inode, file);
}
static int softdog_release(struct inode *inode, struct file *file)
@@ -163,10 +163,6 @@
static ssize_t softdog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/*
* Refresh the timer.
*/
diff -Nru a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c
--- a/drivers/char/watchdog/w83627hf_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/w83627hf_wdt.c 2004-08-08 15:06:07 -07:00
@@ -144,10 +144,6 @@
static ssize_t
wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -241,7 +237,7 @@
*/
wdt_ping();
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff -Nru a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c
--- a/drivers/char/watchdog/w83877f_wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/w83877f_wdt.c 2004-08-08 15:06:07 -07:00
@@ -190,10 +190,6 @@
static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
{
- /* We can't seek */
- if(ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if(count)
{
@@ -230,7 +226,7 @@
/* Good, fire up the show */
wdt_startup();
- return 0;
+ return nonseekable_open(inode, file);
}
static int fop_close(struct inode * inode, struct file * file)
diff -Nru a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c
--- a/drivers/char/watchdog/wafer5823wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/wafer5823wdt.c 2004-08-08 15:06:07 -07:00
@@ -97,10 +97,6 @@
static ssize_t wafwdt_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (count) {
if (!nowayout) {
@@ -197,7 +193,7 @@
* Activate
*/
wafwdt_start();
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff -Nru a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
--- a/drivers/char/watchdog/wdt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/wdt.c 2004-08-08 15:06:07 -07:00
@@ -288,10 +288,6 @@
static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if(count) {
if (!nowayout) {
size_t i;
@@ -397,7 +393,7 @@
* Activate
*/
wdt_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
@@ -441,10 +437,6 @@
{
int temperature;
- /* Can't seek (pread) on this device */
- if (ptr != &file->f_pos)
- return -ESPIPE;
-
if (wdt_get_temperature(&temperature))
return -EFAULT;
@@ -464,7 +456,7 @@
static int wdt_temp_open(struct inode *inode, struct file *file)
{
- return 0;
+ return nonseekable_open(inode, file);
}
/**
diff -Nru a/drivers/char/watchdog/wdt285.c b/drivers/char/watchdog/wdt285.c
--- a/drivers/char/watchdog/wdt285.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/wdt285.c 2004-08-08 15:06:07 -07:00
@@ -97,6 +97,7 @@
ret = 0;
#endif
+ nonseekable_open(inode, file);
return ret;
}
@@ -117,10 +118,6 @@
static ssize_t
watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/*
* Refresh the timer.
*/
diff -Nru a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c
--- a/drivers/char/watchdog/wdt977.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/wdt977.c 2004-08-08 15:06:07 -07:00
@@ -240,7 +240,7 @@
__module_get(THIS_MODULE);
wdt977_start();
- return 0;
+ return nonseekable_open(inode, file);
}
static int wdt977_release(struct inode *inode, struct file *file)
@@ -275,10 +275,6 @@
static ssize_t wdt977_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
diff -Nru a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c
--- a/drivers/char/watchdog/wdt_pci.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/char/watchdog/wdt_pci.c 2004-08-08 15:06:07 -07:00
@@ -333,10 +333,6 @@
static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
if (!nowayout) {
size_t i;
@@ -446,7 +442,7 @@
* Activate
*/
wdtpci_start();
- return 0;
+ return nonseekable_open(inode, file);
}
/**
@@ -490,10 +486,6 @@
{
int temperature;
- /* Can't seek (pread) on this device */
- if (ptr != &file->f_pos)
- return -ESPIPE;
-
if (wdtpci_get_temperature(&temperature))
return -EFAULT;
@@ -513,7 +505,7 @@
static int wdtpci_temp_open(struct inode *inode, struct file *file)
{
- return 0;
+ return nonseekable_open(inode, file);
}
/**
diff -Nru a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
--- a/drivers/isdn/capi/capi.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/isdn/capi/capi.c 2004-08-08 15:06:07 -07:00
@@ -656,9 +656,6 @@
struct sk_buff *skb;
size_t copied;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!cdev->ap.applid)
return -ENODEV;
@@ -699,9 +696,6 @@
struct sk_buff *skb;
u16 mlen;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!cdev->ap.applid)
return -ENODEV;
@@ -965,7 +959,7 @@
if ((file->private_data = capidev_alloc()) == 0)
return -ENOMEM;
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff -Nru a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
--- a/drivers/isdn/hardware/eicon/divamnt.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/isdn/hardware/eicon/divamnt.c 2004-08-08 15:06:07 -07:00
@@ -151,9 +151,6 @@
int str_length;
int *str_msg;
- if (off != &file->f_pos)
- return -ESPIPE;
-
if (!file->private_data) {
for (;;) {
while (
@@ -306,7 +303,7 @@
filep->private_data = NULL;
- return (0);
+ return nonseekable_open(ino, filep);
}
static int maint_close(struct inode *ino, struct file *filep)
diff -Nru a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
--- a/drivers/isdn/hardware/eicon/divasproc.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/isdn/hardware/eicon/divasproc.c 2004-08-08 15:06:07 -07:00
@@ -63,8 +63,6 @@
if (*off)
return 0;
- if (off != &file->f_pos)
- return -ESPIPE;
divas_get_version(tmpbuf);
if (copy_to_user(buf + len, &tmpbuf, strlen(tmpbuf)))
@@ -107,7 +105,7 @@
static int divas_open(struct inode *inode, struct file *file)
{
- return (0);
+ return nonseekable_open(inode, file);
}
static int divas_close(struct inode *inode, struct file *file)
diff -Nru a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
--- a/drivers/isdn/hysdn/hysdn_procconf.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/isdn/hysdn/hysdn_procconf.c 2004-08-08 15:06:07 -07:00
@@ -95,8 +95,6 @@
int i;
uchar ch, *cp;
- if (&file->f_pos != off) /* fs error check */
- return (-ESPIPE);
if (!count)
return (0); /* nothing to handle */
@@ -214,9 +212,6 @@
char *cp;
int i;
- if (off != &file->f_pos) /* fs error check */
- return -ESPIPE;
-
if (file->f_mode & FMODE_READ) {
if (!(cp = file->private_data))
return (-EFAULT); /* should never happen */
@@ -320,7 +315,7 @@
return (-EPERM); /* no permission this time */
}
unlock_kernel();
- return (0);
+ return nonseekable_open(ino, filep);
} /* hysdn_conf_open */
/***************************/
diff -Nru a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
--- a/drivers/isdn/hysdn/hysdn_proclog.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/isdn/hysdn/hysdn_proclog.c 2004-08-08 15:06:07 -07:00
@@ -158,9 +158,6 @@
long base = 10;
hysdn_card *card = (hysdn_card *) file->private_data;
- if (&file->f_pos != off) /* fs error check */
- return (-ESPIPE);
-
if (count > (sizeof(valbuf) - 1))
count = sizeof(valbuf) - 1; /* limit length */
if (copy_from_user(valbuf, buf, count))
@@ -285,7 +282,7 @@
return (-EPERM); /* no permission this time */
}
unlock_kernel();
- return (0);
+ return nonseekable_open(ino, filep);
} /* hysdn_log_open */
/*******************************************************************************/
diff -Nru a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
--- a/drivers/isdn/i4l/isdn_common.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/isdn/i4l/isdn_common.c 2004-08-08 15:06:07 -07:00
@@ -946,9 +946,6 @@
int retval;
char *p;
- if (off != &file->f_pos)
- return -ESPIPE;
-
lock_kernel();
if (minor == ISDN_MINOR_STATUS) {
if (!file->private_data) {
@@ -1051,9 +1048,6 @@
int chidx;
int retval;
- if (off != &file->f_pos)
- return -ESPIPE;
-
if (minor == ISDN_MINOR_STATUS)
return -EPERM;
if (!dev->drivers)
@@ -1659,6 +1653,7 @@
}
#endif
out:
+ nonseekable_open(ino, filep);
return retval;
}
diff -Nru a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
--- a/drivers/s390/char/tape_char.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/s390/char/tape_char.c 2004-08-08 15:06:07 -07:00
@@ -145,16 +145,6 @@
DBF_EVENT(6, "TCHAR:read\n");
device = (struct tape_device *) filp->private_data;
- /* Check position. */
- if (ppos != &filp->f_pos) {
- /*
- * "A request was outside the capabilities of the device."
- * This check uses internal knowledge about how pread and
- * read work...
- */
- DBF_EVENT(6, "TCHAR:ppos wrong\n");
- return -EOVERFLOW;
- }
/*
* If the tape isn't terminated yet, do it now. And since we then
@@ -221,12 +211,6 @@
DBF_EVENT(6, "TCHAR:write\n");
device = (struct tape_device *) filp->private_data;
- /* Check position */
- if (ppos != &filp->f_pos) {
- /* "A request was outside the capabilities of the device." */
- DBF_EVENT(6, "TCHAR:ppos wrong\n");
- return -EOVERFLOW;
- }
/* Find out block size and number of blocks */
if (device->char_data.block_size != 0) {
if (count < device->char_data.block_size) {
@@ -329,7 +313,7 @@
rc = tape_open(device);
if (rc == 0) {
filp->private_data = device;
- return 0;
+ return nonseekable_open(inode, filp);
}
tape_put_device(device);
diff -Nru a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c
--- a/drivers/sbus/char/cpwatchdog.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/sbus/char/cpwatchdog.c 2004-08-08 15:06:07 -07:00
@@ -324,7 +324,7 @@
wd_dev.initialized = 1;
}
- return(0);
+ return(nonseekable_open(inode, f));
}
static int wd_release(struct inode *inode, struct file *file)
@@ -418,9 +418,6 @@
if(NULL == pTimer) {
return(-EINVAL);
}
-
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (count) {
wd_pingtimer(pTimer);
diff -Nru a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c
--- a/drivers/sbus/char/riowatchdog.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/sbus/char/riowatchdog.c 2004-08-08 15:06:07 -07:00
@@ -116,6 +116,7 @@
static int riowd_open(struct inode *inode, struct file *filp)
{
+ nonseekable_open(inode, filp);
return 0;
}
@@ -184,9 +185,6 @@
static ssize_t riowd_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
riowd_pingtimer();
return 1;
diff -Nru a/drivers/scsi/osst.c b/drivers/scsi/osst.c
--- a/drivers/scsi/osst.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/scsi/osst.c 2004-08-08 15:06:07 -07:00
@@ -3185,12 +3185,6 @@
goto out;
}
- if (ppos != &filp->f_pos) {
- /* "A request was outside the capabilities of the device." */
- retval = (-ENXIO);
- goto out;
- }
-
if (STp->ready != ST_READY) {
if (STp->ready == ST_NO_TAPE)
retval = (-ENOMEDIUM);
@@ -3512,12 +3506,6 @@
goto out;
}
- if (ppos != &filp->f_pos) {
- /* "A request was outside the capabilities of the device." */
- retval = (-ENXIO);
- goto out;
- }
-
if (STp->ready != ST_READY) {
if (STp->ready == ST_NO_TAPE)
retval = (-ENOMEDIUM);
@@ -4254,6 +4242,7 @@
int dev = TAPE_NR(inode);
int mode = TAPE_MODE(inode);
+ nonseekable_open(inode, filp);
write_lock(&os_scsi_tapes_lock);
if (dev >= osst_max_dev || os_scsi_tapes == NULL ||
(STp = os_scsi_tapes[dev]) == NULL || !STp->device) {
diff -Nru a/drivers/usb/class/audio.c b/drivers/usb/class/audio.c
--- a/drivers/usb/class/audio.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/usb/class/audio.c 2004-08-08 15:06:07 -07:00
@@ -1974,7 +1974,7 @@
s->count++;
up(&open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_audio_release_mixdev(struct inode *inode, struct file *file)
@@ -2147,8 +2147,6 @@
unsigned int ptr;
int cnt, err;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (as->usbin.dma.mapped)
return -ENXIO;
if (!as->usbin.dma.ready && (ret = prog_dmabuf_in(as)))
@@ -2216,8 +2214,6 @@
unsigned int start_thr;
int cnt, err;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (as->usbout.dma.mapped)
return -ENXIO;
if (!as->usbout.dma.ready && (ret = prog_dmabuf_out(as)))
@@ -2688,7 +2684,7 @@
as->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
s->count++;
up(&open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int usb_audio_release(struct inode *inode, struct file *file)
diff -Nru a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c
--- a/drivers/usb/class/usb-midi.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/usb/class/usb-midi.c 2004-08-08 15:06:07 -07:00
@@ -646,9 +646,6 @@
ssize_t ret;
DECLARE_WAITQUEUE(wait, current);
- if ( ppos != &file->f_pos ) {
- return -ESPIPE;
- }
if ( !access_ok(VERIFY_READ, buffer, count) ) {
return -EFAULT;
}
@@ -728,9 +725,6 @@
ssize_t ret;
unsigned long int flags;
- if ( ppos != &file->f_pos ) {
- return -ESPIPE;
- }
if ( !access_ok(VERIFY_READ, buffer, count) ) {
return -EFAULT;
}
@@ -920,7 +914,7 @@
printk(KERN_INFO "usb-midi: Open Succeeded. minor= %d.\n", minor);
#endif
- return 0; /** Success. **/
+ return nonseekable_open(inode, file); /** Success. **/
}
diff -Nru a/drivers/usb/media/dabusb.c b/drivers/usb/media/dabusb.c
--- a/drivers/usb/media/dabusb.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/usb/media/dabusb.c 2004-08-08 15:06:07 -07:00
@@ -616,7 +616,7 @@
file->f_pos = 0;
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int dabusb_release (struct inode *inode, struct file *file)
diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
--- a/drivers/usb/misc/auerswald.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/usb/misc/auerswald.c 2004-08-08 15:06:07 -07:00
@@ -1435,7 +1435,7 @@
/* file IO stuff */
file->f_pos = 0;
file->private_data = ccp;
- return 0;
+ return nonseekable_open(inode, file);
/* Error exit */
ofail: up (&cp->mutex);
diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
--- a/drivers/usb/misc/legousbtower.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/usb/misc/legousbtower.c 2004-08-08 15:06:07 -07:00
@@ -344,6 +344,7 @@
dbg(2, "%s: enter", __FUNCTION__);
+ nonseekable_open(inode, file);
subminor = iminor(inode);
down (&disconnect_sem);
diff -Nru a/drivers/usb/misc/tiglusb.c b/drivers/usb/misc/tiglusb.c
--- a/drivers/usb/misc/tiglusb.c 2004-08-08 15:06:07 -07:00
+++ b/drivers/usb/misc/tiglusb.c 2004-08-08 15:06:07 -07:00
@@ -132,7 +132,7 @@
filp->f_pos = 0;
filp->private_data = s;
- return 0;
+ return nonseekable_open(inode, filp);
}
static int
diff -Nru a/fs/devfs/base.c b/fs/devfs/base.c
--- a/fs/devfs/base.c 2004-08-08 15:06:07 -07:00
+++ b/fs/devfs/base.c 2004-08-08 15:06:07 -07:00
@@ -857,12 +857,14 @@
static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
loff_t * ppos);
static struct file_operations stat_fops = {
+ .open = nonseekable_open,
.read = stat_read,
};
#endif
/* Devfs daemon file operations */
static struct file_operations devfsd_fops = {
+ .open = nonseekable_open,
.read = devfsd_read,
.ioctl = devfsd_ioctl,
.release = devfsd_close,
@@ -2574,9 +2576,6 @@
struct devfsd_notify_struct *info = fs_info->devfsd_info;
DECLARE_WAITQUEUE(wait, current);
- /* Can't seek (pread) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
/* Verify the task has grabbed the queue */
if (fs_info->devfsd_task != current)
return -EPERM;
@@ -2763,9 +2762,6 @@
num = sprintf(txt, "Number of entries: %u number of bytes: %u\n",
stat_num_entries, stat_num_bytes) + 1;
- /* Can't seek (pread) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (*ppos >= num)
return 0;
if (*ppos + len > num)
diff -Nru a/sound/oss/ad1889.c b/sound/oss/ad1889.c
--- a/sound/oss/ad1889.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/ad1889.c 2004-08-08 15:06:07 -07:00
@@ -452,9 +452,6 @@
ssize_t ret = 0;
DECLARE_WAITQUEUE(wait, current);
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
down(&state->sem);
#if 0
if (dmabuf->mapped) {
@@ -764,7 +761,7 @@
ad1889_set_wav_rate(ad1889_dev, 44100);
ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */
- return 0;
+ return nonseekable_open(inode, file);
}
static int ad1889_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/ali5455.c b/sound/oss/ali5455.c
--- a/sound/oss/ali5455.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/ali5455.c 2004-08-08 15:06:07 -07:00
@@ -1593,8 +1593,6 @@
#ifdef DEBUG2
printk("ali_audio: ali_read called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & DAC_RUNNING)
@@ -1734,8 +1732,6 @@
#ifdef DEBUG2
printk("ali_audio: ali_write called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & ADC_RUNNING)
@@ -2890,7 +2886,7 @@
state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
outl(0x00000000, card->iobase + ALI_INTERRUPTCR);
outl(0x00000000, card->iobase + ALI_INTERRUPTSR);
- return 0;
+ return nonseekable_open(inode, file);
}
static int ali_release(struct inode *inode, struct file *file)
@@ -3047,7 +3043,7 @@
if (card->ac97_codec[i] != NULL
&& card->ac97_codec[i]->dev_mixer == minor) {
file->private_data = card->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
}
return -ENODEV;
diff -Nru a/sound/oss/au1000.c b/sound/oss/au1000.c
--- a/sound/oss/au1000.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/au1000.c 2004-08-08 15:06:07 -07:00
@@ -886,7 +886,7 @@
static int au1000_open_mixdev(struct inode *inode, struct file *file)
{
file->private_data = &au1000_state;
- return 0;
+ return nonseekable_open(inode, file);
}
static int au1000_release_mixdev(struct inode *inode, struct file *file)
@@ -1120,8 +1120,6 @@
unsigned long flags;
int cnt, usercnt, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1204,8 +1202,6 @@
dbg("write: count=%d", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1907,7 +1903,7 @@
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
init_MUTEX(&s->sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int au1000_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/cmpci.c b/sound/oss/cmpci.c
--- a/sound/oss/cmpci.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/cmpci.c 2004-08-08 15:06:07 -07:00
@@ -1852,7 +1852,7 @@
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int cm_release_mixdev(struct inode *inode, struct file *file)
@@ -1926,8 +1926,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -2028,8 +2026,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -2878,7 +2874,7 @@
set_fmt(s, fmtm, fmts);
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int cm_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
--- a/sound/oss/cs4281/cs4281m.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/cs4281/cs4281m.c 2004-08-08 15:06:07 -07:00
@@ -2592,7 +2592,7 @@
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs4281: cs4281_open_mixdev()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -2874,8 +2874,6 @@
printk(KERN_INFO "cs4281: cs4281_read()+ %Zu \n", count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -2990,8 +2988,6 @@
count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -3725,7 +3721,7 @@
}
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2,
printk(KERN_INFO "cs4281: cs4281_open()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -3842,8 +3838,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
ret = 0;
@@ -3890,8 +3884,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
ret = 0;
@@ -4025,7 +4017,7 @@
f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ |
FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
diff -Nru a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
--- a/sound/oss/cs46xx.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/cs46xx.c 2004-08-08 15:06:07 -07:00
@@ -1725,8 +1725,6 @@
unsigned ptr;
int cnt;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
ret = 0;
@@ -1770,8 +1768,6 @@
unsigned ptr;
int cnt;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
ret = 0;
@@ -2106,8 +2102,6 @@
return -ENODEV;
dmabuf = &state->dmabuf;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -2216,9 +2210,6 @@
return -EFAULT;
dmabuf = &state->dmabuf;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
down(&state->sem);
if (dmabuf->mapped)
{
@@ -3370,7 +3361,7 @@
return ret;
}
CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()- 0\n") );
- return 0;
+ return nonseekable_open(inode, file);
}
static int cs_release(struct inode *inode, struct file *file)
@@ -4104,7 +4095,7 @@
CS_INC_USE_COUNT(&card->mixer_use_cnt);
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs46xx: cs_open_mixdev()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
static int cs_release_mixdev(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
--- a/sound/oss/emu10k1/audio.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/emu10k1/audio.c 2004-08-08 15:06:07 -07:00
@@ -59,9 +59,6 @@
DPD(3, "emu10k1_audio_read(), buffer=%p, count=%d\n", buffer, (u32) count);
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
@@ -146,9 +143,6 @@
DPD(3, "emu10k1_audio_write(), buffer=%p, count=%d\n", buffer, (u32) count);
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
@@ -1249,7 +1243,7 @@
file->private_data = (void *) wave_dev;
- return 0;
+ return nonseekable_open(inode, file);
}
static int emu10k1_audio_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
--- a/sound/oss/emu10k1/midi.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/emu10k1/midi.c 2004-08-08 15:06:07 -07:00
@@ -185,7 +185,7 @@
up(&card->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int emu10k1_midi_release(struct inode *inode, struct file *file)
@@ -253,9 +253,6 @@
DPD(4, "emu10k1_midi_read(), count %#x\n", (u32) count);
- if (pos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
@@ -327,9 +324,6 @@
unsigned long flags;
DPD(4, "emu10k1_midi_write(), count=%#x\n", (u32) count);
-
- if (pos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
diff -Nru a/sound/oss/es1370.c b/sound/oss/es1370.c
--- a/sound/oss/es1370.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/es1370.c 2004-08-08 15:06:07 -07:00
@@ -1037,7 +1037,7 @@
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_release_mixdev(struct inode *inode, struct file *file)
@@ -1147,8 +1147,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1225,8 +1223,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac2.mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1789,7 +1785,7 @@
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
init_MUTEX(&s->sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_release(struct inode *inode, struct file *file)
@@ -1841,8 +1837,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac1.mapped)
return -ENXIO;
if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2222,7 +2216,7 @@
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= FMODE_DAC;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_release_dac(struct inode *inode, struct file *file)
@@ -2265,8 +2259,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2328,8 +2320,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2464,7 +2454,7 @@
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1370_midi_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/es1371.c b/sound/oss/es1371.c
--- a/sound/oss/es1371.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/es1371.c 2004-08-08 15:06:07 -07:00
@@ -1223,7 +1223,7 @@
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_release_mixdev(struct inode *inode, struct file *file)
@@ -1334,8 +1334,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1413,8 +1411,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac2.mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1978,7 +1974,7 @@
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
init_MUTEX(&s->sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_release(struct inode *inode, struct file *file)
@@ -2029,8 +2025,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac1.mapped)
return -ENXIO;
if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2400,7 +2394,7 @@
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= FMODE_DAC;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_release_dac(struct inode *inode, struct file *file)
@@ -2443,8 +2437,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2506,8 +2498,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2642,7 +2632,7 @@
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int es1371_midi_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
--- a/sound/oss/esssolo1.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/esssolo1.c 2004-08-08 15:06:07 -07:00
@@ -933,7 +933,7 @@
return -ENODEV;
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int solo1_release_mixdev(struct inode *inode, struct file *file)
@@ -1010,8 +1010,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -1106,8 +1104,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -1647,7 +1643,7 @@
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
prog_codec(s);
- return 0;
+ return nonseekable_open(inode, file);
}
static /*const*/ struct file_operations solo1_audio_fops = {
@@ -1740,8 +1736,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -1803,8 +1797,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -1951,7 +1943,7 @@
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int solo1_midi_release(struct inode *inode, struct file *file)
@@ -2161,7 +2153,7 @@
outb(1, s->sbbase+3); /* enable OPL3 */
s->open_mode |= FMODE_DMFM;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int solo1_dmfm_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/forte.c b/sound/oss/forte.c
--- a/sound/oss/forte.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/forte.c 2004-08-08 15:06:07 -07:00
@@ -1265,7 +1265,7 @@
if (file->f_mode & FMODE_READ)
forte_channel_init (forte, &forte->rec);
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -1438,9 +1438,6 @@
unsigned int i = bytes, sz = 0;
unsigned long flags;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (!access_ok (VERIFY_READ, buffer, bytes))
return -EFAULT;
@@ -1545,9 +1542,6 @@
struct forte_channel *channel;
unsigned int i = bytes, sz;
unsigned long flags;
-
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok (VERIFY_WRITE, buffer, bytes))
return -EFAULT;
diff -Nru a/sound/oss/hal2.c b/sound/oss/hal2.c
--- a/sound/oss/hal2.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/hal2.c 2004-08-08 15:06:07 -07:00
@@ -959,7 +959,7 @@
if (hal2) {
file->private_data = hal2;
- return 0;
+ return nonseekable_open(inode, file);
}
return -ENODEV;
}
@@ -1178,8 +1178,6 @@
if (!count)
return 0;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (down_interruptible(&adc->sem))
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
@@ -1234,8 +1232,6 @@
if (!count)
return 0;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (down_interruptible(&dac->sem))
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
@@ -1350,7 +1346,7 @@
dac->usecount++;
}
- return 0;
+ return nonseekable_open(inode, file);
}
static int hal2_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
--- a/sound/oss/i810_audio.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/i810_audio.c 2004-08-08 15:06:07 -07:00
@@ -1434,8 +1434,6 @@
printk("i810_audio: i810_read called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & DAC_RUNNING)
@@ -1574,8 +1572,6 @@
printk("i810_audio: i810_write called, count = %d\n", count);
#endif
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (dmabuf->enable & ADC_RUNNING)
@@ -2518,7 +2514,7 @@
state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
- return 0;
+ return nonseekable_open(inode, file);
}
static int i810_release(struct inode *inode, struct file *file)
@@ -2685,7 +2681,7 @@
if (card->ac97_codec[i] != NULL &&
card->ac97_codec[i]->dev_mixer == minor) {
file->private_data = card->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
}
return -ENODEV;
diff -Nru a/sound/oss/ite8172.c b/sound/oss/ite8172.c
--- a/sound/oss/ite8172.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/ite8172.c 2004-08-08 15:06:07 -07:00
@@ -878,7 +878,7 @@
break;
}
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int it8172_release_mixdev(struct inode *inode, struct file *file)
@@ -1093,8 +1093,6 @@
unsigned long flags;
int cnt, remainder, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1176,8 +1174,6 @@
unsigned long flags;
int cnt, remainder, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (db->mapped)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
@@ -1843,7 +1839,7 @@
s->open_mode |= (file->f_mode & (FMODE_READ | FMODE_WRITE));
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int it8172_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/maestro.c b/sound/oss/maestro.c
--- a/sound/oss/maestro.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/maestro.c 2004-08-08 15:06:07 -07:00
@@ -2158,7 +2158,7 @@
if (!card)
return -ENODEV;
file->private_data = card;
- return 0;
+ return nonseekable_open(inode, file);
}
static int ess_release_mixdev(struct inode *inode, struct file *file)
@@ -2274,8 +2274,6 @@
unsigned char *combbuf = NULL;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -2372,8 +2370,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -3082,7 +3078,7 @@
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff -Nru a/sound/oss/maestro3.c b/sound/oss/maestro3.c
--- a/sound/oss/maestro3.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/maestro3.c 2004-08-08 15:06:07 -07:00
@@ -1333,8 +1333,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -1414,8 +1412,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -2051,7 +2047,7 @@
up(&s->open_sem);
spin_unlock_irqrestore(&c->lock, flags);
- return 0;
+ return nonseekable_open(inode, file);
}
static int m3_release(struct inode *inode, struct file *file)
@@ -2165,7 +2161,7 @@
file->private_data = card->ac97;
- return 0;
+ return nonseekable_open(inode, file);
}
static int m3_release_mixdev(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c
--- a/sound/oss/nec_vrc5477.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/nec_vrc5477.c 2004-08-08 15:06:07 -07:00
@@ -868,7 +868,7 @@
break;
}
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int vrc5477_ac97_release_mixdev(struct inode *inode, struct file *file)
@@ -1043,8 +1043,6 @@
int copyCount;
size_t avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
@@ -1229,8 +1227,6 @@
unsigned long flags;
int copyCount, avail;
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
ret = 0;
@@ -1574,7 +1570,8 @@
struct list_head *list;
struct vrc5477_ac97_state *s;
int ret=0;
-
+
+ nonseekable_open(inode, file);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
diff -Nru a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c
--- a/sound/oss/rme96xx.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/rme96xx.c 2004-08-08 15:06:07 -07:00
@@ -1454,6 +1454,7 @@
DBG(printk("device num %d open\n",devnum));
+ nonseekable_open(in, f);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
@@ -1543,9 +1544,6 @@
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (dma->mmapped || !dma->opened)
return -ENXIO;
@@ -1611,9 +1609,6 @@
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (dma->mmapped || !dma->opened)
return -ENXIO;
@@ -1775,6 +1770,7 @@
COMM ("mixer open");
+ nonseekable_open(inode, file);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
diff -Nru a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
--- a/sound/oss/sonicvibes.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/sonicvibes.c 2004-08-08 15:06:07 -07:00
@@ -1252,7 +1252,7 @@
}
VALIDATE_STATE(s);
file->private_data = s;
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_release_mixdev(struct inode *inode, struct file *file)
@@ -1325,8 +1325,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -1410,8 +1408,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -1954,7 +1950,7 @@
set_fmt(s, fmtm, fmts);
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_release(struct inode *inode, struct file *file)
@@ -2005,8 +2001,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2068,8 +2062,6 @@
int cnt;
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (count == 0)
@@ -2212,7 +2204,7 @@
spin_unlock_irqrestore(&s->lock, flags);
s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_midi_release(struct inode *inode, struct file *file)
@@ -2414,7 +2406,7 @@
outb(1, s->iosynth+3); /* enable OPL3 */
s->open_mode |= FMODE_DMFM;
up(&s->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
}
static int sv_dmfm_release(struct inode *inode, struct file *file)
diff -Nru a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c
--- a/sound/oss/swarm_cs4297a.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/swarm_cs4297a.c 2004-08-08 15:06:07 -07:00
@@ -1526,14 +1526,6 @@
// ---------------------------------------------------------------------
-static loff_t cs4297a_llseek(struct file *file, loff_t offset, int origin)
-{
- return -ESPIPE;
-}
-
-
-// ---------------------------------------------------------------------
-
static int cs4297a_open_mixdev(struct inode *inode, struct file *file)
{
int minor = iminor(inode);
@@ -1561,7 +1553,7 @@
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -1588,7 +1580,7 @@
// ******************************************************************************************
static /*const */ struct file_operations cs4297a_mixer_fops = {
.owner = THIS_MODULE,
- .llseek = cs4297a_llseek,
+ .llseek = no_llseek,
.ioctl = cs4297a_ioctl_mixdev,
.open = cs4297a_open_mixdev,
.release = cs4297a_release_mixdev,
@@ -1658,8 +1650,6 @@
printk(KERN_INFO "cs4297a: cs4297a_read()+ %d \n", count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_adc.mapped)
return -ENXIO;
if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -1784,8 +1774,6 @@
count));
VALIDATE_STATE(s);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (s->dma_dac.mapped)
return -ENXIO;
if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -2494,7 +2482,7 @@
}
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2,
printk(KERN_INFO "cs4297a: cs4297a_open()- 0\n"));
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -2503,7 +2491,7 @@
// ******************************************************************************************
static /*const */ struct file_operations cs4297a_audio_fops = {
.owner = THIS_MODULE,
- .llseek = cs4297a_llseek,
+ .llseek = no_llseek,
.read = cs4297a_read,
.write = cs4297a_write,
.poll = cs4297a_poll,
diff -Nru a/sound/oss/trident.c b/sound/oss/trident.c
--- a/sound/oss/trident.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/trident.c 2004-08-08 15:06:07 -07:00
@@ -1874,8 +1874,6 @@
pr_debug("trident: trident_read called, count = %d\n", count);
VALIDATE_STATE(state);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
@@ -1992,8 +1990,6 @@
pr_debug("trident: trident_write called, count = %d\n", count);
VALIDATE_STATE(state);
- if (ppos != &file->f_pos)
- return -ESPIPE;
/*
* Guard against an mmap or ioctl while writing
@@ -2823,7 +2819,7 @@
pr_debug("trident: open virtual channel %d, hard channel %d\n",
state->virt, dmabuf->channel->num);
- return 0;
+ return nonseekable_open(inode, file);
}
static int
@@ -4079,7 +4075,7 @@
match:
file->private_data = card->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
static int
diff -Nru a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
--- a/sound/oss/via82cxxx_audio.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/via82cxxx_audio.c 2004-08-08 15:06:07 -07:00
@@ -1580,7 +1580,7 @@
file->private_data = card->ac97;
DPRINTK ("EXIT, returning 0\n");
- return 0;
+ return nonseekable_open(inode, file);
}
static int via_mixer_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
@@ -2401,11 +2401,6 @@
card = file->private_data;
assert (card != NULL);
- if (ppos != &file->f_pos) {
- DPRINTK ("EXIT, returning -ESPIPE\n");
- return -ESPIPE;
- }
-
rc = via_syscall_down (card, nonblock);
if (rc) goto out;
@@ -2589,11 +2584,6 @@
card = file->private_data;
assert (card != NULL);
- if (ppos != &file->f_pos) {
- DPRINTK ("EXIT, returning -ESPIPE\n");
- return -ESPIPE;
- }
-
rc = via_syscall_down (card, nonblock);
if (rc) goto out;
@@ -3345,7 +3335,7 @@
}
DPRINTK ("EXIT, returning 0\n");
- return 0;
+ return nonseekable_open(inode, file);
}
diff -Nru a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c
--- a/sound/oss/ymfpci.c 2004-08-08 15:06:07 -07:00
+++ b/sound/oss/ymfpci.c 2004-08-08 15:06:07 -07:00
@@ -1231,8 +1231,6 @@
unsigned int swptr;
int cnt; /* This many to go in this revolution */
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!dmabuf->ready && (ret = prog_dmabuf(state, 1)))
@@ -1350,8 +1348,6 @@
YMFDBGW("ymf_write: count %d\n", count);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!dmabuf->ready && (ret = prog_dmabuf(state, 0)))
@@ -1965,7 +1961,7 @@
#endif
up(&unit->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
out_nodma:
/*
@@ -2043,7 +2039,7 @@
match:
file->private_data = unit->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
static int ymf_ioctl_mixdev(struct inode *inode, struct file *file,
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html