mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Will Dyson" <will.dyson@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Joshua Hudson" <joshudson@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [GIT PATCH] Remove devfs from 2.6.17
Date: Mon, 19 Jun 2006 01:55:37 -0400	[thread overview]
Message-ID: <8e6f94720606182255u400964c2v1ea16221ffc5c94d@mail.gmail.com> (raw)
In-Reply-To: <4495FF59.2010100@zytor.com>

On 6/18/06, H. Peter Anvin <hpa@zytor.com> wrote:
> Joshua Hudson wrote:
> > With udev, you could mknod it yourself (in your application), then open it.
> > That would fire up the auto-module-load.
>
> Sure, but it would be even better if pointing udev to a set of modules
> (or perhaps a file generated by depmod) and have it do it all automatically.

Providing the information about what devices a virtual driver will
register when loaded seems like a good idea.

Something like the following occurs to me. But it doesn't deal with
loop's ability to register a different number of minors based on a
module parameter. Not really sure what to do about that.

Going in this direction is also a further impediment to dynamicly
assigned device numbers.

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 9c3b94e..b933f3f 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1205,6 +1205,18 @@ static struct block_device_operations lo
 	.ioctl =	lo_ioctl,
 };

+static struct virtual_device_table loop_virt_tbl= {
+	{LOOP_MAJOR, 0, 1},
+	{LOOP_MAJOR, 1, 1},
+	{LOOP_MAJOR, 2, 1},
+	{LOOP_MAJOR, 3, 1},
+	{LOOP_MAJOR, 4, 1},
+	{LOOP_MAJOR, 5, 1},
+	{LOOP_MAJOR, 6, 1},
+	{LOOP_MAJOR, 7, 1},
+	{}
+};
+
 /*
  * And now the modules code and kernel interface.
  */
@@ -1212,6 +1224,7 @@ module_param(max_loop, int, 0);
 MODULE_PARM_DESC(max_loop, "Maximum number of loop devices (1-256)");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_BLOCKDEV_MAJOR(LOOP_MAJOR);
+MODULE_DEVICE_TABLE (virtual, loop_virt_tbl);

 int loop_register_transfer(struct loop_func_table *funcs)
 {
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index f697770..f4a21d0 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -297,4 +297,16 @@ struct input_device_id {
 	kernel_ulong_t driver_info;
 };

+/*
+ * Declare the intention of a driver to register a virtual
+ * device upon loading.
+ */
+struct virtual_device_id {
+	__u32 major;
+	__u32 minor;
+	__u8 type; /* 0 for char, 1 for block */
+
+	kernel_ulong_t driver_info;
+}
+
 #endif /* LINUX_MOD_DEVICETABLE_H */


-- 
Will Dyson

  reply	other threads:[~2006-06-19  5:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18 22:13 Greg KH
2006-06-18 22:45 ` Michal Piotrowski
2006-06-18 23:06   ` Greg KH
2006-06-18 23:00 ` Samuel Thibault
2006-06-18 23:12   ` Greg KH
2006-06-18 23:35     ` Samuel Thibault
2006-06-19  0:48       ` Nick Piggin
2006-06-19  3:22       ` Greg KH
2006-06-19  8:23         ` Samuel Thibault
2006-06-19  9:30           ` Marcel Holtmann
2006-06-19  9:39             ` Samuel Thibault
2006-06-19 10:22               ` Marcel Holtmann
2006-06-19  0:54   ` H. Peter Anvin
2006-06-19  1:17     ` Joshua Hudson
2006-06-19  1:35       ` H. Peter Anvin
2006-06-19  5:55         ` Will Dyson [this message]
2006-06-19  7:14           ` Alexander E. Patrakov
2006-06-19 22:14             ` Daniel Barkalow
2006-06-19 22:17               ` H. Peter Anvin
2006-06-19  3:15     ` Greg KH
2006-06-19  8:52       ` Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e6f94720606182255u400964c2v1ea16221ffc5c94d@mail.gmail.com \
    --to=will.dyson@gmail.com \
    --cc=hpa@zytor.com \
    --cc=joshudson@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®