Paul Durrant wrote:
Darren Reed wrote:

What I'd like to suggest is that we consider expanding the entry
points for regular device drivers to allow for context to be created
in open(9e), passed back in with all of the other entry points (read,
write, strategy, etc) and require the driver to clear it in close(9e).

This would change function prototypes to be something like:

int prefixopen(dev_t *devp, int flag, int otyp, cred_t *cred_p, void **ctxp);
int prefixread(dev_t dev, struct uio *uio_p, cred_t *cred_p, void *ctx);
int prefixclose(dev_t dev, int flag, int otyp, cred_t *cred_p, void **ctxp);

and so forth.

For existing drivers, not changing "ctxp" would result in NULL being
passed into the driver as the "ctx" pointer.

Thoughts?

I assume you'd bump CB_REV for drivers interpreting the new argument? I assume that your plan is to store the context pointer in the struct vnode?
Why not struct snode? I assume context is not needed in interrupt handlers (always interrupt context). The strategy routine is often called without user context (in ZFS, almost always without user context). I don't think the current solution of leaving it up to driver writers is so great an imposition as to warrant this. It seems this is trying to solve a problem that is not really a problem.
Or am I missing something?  Can you give an example using this?

thanks,

max

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to