Re: Issue with limitation of 256 minors per major in LiS 2.16 on Linu x 2.4

"Brian F. G. Bidulock" <[email protected]>
Newsgroups gmane.linux.kernel.streams
Organization http://www.openss7.org/
Message-ID <[email protected]>
Dave,

Actually it mounts over /dev/streams and you can have things like:

 /dev/streams/loop/2134

The maj,min doesn't display quite that way, both 8 bit fields are
the minor, so it displays busted in two.  It is actually the 32 bit 
inode number in the inode that carries the full device number (which can
be a 32-bit minor with no major necessary), which can overlap with Linux
character device numbers.  When drivers are registered, their devices
automagically appear in /dev/streams.  So when the "loop" driver registers,
the subdirectory /dev/streams/loop appears.  When you open
/dev/streams/loop/2134 you open minor number 2134 regardless of whether
an inode exists or not (one is created in the dentry lookup and passed
to dentry_open).  While a stream exists for the specific minor, the minor
number appears in the driver directory.  This precisely the way that
Unix98 /dev/ptys/ is done (on both Linux and UNIX).  If you want to
name your devices different, do this:

 ln -s /dev/loop.2134 /dev/streams/loop/2134

Another nice side-effect is that if you try to open /dev/streams/xyz/2134
and the "xyz" driver is not loaded, it tries to demand load the kernel
module streams-xyz to obtain a registration to satisfy the open request.
Pushable modules can also appear a drivers.  All this magic come from
actually mounting the shadow special filesystem.

Well, its in the documentation.  There is a named-STREAMS device to that
acts as a clone device that uses the name on the inode rather than the
minor number to determine the major and uses the opened minor instead.
This could work with LiS.

--brian


On Thu, 07 Oct 2004, Dave Grothe wrote:

> 
>    At 10:27 AM 10/7/2004, Brian F. G. Bidulock wrote:
> 
>      Dave,
>      What  about non-clone devices?  (Well, I suppose I should just look
>      at the
>      code  instead  of  asking,  but I haven't dug into 2.17 yet...)  On
>      Linux
>      Fast-STREAMS  I  used the inode number (32 bit) in a shadow special
>      filesystem
>      to  represent  the device and there can be the full 32-bit range of
>      real
>      (non-clone) devices.
> 
>    The  problem  with non-clone devices is getting the visible entry into
>    the  /dev  directory.   I  think you are stuck with the 8/8 convention
>    there since that is dictated by the ext2 file system.  Or am I missing
>    something?
>    In other words, I don't think that you could produce something in /dev
>    that would look like this with an ls -l:
>    crw-rw-rw-    1 root     root     1100, 2134 Oct  5 11:45 loop.2134
>    -- Dave

-- 
Brian F. G. Bidulock    ¦ The reasonable man adapts himself to the ¦
[email protected]    ¦ world; the unreasonable one persists in  ¦
http://www.openss7.org/ ¦ trying  to adapt the  world  to himself. ¦
                        ¦ Therefore  all  progress  depends on the ¦
                        ¦ unreasonable man. -- George Bernard Shaw ¦
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.