aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-08 00:07:55 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-08 00:07:55 -0700
commitdc5c72458480bb0b5e8abfa9a2968a9603c74dcf (patch)
tree22b946604505b3a0acc0781a0b3370da6b6ffc18 /arch
parentf7a4bc7ee10c8e39e80b3e84f227a5752b0092d9 (diff)
downloadhistory-dc5c72458480bb0b5e8abfa9a2968a9603c74dcf.tar.gz
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".
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/kernel/perfmon.c13
-rw-r--r--arch/ppc/8xx_io/cs4218_tdm.c6
-rw-r--r--arch/ppc64/kernel/rtc.c10
-rw-r--r--arch/um/drivers/harddog_kern.c6
4 files changed, 7 insertions, 28 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 0455e6859dbc7a..3a6ebc7368b77d 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -1512,13 +1512,6 @@ exit_pfm_fs(void)
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 @@ pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos)
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 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare)
static struct file_operations pfm_file_ops = {
- .llseek = pfm_lseek,
+ .llseek = no_llseek,
.read = pfm_read,
.write = pfm_write,
.poll = pfm_poll,
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
index 7a5dd9ca3668bd..514e7de4055b25 100644
--- a/arch/ppc/8xx_io/cs4218_tdm.c
+++ b/arch/ppc/8xx_io/cs4218_tdm.c
@@ -1619,7 +1619,7 @@ static ssize_t sound_copy_translate_read(const u_char *userPtr,
static int mixer_open(struct inode *inode, struct file *file)
{
mixer.busy = 1;
- return 0;
+ return nonseekable_open(inode, file);
}
@@ -2105,7 +2105,7 @@ static int sq_open(struct inode *inode, struct file *file)
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 @@ static int state_open(struct inode *inode, struct file *file)
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 --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
index 2f92d958fbb405..28ac6c7ae78261 100644
--- a/arch/ppc64/kernel/rtc.c
+++ b/arch/ppc64/kernel/rtc.c
@@ -56,8 +56,6 @@ extern int piranha_simulator;
* 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 @@ static const unsigned char days_in_mo[] =
* 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_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
static int rtc_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
return 0;
}
@@ -184,7 +178,7 @@ static int rtc_release(struct inode *inode, struct file *file)
*/
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 --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index e3f3cddeadaa89..147ec19f6bb9dc 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -82,7 +82,7 @@ static int harddog_open(struct inode *inode, struct file *file)
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 @@ extern int ping_watchdog(int fd);
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.
*/