patch-2.4.0-test2 linux/drivers/block/nbd.c
Next file: linux/drivers/block/paride/paride.c
Previous file: linux/drivers/block/md.c
Back to the patch index
Back to the overall index
- Lines: 38
- Date:
Wed Jun 21 22:31:00 2000
- Orig file:
v2.4.0-test1/linux/drivers/block/nbd.c
- Orig date:
Tue Apr 11 15:09:16 2000
diff -u --recursive --new-file v2.4.0-test1/linux/drivers/block/nbd.c linux/drivers/block/nbd.c
@@ -38,6 +38,8 @@
#include <linux/ioctl.h>
#include <net/sock.h>
+#include <linux/devfs_fs_kernel.h>
+
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <asm/types.h>
@@ -53,6 +55,7 @@
static u64 nbd_bytesizes[MAX_NBD];
static struct nbd_device nbd_dev[MAX_NBD];
+static devfs_handle_t devfs_handle = NULL;
#define DEBUG( s )
/* #define DEBUG( s ) printk( s )
@@ -514,12 +517,20 @@
register_disk(NULL, MKDEV(MAJOR_NR,i), 1, &nbd_fops,
nbd_bytesizes[i]>>9);
}
+ devfs_handle = devfs_mk_dir (NULL, "nbd", 0, NULL);
+ devfs_register_series (devfs_handle, "%u", MAX_NBD,
+ DEVFS_FL_DEFAULT, MAJOR_NR, 0,
+ S_IFBLK | S_IRUSR | S_IWUSR,
+ &nbd_fops, NULL);
+
return 0;
}
#ifdef MODULE
void cleanup_module(void)
{
+ devfs_unregister (devfs_handle);
+
if (unregister_blkdev(MAJOR_NR, "nbd") != 0)
printk("nbd: cleanup_module failed\n");
else
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)