diff options
author | Latchesar Ionkov <lucho@ionkov.net> | 2006-01-08 04:05:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:14:06 -0500 |
commit | 1dac06b20dcc8078dab037bd70652c69c67ba672 (patch) | |
tree | 34436f474074aa2760604555e3aa9b02df18fce2 /fs/9p/9p.c | |
parent | 531b1094b74365dcc55fa464d28a9a2497ae825d (diff) |
[PATCH] v9fs: handle kthread_create failure, minor bugfixes
- remove unnecessary -ENOMEM assignments
- return correct value when buf_check_size for second time in a buffer
- handle failures when create_workqueue and kthread_create are called
- use kzalloc instead of kmalloc/memset 0
- v9fs_str_copy and v9fs_str_compare were buggy, were used only in one
place, correct the logic and move it to the place it is used.
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/9p.c')
-rw-r--r-- | fs/9p/9p.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/fs/9p/9p.c b/fs/9p/9p.c index dc3ce44ec836..1a6d08761f39 100644 --- a/fs/9p/9p.c +++ b/fs/9p/9p.c | |||
@@ -86,7 +86,6 @@ v9fs_t_attach(struct v9fs_session_info *v9ses, char *uname, char *aname, | |||
86 | dprintk(DEBUG_9P, "uname '%s' aname '%s' fid %d afid %d\n", uname, | 86 | dprintk(DEBUG_9P, "uname '%s' aname '%s' fid %d afid %d\n", uname, |
87 | aname, fid, afid); | 87 | aname, fid, afid); |
88 | 88 | ||
89 | ret = -ENOMEM; | ||
90 | tc = v9fs_create_tattach(fid, afid, uname, aname); | 89 | tc = v9fs_create_tattach(fid, afid, uname, aname); |
91 | if (!IS_ERR(tc)) { | 90 | if (!IS_ERR(tc)) { |
92 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); | 91 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); |
@@ -136,7 +135,6 @@ v9fs_t_clunk(struct v9fs_session_info *v9ses, u32 fid) | |||
136 | 135 | ||
137 | dprintk(DEBUG_9P, "fid %d\n", fid); | 136 | dprintk(DEBUG_9P, "fid %d\n", fid); |
138 | 137 | ||
139 | ret = -ENOMEM; | ||
140 | rc = NULL; | 138 | rc = NULL; |
141 | tc = v9fs_create_tclunk(fid); | 139 | tc = v9fs_create_tclunk(fid); |
142 | if (!IS_ERR(tc)) | 140 | if (!IS_ERR(tc)) |
@@ -165,7 +163,6 @@ int v9fs_t_flush(struct v9fs_session_info *v9ses, u16 oldtag) | |||
165 | 163 | ||
166 | dprintk(DEBUG_9P, "oldtag %d\n", oldtag); | 164 | dprintk(DEBUG_9P, "oldtag %d\n", oldtag); |
167 | 165 | ||
168 | ret = -ENOMEM; | ||
169 | tc = v9fs_create_tflush(oldtag); | 166 | tc = v9fs_create_tflush(oldtag); |
170 | if (!IS_ERR(tc)) { | 167 | if (!IS_ERR(tc)) { |
171 | ret = v9fs_mux_rpc(v9ses->mux, tc, NULL); | 168 | ret = v9fs_mux_rpc(v9ses->mux, tc, NULL); |
@@ -221,7 +218,6 @@ v9fs_t_wstat(struct v9fs_session_info *v9ses, u32 fid, | |||
221 | 218 | ||
222 | dprintk(DEBUG_9P, "fid %d\n", fid); | 219 | dprintk(DEBUG_9P, "fid %d\n", fid); |
223 | 220 | ||
224 | ret = -ENOMEM; | ||
225 | tc = v9fs_create_twstat(fid, wstat, v9ses->extended); | 221 | tc = v9fs_create_twstat(fid, wstat, v9ses->extended); |
226 | if (!IS_ERR(tc)) { | 222 | if (!IS_ERR(tc)) { |
227 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); | 223 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); |
@@ -259,7 +255,6 @@ v9fs_t_walk(struct v9fs_session_info *v9ses, u32 fid, u32 newfid, | |||
259 | else | 255 | else |
260 | nwname = 0; | 256 | nwname = 0; |
261 | 257 | ||
262 | ret = -ENOMEM; | ||
263 | tc = v9fs_create_twalk(fid, newfid, nwname, &name); | 258 | tc = v9fs_create_twalk(fid, newfid, nwname, &name); |
264 | if (!IS_ERR(tc)) { | 259 | if (!IS_ERR(tc)) { |
265 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); | 260 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); |
@@ -289,7 +284,6 @@ v9fs_t_open(struct v9fs_session_info *v9ses, u32 fid, u8 mode, | |||
289 | 284 | ||
290 | dprintk(DEBUG_9P, "fid %d mode %d\n", fid, mode); | 285 | dprintk(DEBUG_9P, "fid %d mode %d\n", fid, mode); |
291 | 286 | ||
292 | ret = -ENOMEM; | ||
293 | tc = v9fs_create_topen(fid, mode); | 287 | tc = v9fs_create_topen(fid, mode); |
294 | if (!IS_ERR(tc)) { | 288 | if (!IS_ERR(tc)) { |
295 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); | 289 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); |
@@ -317,7 +311,6 @@ v9fs_t_remove(struct v9fs_session_info *v9ses, u32 fid, | |||
317 | 311 | ||
318 | dprintk(DEBUG_9P, "fid %d\n", fid); | 312 | dprintk(DEBUG_9P, "fid %d\n", fid); |
319 | 313 | ||
320 | ret = -ENOMEM; | ||
321 | tc = v9fs_create_tremove(fid); | 314 | tc = v9fs_create_tremove(fid); |
322 | if (!IS_ERR(tc)) { | 315 | if (!IS_ERR(tc)) { |
323 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); | 316 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); |
@@ -349,7 +342,6 @@ v9fs_t_create(struct v9fs_session_info *v9ses, u32 fid, char *name, | |||
349 | dprintk(DEBUG_9P, "fid %d name '%s' perm %x mode %d\n", | 342 | dprintk(DEBUG_9P, "fid %d name '%s' perm %x mode %d\n", |
350 | fid, name, perm, mode); | 343 | fid, name, perm, mode); |
351 | 344 | ||
352 | ret = -ENOMEM; | ||
353 | tc = v9fs_create_tcreate(fid, name, perm, mode); | 345 | tc = v9fs_create_tcreate(fid, name, perm, mode); |
354 | if (!IS_ERR(tc)) { | 346 | if (!IS_ERR(tc)) { |
355 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); | 347 | ret = v9fs_mux_rpc(v9ses->mux, tc, rcp); |
@@ -380,7 +372,6 @@ v9fs_t_read(struct v9fs_session_info *v9ses, u32 fid, u64 offset, | |||
380 | dprintk(DEBUG_9P, "fid %d offset 0x%llux count 0x%x\n", fid, | 372 | dprintk(DEBUG_9P, "fid %d offset 0x%llux count 0x%x\n", fid, |
381 | (long long unsigned) offset, count); | 373 | (long long unsigned) offset, count); |
382 | 374 | ||
383 | ret = -ENOMEM; | ||
384 | tc = v9fs_create_tread(fid, offset, count); | 375 | tc = v9fs_create_tread(fid, offset, count); |
385 | if (!IS_ERR(tc)) { | 376 | if (!IS_ERR(tc)) { |
386 | ret = v9fs_mux_rpc(v9ses->mux, tc, &rc); | 377 | ret = v9fs_mux_rpc(v9ses->mux, tc, &rc); |
@@ -418,7 +409,6 @@ v9fs_t_write(struct v9fs_session_info *v9ses, u32 fid, u64 offset, u32 count, | |||
418 | dprintk(DEBUG_9P, "fid %d offset 0x%llux count 0x%x\n", fid, | 409 | dprintk(DEBUG_9P, "fid %d offset 0x%llux count 0x%x\n", fid, |
419 | (long long unsigned) offset, count); | 410 | (long long unsigned) offset, count); |
420 | 411 | ||
421 | ret = -ENOMEM; | ||
422 | tc = v9fs_create_twrite(fid, offset, count, data); | 412 | tc = v9fs_create_twrite(fid, offset, count, data); |
423 | if (!IS_ERR(tc)) { | 413 | if (!IS_ERR(tc)) { |
424 | ret = v9fs_mux_rpc(v9ses->mux, tc, &rc); | 414 | ret = v9fs_mux_rpc(v9ses->mux, tc, &rc); |