Re: nbd diffs for 2.3 devfs

From: Pavel Machek (pavel@suse.cz)
Date: Sun May 28 2000 - 12:27:18 EST


Hi!

Alan, this is patch from Dave approved by maintainer (me), which adds
devfs registration to nbd. It can't hurt anything, please apply.

                                                        Pavel

PS: Dave, if this does not make it into 2.4.0, resubmit it to Linus,
saying I approved it.

> nbd.c 2.3.99.pre6 devfs diffs in diff -u:
>
> Cheers,

--- linux/drivers/block/nbd.c Tue Apr 11 09:59:13 2000
+++ linux-2.3.99pre6io/drivers/block/nbd.c Sun May 28 09:25:58 2000
@@ -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, 0, 0,
+ &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

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents me at discuss@linmodems.org

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:19 EST