It will be inconvenient, but it sounds like you need to add states to each affected state machine. You should jump to a new state machine that performs your special processing. Control will not return to the calling state machine until your new state machine has completed.
Thanks, Elaine 2011/9/6 欧佳欣 <[email protected]> > My new function is called when the following circumstance happens : > when the state machine that listed in the src/server,such as > readdir.sm,want to call the function in the dbpf-keyval.c or dbpf-dspace.c > through the related interface. > for example , in readdir.sm , the state 'readdir_iterate_on_entries' > want to call the function 'dbpf_keyval_iterate' in dbpf-keyval.c. Then at > this time ,I want to call my new function before it calls the function > dbpf_keyval_iterate.In fact , my new function is a function of post a new > state machine , and I need that the state 'readdir_iterate_on_entries' > doesn't call the dbpf_keyval_iterate until the new state machine which > posted by my new function has already completed(the new state machine > :smcb->terminate==1). > So at first I want to write this part of the code in the top of the > function 'dbpf_keyval_iterate',and also write a new testing function to > test the new posted state machine's complete state (to check whether the > smcb->terminate equals 1). > I may move this part of the code to the server module, but if I really > use this method , I must modify the code in all state machine which calls > the function 'dbpf_keyval_iterate' in its code. > but the function 'dbpf_keyval_iterate' in dbpf_keyval.c is just one of > the trove method I want to modify ,I also want to modify the function > dbpf_keyval_read,dbpf_keyval_read_list....... > So if I add this part of the code in trove module , I just need to add > it to the top of all the function which I want to modify , such as > dbpf_keyval_iterate,dbpf_keyval_read...... > But if I add it to the server part , I must modify all the state > machine which calls these functions. > so ,that's my problems , and I am not sure I explained it clearly.Can > you give me some suggestion for my problem? > In the previous email , you suggest me to run my function upon > returning to the calling function that resides in pvfs2-server.c , I think > it infeasiable , for my idea is that the state machine doesn't call some > special function in trove module until the new state machine that my > function posted has already been completed. > > ** > > > ------------------ 原始邮件 ------------------ > *发件人:* "Elaine Quarles"<[email protected]>; > *发送时间:* 2011年9月6日(星期二) 晚上7:30 > *收件人:* "欧佳欣"<[email protected]>; "pvfs2-developers"< > [email protected]>; ** > *主题:* Re: RE: RE: [Pvfs2-developers] Some quesions about function > callbetweentwodifferent modules in pvfs2 > > The original error you posted was in linking src/apps/admin/pvfs2-mkspace, > which uses trove, but contains none of the pvfs2-server -specific code. If > you try to alter the makefile you will run into more problems. For example, > both pvfs2-mkspace.c and pvfs2-server.c have a function called "main". I > suspect that will just be the beginning of the problems. > > Does your new function need to happen *during* the processing that occurs > inside trove, or do you just need to make sure it happens after some > condition has been met and you recognize that inside trove? You also > mentioned calling your function from job.c as an option. Instead, could you > use the user_ptr parameter to the job function to store information that > indicates you need to run your function upon returning to the calling > function that resides in pvfs2-server.c? > > Hope that helps, > Elaine > > 2011/9/6 欧佳欣 <[email protected]> > >> I think carefully about the suggestion you gave to me(to move the >> function to trove module) , I find it a little infeasible , because my >> new function I added in pvfs2-server.c calls some function in >> pvfs2-server.c,so if I move the new function to trove module , I must move >> the related function in pvfs2-server.c to trove module too. >> So can you give me some other suggestions ? I just learned that a function >> in one module can call a function in another module through changing the >> Makefile , but I don't know how to chang it , because of my lack knowledge >> of Makefile >> ** >> >> ------------------ Original ------------------ >> *From: * "Elaine Quarles"<[email protected]>; >> *Date: * Tue, Sep 6, 2011 00:16 AM >> *To: * "'欧佳欣'"<[email protected]>; ** >> *Cc: * "'pvfs2-developers'"<[email protected]>; ** >> *Subject: * RE: RE: [Pvfs2-developers] Some quesions about function call >> betweentwodifferent modules in pvfs2 >> >> >> The server directory contains the top level implementation of the server >> itself. All other systems, like BMI, job, trove, etc. are helpers that the >> server uses to accomplish its work. In general, only files in the server >> directory should make calls to other functions defined in source files >> within the server directory.**** >> >> ** ** >> >> Hope this helps,**** >> >> Elaine**** >> >> ** ** >> >> *From:* 欧佳欣 [mailto:[email protected]] >> *Sent:* Monday, September 05, 2011 11:36 AM >> *To:* Elaine Quarles >> *Subject:* Re:RE: [Pvfs2-developers] Some quesions about function call >> betweentwodifferent modules in pvfs2**** >> >> ** ** >> >> So,Can the code in job module calls a function from pvfs2-server.c ? such >> as the code in job.c**** >> >> **** >> >> **** >> >> ------------------ Original ------------------**** >> >> *From: * "Elaine Quarles"<[email protected]>;**** >> >> *Date: * Mon, Sep 5, 2011 11:10 PM**** >> >> *To: * "'欧佳欣'"<[email protected]>; **** >> >> *Cc: * "'pvfs2-developers'"<[email protected]>; ** >> ** >> >> *Subject: * RE: [Pvfs2-developers] Some quesions about function call >> betweentwodifferent modules in pvfs2**** >> >> **** >> >> trove-migrate.c is a special module in that its entire purpose is to >> perform data migration when structural changes are made to the >> OrangeFS/PVFS2 database. In that sense, it is OrangeFS-specific rather than >> part of the generic trove implementation. It includes some .h files that are >> typically not included in trove modules.**** >> >> ** ** >> >> Thanks,**** >> >> Elaine**** >> >> ** ** >> >> *From:* 欧佳欣 [mailto:[email protected]] >> *Sent:* Monday, September 05, 2011 10:44 AM >> *To:* Elaine Quarles >> *Subject:* Re: [Pvfs2-developers] Some quesions about function call >> betweentwodifferent modules in pvfs2**** >> >> ** ** >> >> But I find that , in src/io/trove/trove-migrate.c**** >> >> the function 'migrate_collection_0_1_4' also calls the function >> get_server_config_struct() which is defined in pvfs2-server.**** >> >> So,I want to kown why it can call the function in pvfs2-server , but >> dbpf-keyval.c can't ?(the trove-migrate.c source file is also in the trove >> level in orangefs-2.8.3-EXP)**** >> >> **** >> ** >> > > ** >
_______________________________________________ Pvfs2-developers mailing list [email protected] http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
