I have this dream about how we *should* name things in the
kernel..... but I won't bore you with that just now.
The relevant bit relates to how to map from an open-file-descriptor on
a device (or on a file on a filesystem on a device) to information
about that device.
The only piece of information we can currently get is the device
number (either st_rdev or st_dev).
Using the principle that
"All API extenstions should be done via special filesystems"
the answer has to be that there is filesystem-like-thing that maps
device numbers to their "True Identity".
e.g.
/kernel/devno/3/1 -> /kernel/device/pci/0/00:1f.4/ide/0/0/pc_partition/1
Actually, I would prefer something like:
/kernel/devno/3/1 -> /kernel/disk/3/part/1
together with
/kernel/disk/3/bus -> /kernel/ide/0
/kernel/disk/3/disk BLOCK:3:0
/kernel/disk/3/part/1 BLOCK:3:1
/kernel/disk/3/part/2 BLOCK:3:2
/kernel/ide/0/disk -> /kernel/disk/3
/kernel/ide/0/bus -> /kernel/pci/0/00:1f.4
/kernel/pci/0/00:1f.4/ide -> /kernel/ide/0
and they would be "devlinks", not "symlinks"... but I think I might be
beginning to bore you.
NeilBrown
-
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/