[Pvfs2-cvs] commit by slang in pvfs2/src/io/job: job-desc-queue.c
job.c
CVS commit program
cvs at parl.clemson.edu
Wed Aug 22 12:12:48 EDT 2007
Update of /projects/cvsroot/pvfs2/src/io/job
In directory parlweb1:/tmp/cvs-serv7554/src/io/job
Modified Files:
job-desc-queue.c job.c
Log Message:
Replace id_gen_safe with id_gen_fast. id_gen_safe is only needed for ids that are getting handed back to us through the system interfaces. If our own internal ids (pointers) are getting corrupted or freed...Hello valgrind!
Index: job-desc-queue.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/job/job-desc-queue.c,v
diff -p -u -r1.16 -r1.17
--- job-desc-queue.c 7 Jun 2005 20:18:25 -0000 1.16
+++ job-desc-queue.c 22 Aug 2007 16:12:48 -0000 1.17
@@ -38,11 +38,7 @@ struct job_desc *alloc_job_desc(int type
}
memset(jd, 0, sizeof(struct job_desc));
- if (id_gen_safe_register(&(jd->job_id), jd) < 0)
- {
- free(jd);
- return (NULL);
- }
+ id_gen_fast_register(&(jd->job_id), jd);
jd->type = type;
return (jd);
@@ -56,7 +52,7 @@ struct job_desc *alloc_job_desc(int type
*/
void dealloc_job_desc(struct job_desc *jd)
{
- id_gen_safe_unregister(jd->job_id);
+ id_gen_fast_unregister(jd->job_id);
free(jd);
}
Index: job.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/job/job.c,v
diff -p -u -r1.173 -r1.174
--- job.c 13 Apr 2007 05:14:26 -0000 1.173
+++ job.c 22 Aug 2007 16:12:48 -0000 1.174
@@ -271,7 +271,7 @@ int job_reset_timeout(job_id_t id, int t
*/
gen_mutex_lock(&completion_mutex);
- query = id_gen_safe_lookup(id);
+ query = id_gen_fast_lookup(id);
if(!query)
{
/* this id is not valid */
@@ -758,7 +758,7 @@ int job_bmi_cancel(job_id_t id, job_cont
gen_mutex_lock(&completion_mutex);
- query = id_gen_safe_lookup(id);
+ query = id_gen_fast_lookup(id);
if (!query || query->completed_flag)
{
/* job has already completed, no cancellation needed */
@@ -1113,7 +1113,7 @@ int job_req_sched_release(job_id_t in_co
jd->context_id = context_id;
jd->status_user_tag = status_user_tag;
- match_jd = id_gen_safe_lookup(in_completed_id);
+ match_jd = id_gen_fast_lookup(in_completed_id);
if (!match_jd)
{
/* id has been released or was not registered */
@@ -1246,7 +1246,7 @@ int job_flow_cancel(job_id_t id, job_con
gen_mutex_lock(&completion_mutex);
- query = id_gen_safe_lookup(id);
+ query = id_gen_fast_lookup(id);
if (!query || query->completed_flag)
{
@@ -3242,7 +3242,7 @@ int job_trove_dspace_cancel(PVFS_fs_id c
gen_mutex_lock(&completion_mutex);
- query = id_gen_safe_lookup(id);
+ query = id_gen_fast_lookup(id);
if (!query || query->completed_flag)
{
/* job has already completed, no cancellation needed */
@@ -4530,7 +4530,7 @@ static int completion_query_some(job_id_
/* don't do anything unless all of the target ops are done */
for(i=0; i<incount; i++)
{
- tmp_desc = id_gen_safe_lookup(id_array[i]);
+ tmp_desc = id_gen_fast_lookup(id_array[i]);
if(tmp_desc && tmp_desc->completed_flag)
{
done_count++;
@@ -4545,7 +4545,7 @@ static int completion_query_some(job_id_
/* all target ops are complete; pull them out of completion queue */
for(i=0; i<incount; i++)
{
- tmp_desc = id_gen_safe_lookup(id_array[i]);
+ tmp_desc = id_gen_fast_lookup(id_array[i]);
if(tmp_desc && tmp_desc->completed_flag)
{
if(returned_user_ptr_array)
More information about the Pvfs2-cvs
mailing list