[Pvfs2-cvs] commit by pw in pvfs2/src/client/sysint: sys-create.sm

CVS commit program cvs at parl.clemson.edu
Tue Jul 24 13:41:05 EDT 2007


Update of /projects/cvsroot/pvfs2/src/client/sysint
In directory parlweb1:/tmp/cvs-serv8829/src/client/sysint

Modified Files:
	sys-create.sm 
Log Message:
Buggered that.  Put the allocations back above the map call.  Net result of these two patches:  delete the extra allocation of msgarray.


Index: sys-create.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-create.sm,v
diff -u -p -p -u -r1.108 -r1.109
--- sys-create.sm	24 Jul 2007 17:30:30 -0000	1.108
+++ sys-create.sm	24 Jul 2007 17:41:04 -0000	1.109
@@ -625,6 +625,33 @@ static PINT_sm_action create_datafiles_s
 
     js_p->error_code = 0;
 
+    /* allocate handle extent array objects */
+    if (sm_p->u.create.io_handle_extent_array == NULL)
+    {
+        sm_p->u.create.io_handle_extent_array = (PVFS_handle_extent_array *)
+            malloc(sm_p->u.create.num_data_files *
+                   sizeof(PVFS_handle_extent_array));
+    }
+    if (!sm_p->u.create.io_handle_extent_array)
+    {
+        gossip_err("create: failed to allocate handle_extent_array\n"); 
+        js_p->error_code = -PVFS_ENOMEM;
+        return SM_ACTION_COMPLETE;
+    }
+
+    /* allocate data server bmi address array */
+    if (sm_p->u.create.data_server_addrs == NULL)
+    {
+        sm_p->u.create.data_server_addrs = (PVFS_BMI_addr_t *)malloc(
+            sm_p->u.create.num_data_files * sizeof(PVFS_BMI_addr_t));
+    }
+    if (!sm_p->u.create.data_server_addrs)
+    {
+        gossip_err("create: failed to allocate data server addrs\n"); 
+        js_p->error_code = -PVFS_ENOMEM;
+        return SM_ACTION_COMPLETE;
+    }
+
     server_config = PINT_get_server_config_struct(
         sm_p->object_ref.fs_id);
 
@@ -667,33 +694,6 @@ static PINT_sm_action create_datafiles_s
         return SM_ACTION_COMPLETE;
     }
     sm_p->msgarray_count = sm_p->u.create.num_data_files;
-
-    /* allocate handle extent array objects */
-    if (sm_p->u.create.io_handle_extent_array == NULL)
-    {
-        sm_p->u.create.io_handle_extent_array = (PVFS_handle_extent_array *)
-            malloc(sm_p->u.create.num_data_files *
-                   sizeof(PVFS_handle_extent_array));
-    }
-    if (!sm_p->u.create.io_handle_extent_array)
-    {
-        gossip_err("create: failed to allocate handle_extent_array\n"); 
-        js_p->error_code = -PVFS_ENOMEM;
-        return SM_ACTION_COMPLETE;
-    }
-
-    /* allocate data server bmi address array */
-    if (sm_p->u.create.data_server_addrs == NULL)
-    {
-        sm_p->u.create.data_server_addrs = (PVFS_BMI_addr_t *)malloc(
-            sm_p->u.create.num_data_files * sizeof(PVFS_BMI_addr_t));
-    }
-    if (!sm_p->u.create.data_server_addrs)
-    {
-        gossip_err("create: failed to allocate data server addrs\n"); 
-        js_p->error_code = -PVFS_ENOMEM;
-        return SM_ACTION_COMPLETE;
-    }
 
     /* for each datafile, prepare to post a create send/recv pair */
     for(i = 0; i < sm_p->u.create.num_data_files; i++)



More information about the Pvfs2-cvs mailing list