Commit 980f7186 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] bdev: generic_write_checks() cleanup

From: viro@parcelfarce.linux.theplanet.co.uk <viro@parcelfarce.linux.theplanet.co.uk>

generic_write_checks() had lost the first argument (inode) - it can be
calculated from the second one (file).
parent 893544c4
...@@ -1052,7 +1052,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ ...@@ -1052,7 +1052,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ
/* Check if we can write to specified region of file, file /* Check if we can write to specified region of file, file
is not overly big and this kind of stuff. Adjust pos and is not overly big and this kind of stuff. Adjust pos and
count, if needed */ count, if needed */
res = generic_write_checks(inode, file, &pos, &count, 0); res = generic_write_checks(file, &pos, &count, 0);
if (res) if (res)
goto out; goto out;
......
...@@ -1296,8 +1296,7 @@ extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); ...@@ -1296,8 +1296,7 @@ extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *); extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *);
int generic_write_checks(struct inode *inode, struct file *file, int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
loff_t *pos, size_t *count, int isblk);
extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *); extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *);
extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t); extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t);
extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *); extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *);
......
...@@ -1626,9 +1626,9 @@ filemap_set_next_iovec(const struct iovec **iovp, size_t *basep, size_t bytes) ...@@ -1626,9 +1626,9 @@ filemap_set_next_iovec(const struct iovec **iovp, size_t *basep, size_t bytes)
* Returns appropriate error code that caller should return or * Returns appropriate error code that caller should return or
* zero in case that write should be allowed. * zero in case that write should be allowed.
*/ */
inline int generic_write_checks(struct inode *inode, inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk)
struct file *file, loff_t *pos, size_t *count, int isblk)
{ {
struct inode *inode = file->f_mapping->host;
unsigned long limit = current->rlim[RLIMIT_FSIZE].rlim_cur; unsigned long limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
if (unlikely(*pos < 0)) if (unlikely(*pos < 0))
...@@ -1767,7 +1767,7 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov, ...@@ -1767,7 +1767,7 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
current->backing_dev_info = mapping->backing_dev_info; current->backing_dev_info = mapping->backing_dev_info;
written = 0; written = 0;
err = generic_write_checks(inode, file, &pos, &count, isblk); err = generic_write_checks(file, &pos, &count, isblk);
if (err) if (err)
goto out; goto out;
......
...@@ -1186,7 +1186,7 @@ shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t ...@@ -1186,7 +1186,7 @@ shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t
pos = *ppos; pos = *ppos;
written = 0; written = 0;
err = generic_write_checks(inode, file, &pos, &count, 0); err = generic_write_checks(file, &pos, &count, 0);
if (err || !count) if (err || !count)
goto out; goto out;
......
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