patch-2.3.99-pre4 linux/drivers/block/nbd.c
Next file: linux/drivers/block/paride/pcd.c
Previous file: linux/drivers/block/md.c
Back to the patch index
Back to the overall index
- Lines: 22
- Date:
Tue Apr 11 06:59:13 2000
- Orig file:
v2.3.99-pre3/linux/drivers/block/nbd.c
- Orig date:
Sun Mar 19 18:35:30 2000
diff -u --recursive --new-file v2.3.99-pre3/linux/drivers/block/nbd.c linux/drivers/block/nbd.c
@@ -350,6 +350,7 @@
{
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 @@
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);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)