From: Andries Brouwer <aebr@win.tue.nl>
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: linux-kernel@vger.kernel.org, linus@transmeta.com
Subject: Re: [CFT] more kdev_t-ectomy
Date: Sun, 20 Apr 2003 18:00:34 +0200 [thread overview]
Message-ID: <20030420160034.GA20123@win.tue.nl> (raw)
In-Reply-To: <20030420133143.GF10374@parcelfarce.linux.theplanet.co.uk>
On Sun, Apr 20, 2003, viro@parcelfarce.linux.theplanet.co.uk
wrote:
[lots of useful stuff].
Happy Easter!
Concerning kdev_t vs dev_t, probably I said this before, but just to be sure:
Long ago the purpose of kdev_t was to become a pointer. Roughly speaking
we got that pointer, only it is called struct gendisk * today.
Today the purpose of kdev_t is to be a form of dev_t: taking the minor
of a kdev_t is just taking the lower 32 bits, no tests, no branches;
taking the minor of a dev_t requires tests and branches - more code,
slower code.
So, the interface with filesystems and with userspace has dev_t.
For kernel-internal numbers kdev_t is better than dev_t.
Of course it may be possible to avoid kernel-internal numbers altogether.
Sometimes that is an improvement, sometimes not. Pointers are more
complicated than numbers - they point at something that must be allocated
and freed and reference counted. A number is like a pointer without the
reference counting.
Andries
next prev parent reply other threads:[~2003-04-20 15:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-20 13:31 [CFT] more kdev_t-ectomy viro
2003-04-20 15:26 ` Muli Ben-Yehuda
2003-04-20 16:00 ` Andries Brouwer [this message]
2003-04-20 19:24 ` viro
2003-04-20 21:10 ` H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2003-04-20 21:17 Andries.Brouwer
2003-04-20 21:26 ` viro
2003-04-20 21:58 Andries.Brouwer
2003-04-20 22:35 ` viro
2003-04-20 23:56 Andries.Brouwer
2003-04-21 0:15 ` H. Peter Anvin
2003-04-21 0:35 ` viro
2003-04-21 1:32 Andries.Brouwer
2003-04-21 3:54 ` H. Peter Anvin
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=20030420160034.GA20123@win.tue.nl \
--to=aebr@win.tue.nl \
--cc=linus@transmeta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/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 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.