patch-2.0.21-2.1.0 linux/fs/read_write.c
Next file: linux/fs/smbfs/dir.c
Previous file: linux/fs/proc/scsi.c
Back to the patch index
Back to the overall index
- Lines: 91
- Date:
Sat Sep 28 23:48:01 1996
- Orig file:
lx2.0/v2.0.21/linux/fs/read_write.c
- Orig date:
Wed Aug 21 09:18:09 1996
diff -u --recursive --new-file lx2.0/v2.0.21/linux/fs/read_write.c linux/fs/read_write.c
@@ -25,8 +25,8 @@
return -EBADF;
if (origin > 2)
return -EINVAL;
- if (file->f_op && file->f_op->lseek)
- return file->f_op->lseek(file->f_inode,file,offset,origin);
+ if (file->f_op && file->f_op->llseek)
+ return file->f_op->llseek(file->f_inode,file,offset,origin);
/* this is the default handler if no lseek handler is present */
switch (origin) {
@@ -69,13 +69,8 @@
return err;
offset = (loff_t) (((unsigned long long) offset_high << 32) | offset_low);
- /* if there is a fs-specific handler, we can't just ignore it.. */
- /* accept llseek() only for the signed long subset of long long */
- if (file->f_op && file->f_op->lseek) {
- if (offset != (long) offset)
- return -EINVAL;
- return file->f_op->lseek(file->f_inode,file,offset,origin);
- }
+ if (file->f_op && file->f_op->llseek)
+ return file->f_op->llseek(file->f_inode,file,offset,origin);
switch (origin) {
case 0:
@@ -101,7 +96,7 @@
return 0;
}
-asmlinkage int sys_read(unsigned int fd,char * buf,int count)
+asmlinkage long sys_read(unsigned int fd, char * buf, unsigned long count)
{
int error;
struct file * file;
@@ -136,7 +131,7 @@
return error;
}
-asmlinkage int sys_write(unsigned int fd,char * buf,unsigned int count)
+asmlinkage long sys_write(unsigned int fd, const char * buf, unsigned long count)
{
int error;
struct file * file;
@@ -191,7 +186,7 @@
return error;
}
-static int sock_readv_writev(int type, struct inode * inode, struct file * file,
+static long sock_readv_writev(int type, struct inode * inode, struct file * file,
const struct iovec * iov, long count, long size)
{
struct msghdr msg;
@@ -219,14 +214,14 @@
(file->f_flags & O_NONBLOCK), 0);
}
-typedef int (*IO_fn_t)(struct inode *, struct file *, char *, int);
+typedef long (*IO_fn_t)(struct inode *, struct file *, char *, unsigned long);
-static int do_readv_writev(int type, struct inode * inode, struct file * file,
+static long do_readv_writev(int type, struct inode * inode, struct file * file,
const struct iovec * vector, unsigned long count)
{
- size_t tot_len;
+ unsigned long tot_len;
struct iovec iov[UIO_MAXIOV];
- int retval, i;
+ long retval, i;
IO_fn_t fn;
/*
@@ -291,7 +286,7 @@
return retval;
}
-asmlinkage int sys_readv(unsigned long fd, const struct iovec * vector, long count)
+asmlinkage long sys_readv(unsigned long fd, const struct iovec * vector, unsigned long count)
{
struct file * file;
struct inode * inode;
@@ -303,7 +298,7 @@
return do_readv_writev(VERIFY_WRITE, inode, file, vector, count);
}
-asmlinkage int sys_writev(unsigned long fd, const struct iovec * vector, long count)
+asmlinkage long sys_writev(unsigned long fd, const struct iovec * vector, unsigned long count)
{
int error;
struct file * file;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov