[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/server:
precreate-pool-refiller.sm pvfs2-server.h
CVS commit program
cvs at parl.clemson.edu
Tue Feb 5 13:57:24 EST 2008
Update of /projects/cvsroot/pvfs2-1/src/server
In directory parlweb1:/tmp/cvs-serv17676/src/server
Modified Files:
Tag: small-file-branch
precreate-pool-refiller.sm pvfs2-server.h
Log Message:
persistent storage of precreated handles, more tweaks to allow binary keys
Index: precreate-pool-refiller.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/Attic/precreate-pool-refiller.sm,v
diff -p -u -r1.1.2.2 -r1.1.2.3
--- precreate-pool-refiller.sm 31 Jan 2008 17:39:50 -0000 1.1.2.2
+++ precreate-pool-refiller.sm 5 Feb 2008 18:57:24 -0000 1.1.2.3
@@ -27,6 +27,13 @@ static int batch_create_comp_fn(
machine pvfs2_precreate_pool_refiller_sm
{
+ state setup
+ {
+ run setup_fn;
+ success => wait_for_threshold;
+ default => error;
+ }
+
state wait_for_threshold
{
run wait_for_threshold_fn;
@@ -44,6 +51,13 @@ machine pvfs2_precreate_pool_refiller_sm
state msgpair_xfer_batch_create
{
jump pvfs2_msgpairarray_sm;
+ success => store_handles;
+ default => error;
+ }
+
+ state store_handles
+ {
+ run store_handles_fn;
success => wait_for_threshold;
default => error;
}
@@ -76,6 +90,26 @@ static PINT_sm_action wait_for_threshold
server_job_context));
}
+ /* TODO: properly comment this */
+static PINT_sm_action store_handles_fn(
+ struct PINT_smcb *smcb, job_status_s *js_p)
+{
+ struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+ job_id_t tmp_id;
+
+ return(job_precreate_pool_fill(
+ s_op->u.precreate_pool_refiller.pool_handle,
+ s_op->u.precreate_pool_refiller.fsid,
+ s_op->u.precreate_pool_refiller.precreate_handle_array,
+ POOL_BATCH_SIZE,
+ smcb,
+ 0,
+ js_p,
+ &tmp_id,
+ server_job_context));
+}
+
+
/* setup_batch_create_fn()
*
* TODO: properly comment
@@ -121,6 +155,28 @@ static PINT_sm_action setup_batch_create
}
+/* setup_fn()
+ *
+ * TODO: properly comment
+ */
+static PINT_sm_action setup_fn(
+ struct PINT_smcb *smcb, job_status_s *js_p)
+{
+ struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+
+ s_op->u.precreate_pool_refiller.precreate_handle_array =
+ malloc(POOL_BATCH_SIZE * sizeof(PVFS_handle));
+ if(!s_op->u.precreate_pool_refiller.precreate_handle_array)
+ {
+ js_p->error_code = -PVFS_ENOMEM;
+ return(SM_ACTION_COMPLETE);
+ }
+
+ js_p->error_code = 0;
+ return(SM_ACTION_COMPLETE);
+}
+
+
/* error_fn()
*
* TODO: properly comment
@@ -133,6 +189,11 @@ static PINT_sm_action error_fn(
gossip_err("Error: precreate_pool_refiller for %s exiting.\n",
s_op->u.precreate_pool_refiller.host);
+ if(s_op->u.precreate_pool_refiller.precreate_handle_array)
+ {
+ free(s_op->u.precreate_pool_refiller.precreate_handle_array);
+ }
+
return (server_state_machine_complete(smcb));
}
@@ -162,14 +223,14 @@ static int batch_create_comp_fn(void *v_
for(i = 0; i<resp_p->u.batch_create.handle_count; i++)
{
+ s_op->u.precreate_pool_refiller.precreate_handle_array[i] =
+ resp_p->u.batch_create.handle_array[i];
+
gossip_debug(GOSSIP_SERVER_DEBUG,
"Got batch created handle: %llu from: %s\n",
llu(resp_p->u.batch_create.handle_array[i]),
s_op->u.precreate_pool_refiller.host);
}
-
- /* TODO: do something useful here */
- gossip_debug(GOSSIP_SERVER_DEBUG, "Throwing them away...\n");
return 0;
}
Index: pvfs2-server.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/pvfs2-server.h,v
diff -p -u -r1.147.8.6 -r1.147.8.7
--- pvfs2-server.h 4 Feb 2008 18:01:52 -0000 1.147.8.6
+++ pvfs2-server.h 5 Feb 2008 18:57:24 -0000 1.147.8.7
@@ -238,6 +238,7 @@ struct PINT_server_mgmt_remove_dirent_op
struct PINT_server_precreate_pool_refiller_op
{
PVFS_handle pool_handle;
+ PVFS_handle* precreate_handle_array;
PVFS_fs_id fsid;
char* host;
PVFS_BMI_addr_t host_addr;
More information about the Pvfs2-cvs
mailing list