summaryrefslogtreecommitdiffstats
path: root/drivers/block/nbd.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
commit46e045034336a2cc90c1798cd7cc07af744ddfd6 (patch)
tree3b9b51fc482e729f663d25333e77fbed9aaa939a /drivers/block/nbd.c
parent31dc59d503a02e84c4de98826452acaeb56dc15a (diff)
Merge with Linux 2.3.99-pre4.
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r--drivers/block/nbd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 0c3f5429f..b21be6bd2 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -350,6 +350,7 @@ static int nbd_ioctl(struct inode *inode, struct file *file,
{
struct nbd_device *lo;
int dev, error, temp;
+ struct request sreq ;
/* Anyone capable of this syscall can do *real bad* things */
@@ -363,6 +364,13 @@ static int nbd_ioctl(struct inode *inode, struct file *file,
lo = &nbd_dev[dev];
switch (cmd) {
+ case NBD_DISCONNECT:
+ printk("NBD_DISCONNECT\n") ;
+ sreq.cmd=2 ; /* shutdown command */
+ if (!lo->sock) return -EINVAL ;
+ nbd_send_req(lo->sock,&sreq) ;
+ return 0 ;
+
case NBD_CLEAR_SOCK:
down(&lo->queue_lock);
nbd_clear_que(lo);