aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2007-02-10 04:46:45 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:18:07 -0500
commit4b98d11b40f03382918796f3c5c936d5495d20a4 (patch)
tree616b7260196c9bd0eaf208ef8fab91fcf9efcece /fs/read_write.c
parent18f705f49a5b19206233f7cef8f869ce7291f8c8 (diff)
[PATCH] ifdef ->rchar, ->wchar, ->syscr, ->syscw from task_struct
They are fat: 4x8 bytes in task_struct. They are uncoditionally updated in every fork, read, write and sendfile. They are used only if you have some "extended acct fields feature". And please, please, please, read(2) knows about bytes, not characters, why it is called "rchar"? Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Jay Lan <jlan@engr.sgi.com> Cc: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 707ac21700d3..bcb0ef2aae3d 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -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