lkml.org 
[lkml]   [1999]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: More on bigger kdev_t
    From: Jeff Garzik <jgarzik@pobox.com>

Andries.Brouwer@cwi.nl wrote:

> But kdev_t is kernel-internal.
> Whatever the kernel chooses is completely invisible
> for user space. Its identity is hidden inside kdev_t.h,
> even the rest of the kernel doesn't know.
>
> If I boot a kernel on Friday, kdev_t is a pointer to a structure,
> on the other days it is a 32-bit integer.
> *Nothing* in userland depends on kdev_t.

Technical true, but changing it DOES affect userland: there is still
code which assumes things about the size of major/minor numbers.

You don't understand.
kdev_t is a data type, something like int or struct inode *.
This data type holds certain data, or points at certain data.
Just for the kernel's internal pleasure.
There are *no* kernel interfaces, not really, that show a
kdev_t to userspace. So it is impossible that userland
is affected.

Major and minor numbers are not involved at all.
And if they are, then only the kernel-internal major and minor
numbers, which are rather unrelated to those used in userland.

Look at the assignment of ROOT_DEV in the various architectures.

OK, I look.
ROOT_DEV = MKDEV(FLOPPY_MAJOR, 0);
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
ROOT_DEV = to_kdev_t(0x0802);
Where is userland? This is kernel code.


> Yes. And making kdev_t a pointer to a structure is just as easy.

Making kdev_t a structure is obviously the eventual, and best solution.
But I disagree that making it a pointer is the easiest thing to do, or
that another large array is the way to go. By keeping kdev_t an lvalue

But a pointer to a structure *is* an lvalue.

you make it easier to update current code which doesn't use kdev_t.h
macros, or is in some other way "hairy".

Or to put it another way, keeping kdev_t an lvalue is the quickest
method to get me to the end result of larger major/minor numbers.

But a pointer to a structure *is* an lvalue.

Andries

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.031 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site