diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
commit | 1471f525455788c20b130690e0f104df451aeb43 (patch) | |
tree | 3778beba56558beb9a9548ea5b467e9c44ea966f /include/linux/nbd.h | |
parent | e80d2c5456d30ebba5b0eb8a9d33e17d815d4d83 (diff) |
Merge with Linux 2.3.51.
Diffstat (limited to 'include/linux/nbd.h')
-rw-r--r-- | include/linux/nbd.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index e5194b28f..cdd77e932 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -30,22 +30,35 @@ extern int requests_in; extern int requests_out; #endif -static void +static int nbd_end_request(struct request *req) { unsigned long flags; + int ret = 0; #ifdef PARANOIA requests_out++; #endif + /* + * This is a very dirty hack that we have to do to handle + * merged requests because end_request stuff is a bit + * broken. The fact we have to do this only if there + * aren't errors looks even more silly. + */ + if (!req->errors) { + req->sector += req->current_nr_sectors; + req->nr_sectors -= req->current_nr_sectors; + } + spin_lock_irqsave(&io_request_lock, flags); if (end_that_request_first( req, !req->errors, "nbd" )) goto out; + ret = 1; end_that_request_last( req ); out: spin_unlock_irqrestore(&io_request_lock, flags); - return; + return ret; } #define MAX_NBD 128 @@ -56,7 +69,6 @@ struct nbd_device { int harderror; /* Code of hard error */ #define NBD_READ_ONLY 0x0001 #define NBD_WRITE_NOCHK 0x0002 -#define NBD_INITIALISED 0x0004 struct socket * sock; struct file * file; /* If == NULL, device is not ready, yet */ int magic; /* FIXME: not if debugging is off */ |