Skip to content

Commit

Permalink
nbd: trivial cleanups
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Machek authored and Linus Torvalds committed Apr 3, 2009
1 parent 1a2ad21 commit 15746fc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Note that you can not swap over this thing, yet. Seems to work but
* deadlocks sometimes - you can not swap over TCP in general.
*
* Copyright 1997-2000 Pavel Machek <pavel@ucw.cz>
* Copyright 1997-2000, 2008 Pavel Machek <pavel@suse.cz>
* Parts copyright 2001 Steven Whitehouse <steve@chygwyn.com>
*
* This file is released under GPLv2 or later.
Expand Down Expand Up @@ -276,7 +276,7 @@ static int nbd_send_req(struct nbd_device *lo, struct request *req)
return 0;

error_out:
return 1;
return -EIO;
}

static struct request *nbd_find_request(struct nbd_device *lo,
Expand Down Expand Up @@ -467,9 +467,7 @@ static void nbd_handle_req(struct nbd_device *lo, struct request *req)
mutex_unlock(&lo->tx_lock);
printk(KERN_ERR "%s: Attempted send on closed socket\n",
lo->disk->disk_name);
req->errors++;
nbd_end_request(req);
return;
goto error_out;
}

lo->active_req = req;
Expand Down Expand Up @@ -531,7 +529,7 @@ static int nbd_thread(void *data)
* { printk( "Warning: Ignoring result!\n"); nbd_end_request( req ); }
*/

static void do_nbd_request(struct request_queue * q)
static void do_nbd_request(struct request_queue *q)
{
struct request *req;

Expand Down

0 comments on commit 15746fc

Please sign in to comment.