[Pvfs2-cvs] commit by walt in pvfs2-1/src/io/job: job-desc-queue.h
job.c job.h
CVS commit program
cvs at parl.clemson.edu
Thu Jul 9 12:40:50 EDT 2009
Update of /projects/cvsroot/pvfs2-1/src/io/job
In directory parlweb1:/tmp/cvs-serv7536/src/io/job
Modified Files:
Tag: Orange-Merge1
job-desc-queue.h job.c job.h
Log Message:
Merged changes in Blue branch into Orange branch
Index: job-desc-queue.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/job/job-desc-queue.h,v
diff -p -u -r1.28 -r1.28.18.1
--- job-desc-queue.h 20 Nov 2008 01:17:00 -0000 1.28
+++ job-desc-queue.h 9 Jul 2009 16:40:50 -0000 1.28.18.1
@@ -30,7 +30,7 @@ struct bmi_desc
struct trove_desc
{
TROVE_op_id id;
- PVFS_size actual_size;
+ PVFS_size *out_size_p;
PVFS_vtag *vtag;
PVFS_fs_id fsid;
PVFS_error state;
Index: job.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/job/job.c,v
diff -p -u -r1.188 -r1.188.16.1
--- job.c 19 Feb 2009 02:06:51 -0000 1.188
+++ job.c 9 Jul 2009 16:40:50 -0000 1.188.16.1
@@ -1399,96 +1399,6 @@ int job_flow_cancel(job_id_t id, job_con
return(ret);
}
-/* job_trove_bstream_write_at()
- *
- * storage byte stream write
- *
- * returns 0 on success, 1 on immediate completion, and -errno on
- * failure
- */
-int job_trove_bstream_write_at(PVFS_fs_id coll_id,
- PVFS_handle handle,
- PVFS_offset offset,
- void *buffer,
- PVFS_size size,
- PVFS_ds_flags flags,
- PVFS_vtag * vtag,
- void *user_ptr,
- job_aint status_user_tag,
- job_status_s * out_status_p,
- job_id_t * id,
- job_context_id context_id,
- PVFS_hint hints)
-{
- /* post a trove write. If it completes (or fails) immediately, then
- * return and fill in the status structure. If it needs to be tested
- * for completion later, then queue up a job_desc structure.
- */
- int ret = -1;
- struct job_desc *jd = NULL;
- void* user_ptr_internal;
-
- /* create the job desc first, even though we may not use it. This
- * gives us somewhere to store the BMI id and user ptr
- */
- jd = alloc_job_desc(JOB_TROVE);
- if (!jd)
- {
- out_status_p->error_code = -PVFS_ENOMEM;
- return 1;
- }
- jd->hints = hints;
- jd->job_user_ptr = user_ptr;
- jd->u.trove.actual_size = size;
- jd->u.trove.vtag = vtag;
- jd->context_id = context_id;
- jd->status_user_tag = status_user_tag;
- jd->trove_callback.fn = trove_thread_mgr_callback;
- jd->trove_callback.data = (void*)jd;
- user_ptr_internal = &jd->trove_callback;
-
-#ifdef __PVFS2_TROVE_SUPPORT__
- ret = trove_bstream_write_at(coll_id, handle, buffer,
- &jd->u.trove.actual_size, offset, flags,
- jd->u.trove.vtag, user_ptr_internal,
- global_trove_context,
- &(jd->u.trove.id), hints);
-#else
- gossip_err("Error: Trove support not enabled.\n");
- ret = -ENOSYS;
-#endif
-
- if (ret < 0)
- {
- /* error posting trove operation */
- dealloc_job_desc(jd);
- jd = NULL;
- out_status_p->error_code = ret;
- out_status_p->status_user_tag = status_user_tag;
- return (1);
- }
-
- if (ret == 1)
- {
- /* immediate completion */
- out_status_p->error_code = 0;
- out_status_p->status_user_tag = status_user_tag;
- out_status_p->actual_size = jd->u.trove.actual_size;
- out_status_p->vtag = jd->u.trove.vtag;
- dealloc_job_desc(jd);
- jd = NULL;
- return (ret);
- }
-
- /* if we fall through to this point, the job did not
- * immediately complete and we must queue up to test later
- */
- *id = jd->job_id;
- trove_pending_count++;
-
- return (0);
-}
-
int job_trove_bstream_write_list(TROVE_coll_id coll_id,
TROVE_handle handle,
char **mem_offset_array,
@@ -1527,6 +1437,7 @@ int job_trove_bstream_write_list(TROVE_c
jd->job_user_ptr = user_ptr;
jd->hints = hints;
jd->u.trove.vtag = vtag;
+ jd->u.trove.out_size_p = out_size_p;
jd->context_id = context_id;
jd->status_user_tag = status_user_tag;
jd->trove_callback.fn = trove_thread_mgr_callback;
@@ -1565,7 +1476,7 @@ int job_trove_bstream_write_list(TROVE_c
/* immediate completion */
out_status_p->error_code = 0;
out_status_p->status_user_tag = status_user_tag;
- out_status_p->actual_size = jd->u.trove.actual_size;
+ out_status_p->actual_size = *out_size_p;
out_status_p->vtag = jd->u.trove.vtag;
dealloc_job_desc(jd);
jd = NULL;
@@ -1581,97 +1492,6 @@ int job_trove_bstream_write_list(TROVE_c
return (0);
}
-
-/* job_trove_bstream_read_at()
- *
- * storage byte stream read
- *
- * returns 0 on success, 1 on immediate completion, and -errno on
- * failure
- */
-int job_trove_bstream_read_at(PVFS_fs_id coll_id,
- PVFS_handle handle,
- PVFS_offset offset,
- void *buffer,
- PVFS_size size,
- PVFS_ds_flags flags,
- PVFS_vtag * vtag,
- void *user_ptr,
- job_aint status_user_tag,
- job_status_s * out_status_p,
- job_id_t * id,
- job_context_id context_id,
- PVFS_hint hints)
-{
- /* post a trove read. If it completes (or fails) immediately, then
- * return and fill in the status structure. If it needs to be tested
- * for completion later, then queue up a job_desc structure.
- */
- int ret = -1;
- struct job_desc *jd = NULL;
- void* user_ptr_internal;
-
- /* create the job desc first, even though we may not use it. This
- * gives us somewhere to store the BMI id and user ptr
- */
- jd = alloc_job_desc(JOB_TROVE);
- if (!jd)
- {
- out_status_p->error_code = -PVFS_ENOMEM;
- return 1;
- }
- jd->hints = hints;
- jd->job_user_ptr = user_ptr;
- jd->u.trove.actual_size = size;
- jd->u.trove.vtag = vtag;
- jd->context_id = context_id;
- jd->status_user_tag = status_user_tag;
- jd->trove_callback.fn = trove_thread_mgr_callback;
- jd->trove_callback.data = (void*)jd;
- user_ptr_internal = &jd->trove_callback;
-
-#ifdef __PVFS2_TROVE_SUPPORT__
- ret = trove_bstream_read_at(coll_id, handle, buffer,
- &jd->u.trove.actual_size, offset, flags,
- jd->u.trove.vtag, user_ptr_internal,
- global_trove_context,
- &(jd->u.trove.id), hints);
-#else
- gossip_err("Error: Trove support not enabled.\n");
- ret = -ENOSYS;
-#endif
-
- if (ret < 0)
- {
- /* error posting trove operation */
- dealloc_job_desc(jd);
- jd = NULL;
- out_status_p->error_code = ret;
- out_status_p->status_user_tag = status_user_tag;
- return (1);
- }
-
- if (ret == 1)
- {
- /* immediate completion */
- out_status_p->error_code = 0;
- out_status_p->status_user_tag = status_user_tag;
- out_status_p->actual_size = jd->u.trove.actual_size;
- out_status_p->vtag = jd->u.trove.vtag;
- dealloc_job_desc(jd);
- jd = NULL;
- return (ret);
- }
-
- /* if we fall through to this point, the job did not
- * immediately complete and we must queue up to test later
- */
- *id = jd->job_id;
- trove_pending_count++;
-
- return (0);
-}
-
int job_trove_bstream_read_list(PVFS_fs_id coll_id,
PVFS_handle handle,
char **mem_offset_array,
@@ -1710,6 +1530,7 @@ int job_trove_bstream_read_list(PVFS_fs_
jd->hints = hints;
jd->job_user_ptr = user_ptr;
jd->u.trove.vtag = vtag;
+ jd->u.trove.out_size_p = out_size_p;
jd->context_id = context_id;
jd->status_user_tag = status_user_tag;
jd->trove_callback.fn = trove_thread_mgr_callback;
@@ -1746,7 +1567,7 @@ int job_trove_bstream_read_list(PVFS_fs_
/* immediate completion */
out_status_p->error_code = 0;
out_status_p->status_user_tag = status_user_tag;
- out_status_p->actual_size = jd->u.trove.actual_size;
+ out_status_p->actual_size = *out_size_p;
out_status_p->vtag = jd->u.trove.vtag;
dealloc_job_desc(jd);
jd = NULL;
@@ -5154,7 +4975,8 @@ static void fill_status(struct job_desc
break;
case JOB_TROVE:
status->error_code = jd->u.trove.state;
- status->actual_size = jd->u.trove.actual_size;
+ if(jd->u.trove.out_size_p)
+ status->actual_size = *jd->u.trove.out_size_p;
status->vtag = jd->u.trove.vtag;
status->coll_id = jd->u.trove.fsid;
status->handle = jd->u.trove.handle;
Index: job.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/job/job.h,v
diff -p -u -r1.60 -r1.60.18.1
--- job.h 29 Jan 2009 05:24:03 -0000 1.60
+++ job.h 9 Jul 2009 16:40:50 -0000 1.60.18.1
@@ -32,7 +32,7 @@ typedef struct job_status
/* the comments indicate which type of job will fill in which fields */
job_aint status_user_tag; /* tag supplied by caller */
int error_code; /* returned by all operations */
- PVFS_size actual_size; /* read_at, write_at, resize, bmi_recv */
+ PVFS_size actual_size; /* resize, bmi_recv */
PVFS_vtag *vtag; /* most trove operations */
PVFS_ds_position position; /* iterate, iterate_keys, iterate_handles */
PVFS_handle handle; /* dspace_create */
@@ -226,20 +226,6 @@ int job_flow(flow_descriptor * flow_d,
int job_flow_cancel(job_id_t id, job_context_id context_id);
/* storage byte stream write */
-int job_trove_bstream_write_at(PVFS_fs_id coll_id,
- PVFS_handle handle,
- PVFS_offset offset,
- void *buffer,
- PVFS_size size,
- PVFS_ds_flags flags,
- PVFS_vtag * vtag,
- void *user_ptr,
- job_aint status_user_tag,
- job_status_s * out_status_p,
- job_id_t * id,
- job_context_id context_id,
- PVFS_hint hints);
-
int job_trove_bstream_write_list(PVFS_fs_id coll_id,
PVFS_handle handle,
char **mem_offset_array,
@@ -260,19 +246,6 @@ int job_trove_bstream_write_list(PVFS_fs
/* storage byte stream read */
-int job_trove_bstream_read_at(PVFS_fs_id coll_id,
- PVFS_handle handle,
- PVFS_offset offset,
- void *buffer,
- PVFS_size size,
- PVFS_ds_flags flags,
- PVFS_vtag * vtag,
- void *user_ptr,
- job_aint status_user_tag,
- job_status_s * out_status_p,
- job_id_t * id,
- job_context_id context_id,
- PVFS_hint hints);
int job_trove_bstream_read_list(PVFS_fs_id coll_id,
PVFS_handle handle,
More information about the Pvfs2-cvs
mailing list