On Tue, 11 Jan 2000, David Grothe wrote:
> Alexander Viro wrote:
>
> > _All_ ->u is off-limits for any device code. It
> > belongs to hosting filesystem and to nobody else.
>
> If a driver needs to have a private structure that associates with each "real"
> file (inode instance) then what is the recommended technique? Private hash
> table on major/minor? What is the officially recommended technique here.
>
> I obviously misunderstood that the generic_ip was like a private structure
> pointer in a number of other kernel control structures, such as net_device.
Hold on. Inode is not a good thing here - if (_big_ if) you need per-file
data - refer to it from struct file (that is, if you really need it on
per-opener basis; _very_ rare situation). If you need it on per-device -
keep it in the driver. Inode gives either too coarse or too fine
granularity here - there may be a lot of independent openers of inode and
there may be many inodes pointing to your device. In effect, device inode
acts as a sort of symlink - just that it points into other namespace.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:18 EST