aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPavel Machek <pavel@suse.cz>2009-04-02 19:58:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-02 22:05:02 -0400
commit15746fcaa3a00753bbab2326088b85b10c1ba36a (patch)
treea61e2e83fc3eaefc62f2e45d1b95125a8180c7ab /drivers/block
parent1a2ad21128bb4eb79f3c05e5801edcc5ed3ef1d3 (diff)
nbd: trivial cleanups
Trivial cleanups for nbd: only the return -EIO one really changes code, and I've verified all the callers (plus 0 == success, 1 == error convention is really ugly). Signed-off-by: Pavel Machek <pavel@suse.cz> Acked-by: Paul Clements <paul.clements@steeleye.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nbd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 5e982814797d..4d6de4f15ccb 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -4,7 +4,7 @@
4 * Note that you can not swap over this thing, yet. Seems to work but 4 * Note that you can not swap over this thing, yet. Seems to work but
5 * deadlocks sometimes - you can not swap over TCP in general. 5 * deadlocks sometimes - you can not swap over TCP in general.
6 * 6 *
7 * Copyright 1997-2000 Pavel Machek <pavel@ucw.cz> 7 * Copyright 1997-2000, 2008 Pavel Machek <pavel@suse.cz>
8 * Parts copyright 2001 Steven Whitehouse <steve@chygwyn.com> 8 * Parts copyright 2001 Steven Whitehouse <steve@chygwyn.com>
9 * 9 *
10 * This file is released under GPLv2 or later. 10 * This file is released under GPLv2 or later.
@@ -276,7 +276,7 @@ static int nbd_send_req(struct nbd_device *lo, struct request *req)
276 return 0; 276 return 0;
277 277
278error_out: 278error_out:
279 return 1; 279 return -EIO;
280} 280}
281 281
282static struct request *nbd_find_request(struct nbd_device *lo, 282static struct request *nbd_find_request(struct nbd_device *lo,
@@ -467,9 +467,7 @@ static void nbd_handle_req(struct nbd_device *lo, struct request *req)
467 mutex_unlock(&lo->tx_lock); 467 mutex_unlock(&lo->tx_lock);
468 printk(KERN_ERR "%s: Attempted send on closed socket\n", 468 printk(KERN_ERR "%s: Attempted send on closed socket\n",
469 lo->disk->disk_name); 469 lo->disk->disk_name);
470 req->errors++; 470 goto error_out;
471 nbd_end_request(req);
472 return;
473 } 471 }
474 472
475 lo->active_req = req; 473 lo->active_req = req;
@@ -531,7 +529,7 @@ static int nbd_thread(void *data)
531 * { printk( "Warning: Ignoring result!\n"); nbd_end_request( req ); } 529 * { printk( "Warning: Ignoring result!\n"); nbd_end_request( req ); }
532 */ 530 */
533 531
534static void do_nbd_request(struct request_queue * q) 532static void do_nbd_request(struct request_queue *q)
535{ 533{
536 struct request *req; 534 struct request *req;
537 535