diff options
author | Latchesar Ionkov <lucho@ionkov.net> | 2006-01-08 04:05:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:14:06 -0500 |
commit | 531b1094b74365dcc55fa464d28a9a2497ae825d (patch) | |
tree | a0384dabe3be1c844166d028b3ef7c21c3dfe5fc /fs/9p/error.c | |
parent | d8da097afb765654c866062148fd98b11db9003e (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/error.c')
-rw-r--r-- | fs/9p/error.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/9p/error.c b/fs/9p/error.c index 834cb179e388..e4b6f8f38b6f 100644 --- a/fs/9p/error.c +++ b/fs/9p/error.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include <linux/list.h> | 34 | #include <linux/list.h> |
35 | #include <linux/jhash.h> | 35 | #include <linux/jhash.h> |
36 | #include <linux/string.h> | ||
37 | 36 | ||
38 | #include "debug.h" | 37 | #include "debug.h" |
39 | #include "error.h" | 38 | #include "error.h" |
@@ -55,7 +54,8 @@ int v9fs_error_init(void) | |||
55 | 54 | ||
56 | /* load initial error map into hash table */ | 55 | /* load initial error map into hash table */ |
57 | for (c = errmap; c->name != NULL; c++) { | 56 | for (c = errmap; c->name != NULL; c++) { |
58 | bucket = jhash(c->name, strlen(c->name), 0) % ERRHASHSZ; | 57 | c->namelen = strlen(c->name); |
58 | bucket = jhash(c->name, c->namelen, 0) % ERRHASHSZ; | ||
59 | INIT_HLIST_NODE(&c->list); | 59 | INIT_HLIST_NODE(&c->list); |
60 | hlist_add_head(&c->list, &hash_errmap[bucket]); | 60 | hlist_add_head(&c->list, &hash_errmap[bucket]); |
61 | } | 61 | } |
@@ -69,15 +69,15 @@ int v9fs_error_init(void) | |||
69 | * | 69 | * |
70 | */ | 70 | */ |
71 | 71 | ||
72 | int v9fs_errstr2errno(char *errstr) | 72 | int v9fs_errstr2errno(char *errstr, int len) |
73 | { | 73 | { |
74 | int errno = 0; | 74 | int errno = 0; |
75 | struct hlist_node *p = NULL; | 75 | struct hlist_node *p = NULL; |
76 | struct errormap *c = NULL; | 76 | struct errormap *c = NULL; |
77 | int bucket = jhash(errstr, strlen(errstr), 0) % ERRHASHSZ; | 77 | int bucket = jhash(errstr, len, 0) % ERRHASHSZ; |
78 | 78 | ||
79 | hlist_for_each_entry(c, p, &hash_errmap[bucket], list) { | 79 | hlist_for_each_entry(c, p, &hash_errmap[bucket], list) { |
80 | if (!strcmp(c->name, errstr)) { | 80 | if (c->namelen==len && !memcmp(c->name, errstr, len)) { |
81 | errno = c->val; | 81 | errno = c->val; |
82 | break; | 82 | break; |
83 | } | 83 | } |