Commit cdbab299 authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/linux-2.5_ppc64_work
parents f7827443 be56f07f
...@@ -246,5 +246,7 @@ EXPORT_SYMBOL(debugger_fault_handler); ...@@ -246,5 +246,7 @@ EXPORT_SYMBOL(debugger_fault_handler);
EXPORT_SYMBOL(tb_ticks_per_usec); EXPORT_SYMBOL(tb_ticks_per_usec);
#ifdef CONFIG_PROFILING
EXPORT_SYMBOL_GPL(register_profile_notifier); EXPORT_SYMBOL_GPL(register_profile_notifier);
EXPORT_SYMBOL_GPL(unregister_profile_notifier); EXPORT_SYMBOL_GPL(unregister_profile_notifier);
#endif
...@@ -208,40 +208,42 @@ static long do_readv_writev32(int type, struct file *file, ...@@ -208,40 +208,42 @@ static long do_readv_writev32(int type, struct file *file,
asmlinkage long sys32_readv(int fd, struct iovec32 *vector, u32 count) asmlinkage long sys32_readv(int fd, struct iovec32 *vector, u32 count)
{ {
struct file *file; struct file *file;
int ret; int ret = -EBADF;
file = fget(fd); file = fget(fd);
if(!file) if (!file || !(file->f_mode & FMODE_READ))
return -EBADF; goto out;
if (!(file->f_mode & FMODE_READ)) ret = -EINVAL;
return -EBADF;
if (!file->f_op || (!file->f_op->readv && !file->f_op->read)) if (!file->f_op || (!file->f_op->readv && !file->f_op->read))
return -EINVAL; goto out;
ret = do_readv_writev32(READ, file, vector, count); ret = do_readv_writev32(READ, file, vector, count);
fput(file); out:
if (file)
fput(file);
return ret; return ret;
} }
asmlinkage long sys32_writev(int fd, struct iovec32 *vector, u32 count) asmlinkage long sys32_writev(int fd, struct iovec32 *vector, u32 count)
{ {
struct file *file; struct file *file;
int ret; int ret = -EBADF;
file = fget(fd); file = fget(fd);
if(!file) if (!file || !(file->f_mode & FMODE_WRITE))
return -EBADF; goto out;
if (!(file->f_mode & FMODE_WRITE)) ret = -EINVAL;
return -EBADF;
if (!file->f_op || (!file->f_op->writev && !file->f_op->write)) if (!file->f_op || (!file->f_op->writev && !file->f_op->write))
return -EINVAL; goto out;
ret = do_readv_writev32(WRITE, file, vector, count); ret = do_readv_writev32(WRITE, file, vector, count);
fput(file); out:
if (file)
fput(file);
return ret; return ret;
} }
......
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