[Pvfs2-developers] a little help?
Murali Vilayannur
murali.vilayannur at gmail.com
Thu Oct 26 12:27:33 EDT 2006
Hi walt,
Where is this usually done for isys calls that do not complete immediately?
If you look at process_vfs_requests( ), there is a call made to
package_downcall_members( ) which essentially
does the copying to the downcall members and the status/error codes if any.
It also frees up some of the fields
in the vfs_request structures.
Maybe that doesn't matter, if all we need is what you have below, except
> the part where you put the "XX". Surely this isn't the return value of
> the isys call, since that is most likely not what you want (and in fact
> will always be SM_ACTION_TERMINATE in this case).
Correct. it should be set to the sm_p->error_code value, which brings me to
the question how do we get to that
if the isys interface call does not return that if it finished immediately?
Right now, we get to the error code by calling sys_testsome( )...
Also, I now realize that my code fragment was incorrect. The attached code
fragment should work though..
switch(ret) {
case SM_ACTION_TERMINATE:
int error = XX <error code of the SM>;
package_downcall_members(vfs_request, &error)
write_inlined_device_response(vfs_request);
/* Fall through */
case 0:
if (vfs_request->was_handled_inline) {
ret = repost_unexp_vfs_request(vfs_request, "..");
}
...
Thanks,
Murali
....
> >
> > perhaps that explained it a little better I hope,
> > thanks,
> > Murali
> >
> > Walt
> >
> >>
> >> Murali Vilayannur wrote:
> >> > Hi Walt,
> >> >
> >> >> Maybe it would be simpler to modify the code as shown:
> >> >>
> >> >> >> /*
> >> >> >> check if we need to repost the operation (in case of
> failure
> >> or
> >> >> >> inlined handling/completion)
> >> >> >> */
> >> >> >> switch(ret)
> >> >> >> {
> >> >> case SM_ACTION_TERMINATE:
> >> >> vfs->request->was_handled_inline = 1;
> >> >
> >> >
> >> >
> >> >
> >> > Ok, that works too :)
> >> > Just remember to copy the results to the downcall (calling the
> >> > write_inlined_device_response should do the trick)
> >> > before reposting the op.
> >> > thanks,
> >> > Murali
> >> >
> >> >> /* this code falls through to the next case */
> >> >> >> case 0:
> >> >> >> {
> >> >> >> /*
> >> >> >> if we've already completed the operation, just
> repost
> >> >> >> the unexp request
> >> >> >> */
> >> >> >> if (vfs_request->was_handled_inline)
> >> >> >> {
> >> >> >> ret = repost_unexp_vfs_request(
> >> >> >> vfs_request, "inlined completion");
> >> >> >> }
> >> >> >> else
> >> >> >> {
> >> >> >
> >> >> >
> >> >> > What we could do to retain this part of the code is to set the
> >> >> > ->was_handled_inline member variable in all the post_*_request()
> >> >> functions
> >> >> > if the PVFS_isys_*() function indicated that the posted operation
> >> >> finished
> >> >> > immediately.
> >> >> > If we do that, then we could retain this code as is without adding
> >> any
> >> >> > more cases. Great catch!
> >> >> > thanks,
> >> >> > Murali
> >> >> >
> >> >> >
> >> >> >> /*
> >> >> >> otherwise, we've just properly posted a
> >> non-blocking
> >> >> >> op; mark it as no longer a dev unexp msg and
> add
> >> it
> >> >> >> to the ops in progress table
> >> >> >> */
> >> >> >> vfs_request->is_dev_unexp = 0;
> >> >> >> ret =
> add_op_to_op_in_progress_table(vfs_request);
> >> >> >>#if 0
> >> >> >> assert(is_op_in_progress(vfs_request));
> >> >> >>#endif
> >> >> >> }
> >> >> >> }
> >> >> >> break;
> >> >> >> case REMOUNT_PENDING:
> >> >> >> ret = repost_unexp_vfs_request(
> >> >> >> vfs_request, "mount pending");
> >> >> >> break;
> >> >> >> case OP_IN_PROGRESS:
> >> >> >> ret = repost_unexp_vfs_request(
> >> >> >> vfs_request, "op already in progress");
> >> >> >> break;
> >> >> >> default:
> >> >> >> PVFS_perror_gossip("Operation failed", ret);
> >> >> >> ret = repost_unexp_vfs_request(
> >> >> >> vfs_request, "failure");
> >> >> >> break;
> >> >> >> }
> >> >> >> return ret;
> >> >> >>}
> >>
> >> --
> >> Dr. Walter B. Ligon III
> >> Associate Professor
> >> ECE Department
> >> Clemson University
> >>
> >
>
> --
> Dr. Walter B. Ligon III
> Associate Professor
> ECE Department
> Clemson University
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.beowulf-underground.org/pipermail/pvfs2-developers/attachments/20061026/5db80556/attachment.htm
More information about the Pvfs2-developers
mailing list