linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] print_dev_t for 2.6.0-test1-mm
Date: 16 Jul 2003 20:00:57 -0700	[thread overview]
Message-ID: <bf53h9$ngo$1@cesium.transmeta.com> (raw)
In-Reply-To: 20030716222015.GB1964@win.tue.nl

Followup to:  <20030716222015.GB1964@win.tue.nl>
By author:    Andries Brouwer <aebr@win.tue.nl>
In newsgroup: linux.dev.kernel
> > > 
> > > 16-bit only: 8:8, otherwise 32-bit only: 16:16, otherwise 32:32.
> 
> > Why do we need the 16:16 option?
> 
> It is not very important, but major 0 is reserved, so if userspace
> (or a filesystem) hands us a 32-bit device number, we have to
> split that in some way, not 0+32. Life is easiest with 16+16.
> (Now the major is nonzero, otherwise we had 8+8.)
> Other choices lead to slightly more complicated code.
> 

I would still recommend the arrangement for 64-bit dev_t that I posted
a while ago:

dev_t<63:40> := major<31:8>
dev_t<39:16> := minor<31:8>
dev_t<15:8>  := major<7:0>
dev_t<7:0>   := minor<7:0>

No aliasing, no forbidden bit patterns, no conditional code, no need
for magic numbers, and it's fully compatible with the current
LSB-adjusted user space dev_t format. I also posted i386 code for the
various operations to show that they really can be done with very
little code.

If you want, you can even make it 32-bit-friendly, although it makes
it more complex; for example, this version would implement 32-bit with
a 12:20 split:

dev_t<63:44> := major<31:12>
dev_t<43:32> := minor<31:20>
dev_t<31:28> := major<11:8>
dev_t<27:16> := minor<19:8>
dev_t<15:8>  := major<7:0>
dev_t<7:0>   := minor<7:0>

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

  parent reply	other threads:[~2003-07-17  2:46 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-16 18:46 [PATCH] print_dev_t for 2.6.0-test1-mm Greg KH
2003-07-16 20:09 ` Andrew Morton
2003-07-16 21:02   ` Greg KH
2003-07-16 21:13     ` Andrew Morton
2003-07-16 21:34       ` Andries Brouwer
2003-07-16 21:39         ` Andrew Morton
2003-07-16 22:10           ` H. Peter Anvin
2003-07-16 22:20           ` Andries Brouwer
2003-07-16 22:21             ` Andrew Morton
2003-07-16 23:44               ` Andries Brouwer
2003-07-16 23:49                 ` Andrew Morton
2003-07-17  8:27                   ` Joel Becker
2003-07-17  8:47                     ` Roman Zippel
2003-07-17  9:15                       ` Joel Becker
2003-07-17  9:24                         ` Andrew Morton
2003-07-17 10:10                           ` Trond Myklebust
2003-07-17 11:46                           ` Andries Brouwer
2003-07-17 11:52                         ` Alan Cox
2003-07-17 10:26                   ` Andries Brouwer
2003-07-17 10:46                     ` Miquel van Smoorenburg
2003-07-17 11:19                       ` Andries Brouwer
2003-07-17 11:46                         ` Miquel van Smoorenburg
2003-07-17 21:55                         ` Andrew Morton
2003-07-17 22:24                           ` Andries Brouwer
2003-07-17 22:43                             ` Joel Becker
2003-07-17 23:11                               ` Andries Brouwer
2003-07-17 23:49                                 ` Miquel van Smoorenburg
2003-07-18  0:04                                   ` Andries Brouwer
2003-07-18  0:04                                 ` Joel Becker
2003-07-18  1:05                                   ` Andries Brouwer
2003-07-18  8:06                                     ` Joel Becker
2003-07-17  3:00             ` H. Peter Anvin [this message]
     [not found]             ` <200307170300.UAA24096@cesium.transmeta.com>
2003-07-17 10:43               ` Andries Brouwer
2003-07-20 14:33                 ` H. Peter Anvin
2003-07-16 21:36       ` Greg KH
2003-07-16 22:00         ` Andrew Morton
2003-07-16 22:11           ` what's left for 64 bit dev_t Greg KH
2003-07-16 22:19             ` Andrew Morton
2003-07-16 22:48               ` Greg KH
2003-07-17  3:02                 ` H. Peter Anvin
2003-07-17 13:59               ` Andries Brouwer

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='bf53h9$ngo$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).