[Pvfs2-cvs] commit by nlmills in pvfs2/src/client/sysint: sys-io.sm sys-small-io.sm sys-truncate.sm

CVS commit program cvs at parl.clemson.edu
Tue Jul 29 15:25:38 EDT 2008


Update of /anoncvs/pvfs2/src/client/sysint
In directory parlweb1:/tmp/cvs-serv18930

Modified Files:
      Tag: cu-security-branch
	sys-io.sm sys-small-io.sm sys-truncate.sm 
Log Message:
cleaned up sys-io, sys-small-io, and sys-truncate


Index: sys-io.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/sys-io.sm,v
diff -p -u -r1.159.4.3 -r1.159.4.4
--- sys-io.sm	29 Jul 2008 15:19:30 -0000	1.159.4.3
+++ sys-io.sm	29 Jul 2008 19:25:38 -0000	1.159.4.4
@@ -426,6 +426,7 @@ static PINT_sm_action io_datafile_setup_
     switch(attr->objtype)
     {
         case PVFS_TYPE_METAFILE:
+            assert(attr->mask & PVFS_ATTR_CAPABILITY);
             assert(attr->mask & PVFS_ATTR_META_DFILES);
             assert(attr->mask & PVFS_ATTR_META_DIST);
             assert(attr->u.meta.dist_size > 0);
@@ -545,7 +546,7 @@ static PINT_sm_action io_datafile_setup_
 
         PINT_SERVREQ_IO_FILL(
             sm_p->u.io.contexts[i].msg.req,
-            sm_p->getattr.attr.capability,
+            attr->capability,
             sm_p->object_ref.fs_id,
             sm_p->u.io.contexts[i].data_handle,
             sm_p->u.io.io_type,

Index: sys-small-io.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/sys-small-io.sm,v
diff -p -u -r1.15.8.3 -r1.15.8.4
--- sys-small-io.sm	29 Jul 2008 15:19:30 -0000	1.15.8.3
+++ sys-small-io.sm	29 Jul 2008 19:25:38 -0000	1.15.8.4
@@ -83,6 +83,8 @@ static PINT_sm_action small_io_setup_msg
     attr = &sm_p->getattr.attr;
     assert(attr);
 
+    assert(attr->mask & PVFS_ATTR_CAPABILITY);
+
     /* initialize msgarray */
     ret = PINT_msgpairarray_init(&sm_p->msgarray_op, sm_p->u.io.datafile_count);
     if(ret < 0)
@@ -158,7 +160,7 @@ static PINT_sm_action small_io_setup_msg
          */ 
         PINT_SERVREQ_SMALL_IO_FILL(
             msg_p->req,
-            sm_p->getattr.attr.capability,
+            attr->capability,
             sm_p->object_ref.fs_id,
             datafile_handle,
             sm_p->u.io.io_type,

Index: sys-truncate.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/sys-truncate.sm,v
diff -p -u -r1.56.8.3 -r1.56.8.4
--- sys-truncate.sm	29 Jul 2008 15:19:31 -0000	1.56.8.3
+++ sys-truncate.sm	29 Jul 2008 19:25:38 -0000	1.56.8.4
@@ -32,12 +32,6 @@ extern job_context_id pint_client_sm_con
 
 machine pvfs2_client_truncate_sm
 {
-    state init
-    {
-        run truncate_init;
-        default => truncate_getattr;
-    }
-
     state truncate_getattr
     {
         jump pvfs2_client_getattr_sm;
@@ -122,7 +116,7 @@ PVFS_error PVFS_isys_truncate(
     PINT_SM_GETATTR_STATE_FILL(
         sm_p->getattr,
         sm_p->object_ref,
-        PVFS_ATTR_META_ALL|PVFS_ATTR_COMMON_TYPE,
+        PVFS_ATTR_META_ALL|PVFS_ATTR_COMMON_TYPE|PVFS_ATTR_CAPABILITY,
         PVFS_TYPE_METAFILE,
         0);
 
@@ -161,24 +155,6 @@ PVFS_error PVFS_sys_truncate(
     return error;
 }
 
-static PINT_sm_action truncate_init(
-        struct PINT_smcb *smcb, job_status_s *js_p)
-{
-    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
-    gossip_debug(GOSSIP_CLIENT_DEBUG, "truncate state: init\n");
-
-    PINT_SM_GETATTR_STATE_FILL(
-        sm_p->getattr,
-        sm_p->object_ref,
-        PVFS_ATTR_DIR_ALL|PVFS_ATTR_CAPABILITY,
-        PVFS_TYPE_METAFILE,
-        0);
-    
-    assert(js_p->error_code == 0);
-
-    return SM_ACTION_COMPLETE;
-}
-
 /** Resize a file.
  */
 static PINT_sm_action truncate_datafile_setup_msgpairarray(
@@ -196,6 +172,7 @@ static PINT_sm_action truncate_datafile_
     attr = &sm_p->getattr.attr;
     assert(attr);
 
+    assert(attr->mask & PVFS_ATTR_CAPABILITY);
     assert(attr->mask & PVFS_ATTR_META_DFILES);
     assert(attr->mask & PVFS_ATTR_META_DIST);
     assert(attr->u.meta.dfile_count > 0);
@@ -239,7 +216,7 @@ static PINT_sm_action truncate_datafile_
 
         PINT_SERVREQ_TRUNCATE_FILL(
             msg_p->req,
-            sm_p->getattr.attr.capability,
+            attr->capability,
             sm_p->object_ref.fs_id,
             new_dfile_size,
             attr->u.meta.dfile_array[i]);



More information about the Pvfs2-cvs mailing list