Skip to contentSkip to conversation

Larger dev_t

DISCUSSION John Byrne 3 participants 3 messages Mar 26, 2001

lore
Share & tools
lore

John Byrne

author
#0 lore raw
Quoted 2 lines

Re: Larger dev_t

Quoted 5 lines · On Sat Mar 24 2001 Linus Torvalds ([email protected]) wrote:

There is no way in HELL I will ever accept a 64-bit dev_t.

I _will_ accept a 32-bit dev_t, with 12 bits for major numbers, and 20 bits for minor numbers.

Do you have any interest in doing away with the concept of major and minor numbers altogether; turning the dev_t into an opaque unique id?

At the application level, the kinds of information that is derived from the major/minor number should probably be derived in some other manner such as a library or system call. Code that determines device type by comparing with the major/minor numbers should probably be discouraged in the long run and this could be a good time to start.

John Byrne

#1 lore raw
Quoted 10 lines · John Byrne
Quoted 2 lines

Re: Larger dev_t

Quoted 4 lines · On Sat Mar 24 2001 Linus Torvalds ([email protected]) wrote:

There is no way in HELL I will ever accept a 64-bit dev_t.

I _will_ accept a 32-bit dev_t, with 12 bits for major numbers, and 20 bits for minor numbers.

Do you have any interest in doing away with the concept of major and minor numbers altogether; turning the dev_t into an opaque unique id?

Inside the kernel we'll eventually do that.

However, outside the kernel you still need the notion of device numbers if for no other reasons than legacy /dev space (other applications like 'tar' care too, but they only care about uniqueness, not about much else).

Quoted 3 lines

At the application level, the kinds of information that is derived from the major/minor number should probably be derived in some other manner such as a library or system call.

It is. It's called "stat()", and a lot of people do depend on a device number being available. Few people care what that number actually _is_, though.

So device numbers aren't going away, they are very much part of the UNIX legacy. We don't need to care about them too much inside the kernel, though. What most drivers really want to know is "sub-unit number", and not much else.

Linus

#2 lore raw
In reply to John Byrne
Quoted 8 lines · John Byrne

Do you have any interest in doing away with the concept of major and minor numbers altogether; turning the dev_t into an opaque unique id?

At the application level, the kinds of information that is derived from the major/minor number should probably be derived in some other manner such as a library or system call. Code that determines device type by comparing with the major/minor numbers should probably be discouraged in the long run and this could be a good time to start.

Programs that use explicit major/minor information are probably broken or at least very nonportable.
On the other hand, unfortunately the Unix API has a few explicit occurrences of major/minor. For example, one has ls(1) and mknod(1).