Hi Chang,
Just a point, I don’t know if you need the connect.path to know which of
the paths your resmgr manages, received the open request.
In this case I think it’s not the neatest way. Prefer to use inode or
rdev in the attribute structure.
another method is to overload the attribute structure to store any ‘per
device’ informations as opposed to the ‘per open’ ocb informations.
Otherwise, as you said, allocating and doing whatever you need with your
ocb should be done in the dedicated iofunc_ocb_calloc() function.
DON’T forget to add the needed corresponding free() in iofunc_ocb_free()
in case of an alloc call in iofunc_ocb_calloc().
regards,
Alain.
Chang Im wrote:
“Robert Krten” <> nospam89@parse.com> > wrote in message
news:a9mr3a$7rp$> 1@inn.qnx.com> …
David Gibbs <> dagibbs@qnx.com> > wrote:
[snipped…]
The problem, is that there is an ocb allocated until after you call
iofunc_open_default(), but iofunc_open_default() doesn’t tell you which
OCB it allocated – it doesn’t return the point.
You are correct; there is no clean way of accessing the newly-allocated
OCB
if you use iofunc_open_default(), my mistake.
Cheers,
-RK
Since you’ve extended the OCB, you are over-riding the ocb allocation
function using the iofunc_mount_t structure, right?
Normally, if you have to do any manipulations/initializations of the
OCB, you’ll do them in your allocation structure. It gets past a
resmgr_context_t and a attribute structure, so you should have all
the information you need at that point.
What if I need to copy some data such as connect.path from the io_open_t msg
passed to my io_open() handler into OCB. I don’t think this can be done in
the
OCB allocation routine.
In this case, it seems that I should not use iofunc_open_default(), instead
use
the lower level routines to do it myself:
iofunc_ocb_calloc(), iofunc_ocb_attach() and resmgr_open_bind().
-chang
-David
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.
–
Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at > www.parse.com> .
Email my initials at parse dot com.