HEADSUP: linux dev_t emulation
Poul-Henning Kamp
phk at phk.freebsd.dk
Thu Mar 10 13:11:46 PST 2005
Linux has only 8 bit major + 8 bit minor dev_t.
We have 8 bit major + 24 bit dev_t.
Obviously, a Linux dev_t cannot be guaranteed to represent
a FreeBSD dev_t correctly.
This used to be a bigger problem because disk partitions
used the upper bit of the minor.
Then it became less of a problem because GEOM numbered
from the bottom at all times.
Now it _may_ be even less of a problem because the FreeBSD
dev_t is now bottom allocated all over.
BUT! That still doesn't change the disparity in size, a fact we
need to keep in mind.
Any Linux program which depends on specific major/minor numbers
will have to be dealt with in some magic manner, I have no idea
which.
I have diked out a lot of code in my development tree and it will
need to get fixed properly before it can work in the new world
order.
The main difference is that when looking up a cdev from a dev_t, a
reference will be gained which must be dropped again.
Whoever is working on Linux emulation should start looking at
p4::phk_bufwork now.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the freebsd-arch
mailing list