aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-01-17 18:34:51 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2007-01-17 18:34:51 -0500
commit9cdf083f981b8d37b3212400a359368661385099 (patch)
treeaa15a6a08ad87e650dea40fb59b3180bef0d345b /fs/read_write.c
parente499e01d234a31d59679b7b1e1cf628d917ba49a (diff)
parenta8b3485287731978899ced11f24628c927890e78 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index f792000a28e6..707ac21700d3 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -64,13 +64,13 @@ loff_t remote_llseek(struct file *file, loff_t offset, int origin)
64 lock_kernel(); 64 lock_kernel();
65 switch (origin) { 65 switch (origin) {
66 case 2: 66 case 2:
67 offset += i_size_read(file->f_dentry->d_inode); 67 offset += i_size_read(file->f_path.dentry->d_inode);
68 break; 68 break;
69 case 1: 69 case 1:
70 offset += file->f_pos; 70 offset += file->f_pos;
71 } 71 }
72 retval = -EINVAL; 72 retval = -EINVAL;
73 if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) { 73 if (offset>=0 && offset<=file->f_path.dentry->d_inode->i_sb->s_maxbytes) {
74 if (offset != file->f_pos) { 74 if (offset != file->f_pos) {
75 file->f_pos = offset; 75 file->f_pos = offset;
76 file->f_version = 0; 76 file->f_version = 0;
@@ -95,7 +95,7 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
95 lock_kernel(); 95 lock_kernel();
96 switch (origin) { 96 switch (origin) {
97 case 2: 97 case 2:
98 offset += i_size_read(file->f_dentry->d_inode); 98 offset += i_size_read(file->f_path.dentry->d_inode);
99 break; 99 break;
100 case 1: 100 case 1:
101 offset += file->f_pos; 101 offset += file->f_pos;
@@ -203,7 +203,7 @@ int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count
203 if (unlikely((pos < 0) || (loff_t) (pos + count) < 0)) 203 if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
204 goto Einval; 204 goto Einval;
205 205
206 inode = file->f_dentry->d_inode; 206 inode = file->f_path.dentry->d_inode;
207 if (unlikely(inode->i_flock && MANDATORY_LOCK(inode))) { 207 if (unlikely(inode->i_flock && MANDATORY_LOCK(inode))) {
208 int retval = locks_mandatory_area( 208 int retval = locks_mandatory_area(
209 read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, 209 read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE,
@@ -273,7 +273,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
273 else 273 else
274 ret = do_sync_read(file, buf, count, pos); 274 ret = do_sync_read(file, buf, count, pos);
275 if (ret > 0) { 275 if (ret > 0) {
276 fsnotify_access(file->f_dentry); 276 fsnotify_access(file->f_path.dentry);
277 current->rchar += ret; 277 current->rchar += ret;
278 } 278 }
279 current->syscr++; 279 current->syscr++;
@@ -331,7 +331,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
331 else 331 else
332 ret = do_sync_write(file, buf, count, pos); 332 ret = do_sync_write(file, buf, count, pos);
333 if (ret > 0) { 333 if (ret > 0) {
334 fsnotify_modify(file->f_dentry); 334 fsnotify_modify(file->f_path.dentry);
335 current->wchar += ret; 335 current->wchar += ret;
336 } 336 }
337 current->syscw++; 337 current->syscw++;
@@ -450,8 +450,6 @@ unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to)
450 return seg; 450 return seg;
451} 451}
452 452
453EXPORT_UNUSED_SYMBOL(iov_shorten); /* June 2006 */
454
455ssize_t do_sync_readv_writev(struct file *filp, const struct iovec *iov, 453ssize_t do_sync_readv_writev(struct file *filp, const struct iovec *iov,
456 unsigned long nr_segs, size_t len, loff_t *ppos, iov_fn_t fn) 454 unsigned long nr_segs, size_t len, loff_t *ppos, iov_fn_t fn)
457{ 455{
@@ -628,9 +626,9 @@ out:
628 kfree(iov); 626 kfree(iov);
629 if ((ret + (type == READ)) > 0) { 627 if ((ret + (type == READ)) > 0) {
630 if (type == READ) 628 if (type == READ)
631 fsnotify_access(file->f_dentry); 629 fsnotify_access(file->f_path.dentry);
632 else 630 else
633 fsnotify_modify(file->f_dentry); 631 fsnotify_modify(file->f_path.dentry);
634 } 632 }
635 return ret; 633 return ret;
636} 634}
@@ -722,7 +720,7 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
722 if (!(in_file->f_mode & FMODE_READ)) 720 if (!(in_file->f_mode & FMODE_READ))
723 goto fput_in; 721 goto fput_in;
724 retval = -EINVAL; 722 retval = -EINVAL;
725 in_inode = in_file->f_dentry->d_inode; 723 in_inode = in_file->f_path.dentry->d_inode;
726 if (!in_inode) 724 if (!in_inode)
727 goto fput_in; 725 goto fput_in;
728 if (!in_file->f_op || !in_file->f_op->sendfile) 726 if (!in_file->f_op || !in_file->f_op->sendfile)
@@ -754,7 +752,7 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
754 retval = -EINVAL; 752 retval = -EINVAL;
755 if (!out_file->f_op || !out_file->f_op->sendpage) 753 if (!out_file->f_op || !out_file->f_op->sendpage)
756 goto fput_out; 754 goto fput_out;
757 out_inode = out_file->f_dentry->d_inode; 755 out_inode = out_file->f_path.dentry->d_inode;
758 retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count); 756 retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count);
759 if (retval < 0) 757 if (retval < 0)
760 goto fput_out; 758 goto fput_out;