From: Linus Torvalds <torvalds@transmeta.com>
To: zaitcev@redhat.com
To: Trond Myklebust <trond.myklebust@fys.uio.no>,
Neil Brown <neilb@cse.unsw.edu.au>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: NFS "dev_t" issues..
Date: Tue, 1 Jan 2002 14:15:58 -0800 (PST) [thread overview]
Message-ID: <mailman.1009923541.1261.linux-kernel2news@redhat.com> (raw)
I made a pre6, which contains a new-and-anal "kdev_t".
The format of the thing is the same as it used to be, ie 16 bits of
information, but I made it a structure so that you _couldn't_ mix up
"dev_t" and "kdev_t", or use the "kdev_t" as a number (so when kdev_t
expands to 12+20 bits later in 2.5.x you shouldn't get surprises)
I fixed up the stuff I use and which showed up in compiles (on a source
level, it's so far totally untested), but I'd really like people to check
out their own subsystems. _Especially_ NFS and NFSD, which had several
cases of mixing the two dev_t's around, and which also used them as
numbers. Trond, Neil?
Because the types aren't at all compatible any more, the macros that are
used for user-level "dev_t" are no longer working for a kdev_t. So we have
dev_t kdev_t
MKDEV(major,minor) mk_kdev(major, minor)
MAJOR(dev) major(dev)
MINOR(dev) minor(dev)
dev == dev2 kdev_same(dev, dev2)
!dev kdev_none(dev)
and _most_ of the time the fixes are trivial - just translate as above. It
only gets interesting when you have code that looks at the value or starts
mixing the two and compares a "dev_t" against a "kdev_t", which can be
quite interesting.
The knfsd file handle thing is also an issue - Neil, please check out that
what I did looks sane, and would be on-the-wire-compatible with the old
behaviour, even when we expand kdev_t to 12+20 bits, ok?
(Marcelo, for easier backporting of drivers to 2.4.x, we'll probably want
to eventually add
#define mk_kdev(a,b) MKDEV(a,b)
#define major(d) MAJOR(d)
...
to the 2.4.x <linux/kdev_t.h> so that you can move drivers back and
forth).
Apart from some knfsd issues, most of the kdev_t users were proper. The
strict type-checking found one bug in the SCSI layer (which I knew about,
and was one of the impetuses for doing it in the first place), and found a
lot of small "works-but-will-break-with-a-bigger-kdev_t" issues).
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2002-01-01 22:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-01 22:15 Linus Torvalds [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-01-02 4:52 NFS "dev_t" issues Andries.Brouwer
2002-01-01 22:15 Linus Torvalds
2002-01-01 22:57 ` Alexander Viro
2002-01-01 23:27 ` Linus Torvalds
2002-01-02 5:45 ` Greg KH
2002-01-07 16:50 ` Trond Myklebust
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=mailman.1009923541.1261.linux-kernel2news@redhat.com \
--to=torvalds@transmeta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=zaitcev@redhat.com \
/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