summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDave Jones <davej@suse.de>2002-05-30 20:47:43 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-05-30 20:47:43 -0700
commit60d2ad5f92ed8b8aab58f18a1808a2987fbd6c2e (patch)
tree5985341d7a1e89ba4f49e205729e0cb659d78a6f /include
parent1b3c4f5a3db018d8915e3c5876f29f4baab37972 (diff)
[PATCH] Fix deadlock in nbd
Variant of a patch in 2.4 by Steven Whitehouse.
Diffstat (limited to 'include')
-rw-r--r--include/linux/nbd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 556b847804ca..eae4f5bbb65a 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -20,6 +20,12 @@
#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
#define NBD_DISCONNECT _IO( 0xab, 8 )
+enum {
+ NBD_CMD_READ = 0,
+ NBD_CMD_WRITE = 1,
+ NBD_CMD_DISC = 2
+};
+
#ifdef MAJOR_NR
#include <asm/semaphore.h>
@@ -33,6 +39,8 @@ extern int requests_in;
extern int requests_out;
#endif
+#define nbd_cmd(req) ((req)->cmd[0])
+
static void
nbd_end_request(struct request *req)
{
@@ -68,6 +76,7 @@ struct nbd_device {
struct socket * sock;
struct file * file; /* If == NULL, device is not ready, yet */
int magic; /* FIXME: not if debugging is off */
+ spinlock_t queue_lock;
struct list_head queue_head; /* Requests are added here... */
struct semaphore tx_lock;
};