mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: Andries.Brouwer@cwi.nl, zippel@linux-m68k.org
Cc: Joel.Becker@oracle.com, akpm@digeo.com,
	andrey@eccentric.mae.cornell.edu, linux-kernel@vger.kernel.org,
	torvalds@transmeta.com
Subject: Re: major/minor split
Date: Fri, 21 Mar 2003 08:35:07 +0100 (MET)	[thread overview]
Message-ID: <UTC200303210735.h2L7Z7Q26322.aeb@smtp.cwi.nl> (raw)

    From: Roman Zippel <zippel@linux-m68k.org>

    > > There is a point I'd like to get clear: where should the
    > > 16bit<->32bit dev_t conversion happen?
    > 
    > ..., there is no conversion
    > (other than the lengthening that happens when one
    > casts an unsigned short to an unsigned int).

    Let's look at ext2:

        if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode))
            raw_inode->i_block[0] = cpu_to_le32(kdev_t_to_nr(inode->i_rdev));

    Should the saved device number be a 16bit or a 32bit device number?
    Has the user any control over it?

It used to be a 32-bit device number. If we want to store
a 64-bit device number then also raw_inode->i_block[1]
is used. Fortunately ext2 has lots of room there.

No, the kernel code does what it does - user space does not influence this.

    > > how can software create nodes for a specific device?
    > 
    > You do not mean using mknod?

    I mean via mknod, e.g. if the user has a major/minor number,
    how should it be converted to a dev_t number?

The proper way is using the makedev macro in <sys/sysmacros.h>.
But in times of change you have to do everything by hand.
glibc still has to be updated.
(Steal the MKDEV macro from the kernel setup.)

Since new dev_t is compatible with old dev_t you need not
recompile or upgrade glibc or so, unless you actually want
to use more than 16 bits.

Andries


             reply	other threads:[~2003-03-21  7:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-21  7:35 Andries.Brouwer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-20 22:24 Andries.Brouwer
2003-03-20 23:23 ` Roman Zippel
2003-03-21  0:04   ` H. Peter Anvin
2003-03-20 23:52 ` H. Peter Anvin
2003-03-19 21:40 Andries.Brouwer
2003-03-20 21:00 ` Roman Zippel
2003-03-20 21:47   ` Joel Becker
2003-03-20 22:03     ` Joel Becker

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=UTC200303210735.h2L7Z7Q26322.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=Joel.Becker@oracle.com \
    --cc=akpm@digeo.com \
    --cc=andrey@eccentric.mae.cornell.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=zippel@linux-m68k.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®