Garrett D'Amore wrote:
While this would make some drivers simpler (the lookup of the dev_t
would be simpler), it isn't strictly necessary.
I think you could achieve the same basic result by just offering a new
set of utility routines:
* ddi_set_devt_private(dev_t, void *ctx);
* void *ddi_get_devt_private(dev_t);
This would eliminate the trouble drivers have to go thru to come up with
their own storage and retrieval logic, while not requiring a change to
the entry points.
From an architectural standpoint I agree that common dev_t-to-context
mapping would be nicer, but one can't discount the cost of going to a
hash table (bearing in mind that dev_t space may be sparse, so array
lookup may not be the best implementation). If the cb_op rate is high
then the per-call hash lookup may be significant; which is possibly why
implementation of such context lookup is best left in the hands of the
driver (since it 'knows' its dev_t space and possibly its usage profile).
Having a context pointer in the vnode (or snode) OTOH is simple and
cheap, but does require an interface change.
Paul
--
===================================
Paul Durrant
http://www.linkedin.com/in/pdurrant
===================================
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code