aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 707ac21700d3..1f8dc373ede7 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -197,13 +197,13 @@ int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count
197 struct inode *inode; 197 struct inode *inode;
198 loff_t pos; 198 loff_t pos;
199 199
200 inode = file->f_path.dentry->d_inode;
200 if (unlikely((ssize_t) count < 0)) 201 if (unlikely((ssize_t) count < 0))
201 goto Einval; 202 goto Einval;
202 pos = *ppos; 203 pos = *ppos;
203 if (unlikely((pos < 0) || (loff_t) (pos + count) < 0)) 204 if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
204 goto Einval; 205 goto Einval;
205 206
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,
@@ -274,9 +274,9 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
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_path.dentry); 276 fsnotify_access(file->f_path.dentry);
277 current->rchar += ret; 277 add_rchar(current, ret);
278 } 278 }
279 current->syscr++; 279 inc_syscr(current);
280 } 280 }
281 } 281 }
282 282
@@ -332,9 +332,9 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
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_path.dentry); 334 fsnotify_modify(file->f_path.dentry);
335 current->wchar += ret; 335 add_wchar(current, ret);
336 } 336 }
337 current->syscw++; 337 inc_syscw(current);
338 } 338 }
339 } 339 }
340 340
@@ -675,8 +675,8 @@ sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen)
675 } 675 }
676 676
677 if (ret > 0) 677 if (ret > 0)
678 current->rchar += ret; 678 add_rchar(current, ret);
679 current->syscr++; 679 inc_syscr(current);
680 return ret; 680 return ret;
681} 681}
682 682
@@ -696,8 +696,8 @@ sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen)
696 } 696 }
697 697
698 if (ret > 0) 698 if (ret > 0)
699 current->wchar += ret; 699 add_wchar(current, ret);
700 current->syscw++; 700 inc_syscw(current);
701 return ret; 701 return ret;
702} 702}
703 703
@@ -779,12 +779,12 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
779 retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file); 779 retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file);
780 780
781 if (retval > 0) { 781 if (retval > 0) {
782 current->rchar += retval; 782 add_rchar(current, retval);
783 current->wchar += retval; 783 add_wchar(current, retval);
784 } 784 }
785 current->syscr++;
786 current->syscw++;
787 785
786 inc_syscr(current);
787 inc_syscw(current);
788 if (*ppos > max) 788 if (*ppos > max)
789 retval = -EOVERFLOW; 789 retval = -EOVERFLOW;
790 790