All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: On re-working the major/minor system
@ 2001-12-09 21:37 Andries.Brouwer
  0 siblings, 0 replies; 13+ messages in thread
From: Andries.Brouwer @ 2001-12-09 21:37 UTC (permalink / raw)
  To: kaih, linux-kernel

    From: kaih@khms.westfalen.de (Kai Henningsen)

    > The C library, and the POSIX standard, etc, etc.

    I think you'll find that there is *NOTHING* in either the C standard,  
    POSIX, or the Austin future-{POSIX,UNIX} standard that knows about major  
    or minor numbers.

The Austin draft turned into POSIX 1003.1-2001 yesterday or so.

There is not much, but a few traces can be found.
For example, the pax archive format uses 8-byte devmajor and devminor fields.

(But to reassure others: no, this standard does not specify
major and minor in ls output, but just says
"If the file is a character special or block special file, the size of
 the file may be replaced with implementation-defined information
 associated with the device in question.")

Andries



^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: On re-working the major/minor system
@ 2001-12-08 17:55 Andries.Brouwer
  0 siblings, 0 replies; 13+ messages in thread
From: Andries.Brouwer @ 2001-12-08 17:55 UTC (permalink / raw)
  To: andersen; +Cc: alan, dalecki, linux-kernel, torvalds

    From: Erik Andersen <andersen@codepoet.org>

    So we have POSIX, ls, tar, du, mknod, and mount and tons of other
    apps all with illicit insider knowledge of what a dev_t looks
    like.

    To currently, to do pretty much anything nifty related to devices
    in usespace, usespace has to peek under the kernel's skirt to
    know how to change a major and minor number into a dev_t and/or
    to sanely populate a struct stat.

    To change things, we 1) need some sortof sane interface by which
    userspace can refer sensibly to devices without resorting to evil
    illicit macros and 2) we certainly need some sort of a static
    mapping such that existing devices end up mapping to the same
    thing they always did or 3) we will need a flag day where we say
    that all pre-2.5.x created tarballs and user space apps are
    declared broken...

No flag day required. These things have been discussed
many times already, and there are easy and good solutions.

Code like

	dev_t dev;
	u64 d = dev;
	int major, minor;

	if (d & ~0xffffffff) {
		major = (d >> 32);
		minor = (d & 0xffffffff);
	} else if (d & ~0xffff) {
		major = (d >> 16);
		minor = (d & 0xffff);
	} else {
		major = (d >> 8);
		minor = (d & 0xff);
	}

will handle dev_t fine, regardless of whether it is 16, 32 or 64 bits.
You see that change of the size of dev_t does not change the values
of major and minor found in your tarballs.
We already use such code for isofs.

Andries

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: Linux/Pro  -- clusters
@ 2001-12-07 10:56 Martin Dalecki
  2001-12-07 12:08 ` Alan Cox
  0 siblings, 1 reply; 13+ messages in thread
From: Martin Dalecki @ 2001-12-07 10:56 UTC (permalink / raw)
  To: Alan Cox; +Cc: dalecki, Linus Torvalds, linux-kernel

Alan Cox wrote:

> > For example please grep for the MINOR() macro in the scsi layer...
> > Most of the places where it's used should be replaced by a simple
> > driver instance enumerator. I did this once already, so this is for
> > sure.
> 
> it become block_device->instance or ->minor

Well if all the infromation those functions are needing would
be already in block_device in place, that it could become as easy
as just passing &block_device there.
However please note that replacing kdev_t in the scsi layer
with just passing the minor can be done already *now* without
any pain. The same applies to the excessive MINOR lookups in the
v4l code. I did this already some time ago  (patch was here - about one
year ago)
 
> major/minors for old stuff still end up leaking into user space and
> mattering there. I'm not sure the best option for that

Thta's no problem. But they should be used as hash values no the
syscall implementation level and nowhere else.

-- 
- phone: +49 214 8656 283
- job:   eVision-Ventures AG, LEV .de (MY OPINIONS ARE MY OWN!)
- langs: de_DE.ISO8859-1, en_US, pl_PL.ISO8859-2, last ressort:
ru_RU.KOI8-R

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-12-11 20:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-09 21:37 On re-working the major/minor system Andries.Brouwer
  -- strict thread matches above, loose matches on Subject: below --
2001-12-08 17:55 Andries.Brouwer
2001-12-07 10:56 Linux/Pro -- clusters Martin Dalecki
2001-12-07 12:08 ` Alan Cox
2001-12-07 20:51   ` On re-working the major/minor system Erik Andersen
2001-12-07 21:21     ` H. Peter Anvin
2001-12-07 21:55       ` Erik Andersen
2001-12-07 22:04         ` H. Peter Anvin
2001-12-07 23:07           ` Erik Andersen
2001-12-07 23:12             ` H. Peter Anvin
2001-12-08 11:42               ` Alan Cox
2001-12-08 20:37                 ` H. Peter Anvin
2001-12-09 12:06         ` Kai Henningsen
2001-12-09 21:57           ` H. Peter Anvin
2001-12-11 20:45             ` Kai Henningsen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.