summaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_file.c
diff options
context:
space:
mode:
authorLatchesar Ionkov <lucho@ionkov.net>2006-01-08 01:05:00 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 20:14:06 -0800
commit531b1094b74365dcc55fa464d28a9a2497ae825d (patch)
treea0384dabe3be1c844166d028b3ef7c21c3dfe5fc /fs/9p/vfs_file.c
parentd8da097afb765654c866062148fd98b11db9003e (diff)
[PATCH] v9fs: zero copy implementation
Performance enhancement reducing the number of copies in the data and stat paths. Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Cc: Eric Van Hensbergen <ericvh@ericvh.myip.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/9p/vfs_file.c')
-rw-r--r--fs/9p/vfs_file.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index e13577da9130..6852f0eb96ed 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -32,6 +32,7 @@
#include <linux/string.h>
#include <linux/smp_lock.h>
#include <linux/inet.h>
+#include <linux/version.h>
#include <linux/list.h>
#include <asm/uaccess.h>
#include <linux/idr.h>
@@ -117,9 +118,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
result = v9fs_t_open(v9ses, newfid, open_mode, &fcall);
if (result < 0) {
- dprintk(DEBUG_ERROR,
- "open failed, open_mode 0x%x: %s\n", open_mode,
- FCALL_ERROR(fcall));
+ PRINT_FCALL_ERROR("open failed", fcall);
kfree(fcall);
return result;
}
@@ -256,7 +255,6 @@ v9fs_file_write(struct file *filp, const char __user * data,
int result = -EIO;
int rsize = 0;
int total = 0;
- char *buf;
dprintk(DEBUG_VFS, "data %p count %d offset %x\n", data, (int)count,
(int)*offset);
@@ -264,28 +262,14 @@ v9fs_file_write(struct file *filp, const char __user * data,
if (v9fid->iounit != 0 && rsize > v9fid->iounit)
rsize = v9fid->iounit;
- buf = kmalloc(v9ses->maxdata - V9FS_IOHDRSZ, GFP_KERNEL);
- if (!buf)
- return -ENOMEM;
-
do {
if (count < rsize)
rsize = count;
- result = copy_from_user(buf, data, rsize);
- if (result) {
- dprintk(DEBUG_ERROR, "Problem copying from user\n");
- kfree(buf);
- return -EFAULT;
- }
-
- dump_data(buf, rsize);
- result = v9fs_t_write(v9ses, fid, *offset, rsize, buf, &fcall);
+ result = v9fs_t_write(v9ses, fid, *offset, rsize, data, &fcall);
if (result < 0) {
- eprintk(KERN_ERR, "error while writing: %s(%d)\n",
- FCALL_ERROR(fcall), result);
+ PRINT_FCALL_ERROR("error while writing", fcall);
kfree(fcall);
- kfree(buf);
return result;
} else
*offset += result;
@@ -305,7 +289,6 @@ v9fs_file_write(struct file *filp, const char __user * data,
total += result;
} while (count);
- kfree(buf);
return total;
}