[Pvfs2-cvs] commit by dbonnie in pvfs2/src/client/sysint: remove.sm sys-readdirplus.sm sys-rename.sm

CVS commit program cvs at parl.clemson.edu
Tue Aug 12 16:09:09 EDT 2008


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

Modified Files:
      Tag: cu-security-branch
	remove.sm sys-readdirplus.sm sys-rename.sm 
Log Message:
Small fix in readdirplus.  Partially updated rename, needs work.  Remove updated to grab capabilities.


Index: remove.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/remove.sm,v
diff -p -u -r1.27.8.2 -r1.27.8.3
--- remove.sm	21 Jul 2008 22:02:47 -0000	1.27.8.2
+++ remove.sm	12 Aug 2008 20:09:08 -0000	1.27.8.3
@@ -118,7 +118,7 @@ static PINT_sm_action remove_getattr_ini
     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_NONE,
         0);
     return SM_ACTION_COMPLETE;
@@ -174,9 +174,6 @@ static PINT_sm_action remove_datafile_re
     int i = 0;
     int ret = -PVFS_EINVAL;
     PVFS_object_attr *attr = NULL;
-    PVFS_capability xxremovemexx;
-
-    memset(&xxremovemexx, 0, sizeof(PVFS_capability));
 
    /* post all datafile remove requests and responses simultaneously.
     *
@@ -210,7 +207,7 @@ static PINT_sm_action remove_datafile_re
 
 	PINT_SERVREQ_REMOVE_FILL(
             msg_p->req,
-            xxremovemexx,
+            sm_p->getattr.attr.capability,
             sm_p->object_ref.fs_id,
             attr->u.meta.dfile_array[i]);
 
@@ -238,9 +235,6 @@ static PINT_sm_action remove_object_remo
     struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
     int ret = -PVFS_EINVAL;
     PINT_sm_msgpair_state *msg_p = NULL;
-    PVFS_capability xxremovemexx;
-
-    memset(&xxremovemexx, 0, sizeof(PVFS_capability));
 
     gossip_debug(GOSSIP_CLIENT_DEBUG,
                  "remove state: object_remove_setup_msgpair\n");
@@ -252,7 +246,7 @@ static PINT_sm_action remove_object_remo
 
     PINT_SERVREQ_REMOVE_FILL(
         msg_p->req,
-        xxremovemexx,
+        sm_p->getattr.attr.capability,
         sm_p->object_ref.fs_id,
         sm_p->object_ref.handle);
 

Index: sys-readdirplus.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/sys-readdirplus.sm,v
diff -p -u -r1.9.2.5 -r1.9.2.6
--- sys-readdirplus.sm	11 Aug 2008 20:10:33 -0000	1.9.2.5
+++ sys-readdirplus.sm	12 Aug 2008 20:09:08 -0000	1.9.2.6
@@ -689,9 +689,6 @@ static PINT_sm_action readdirplus_fetch_
     int i, ret;
     struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
     PINT_sm_msgpair_state *msg_p;
-    PVFS_capability xxremovemexx;
-
-    memset(&xxremovemexx, 0, sizeof(PVFS_capability));
 
     PINT_msgpairarray_destroy(&sm_p->msgarray_op);
 
@@ -728,7 +725,7 @@ static PINT_sm_action readdirplus_fetch_
      {
         PINT_SERVREQ_LISTATTR_FILL(
             msg_p->req,
-            xxremovemexx,
+            *PINT_null_capability(),
             sm_p->object_ref.fs_id,
             PVFS_ATTR_DATA_SIZE,
             sm_p->u.readdirplus.handle_count[i],

Index: sys-rename.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/sys-rename.sm,v
diff -p -u -r1.56.8.4 -r1.56.8.5
--- sys-rename.sm	29 Jul 2008 22:22:58 -0000	1.56.8.4
+++ sys-rename.sm	12 Aug 2008 20:09:08 -0000	1.56.8.5
@@ -68,7 +68,7 @@ machine pvfs2_client_rename_sm
     state rename_lookups_xfer_msgpair_array
     {
         jump pvfs2_msgpairarray_sm;
-        success => rename_crdirent_setup_msgpair;
+        success => rename_crdirent_init;
         RENAME_CHDIRENT => rename_getattr_src;
         default => rename_lookups_failure;
     }
@@ -98,6 +98,21 @@ machine pvfs2_client_rename_sm
         run rename_lookups_failure;
         default => cleanup;
     }
+    
+    /*  TODO: grab capabilities for rmdirent and chdirent */
+    state rename_crdirent_init
+    {
+        run getattr_crdirent_init;
+        success => rename_getattr_crdirent;
+        default => rename_crdirent_retry_or_fail;
+    }
+    
+    state rename_getattr_crdirent
+    {
+        jump pvfs2_client_getattr_sm;
+        success => rename_crdirent_setup_msgpair;
+        default => rename_crdirent_retry_or_fail;
+    }
 
     state rename_crdirent_setup_msgpair
     {
@@ -123,7 +138,7 @@ machine pvfs2_client_rename_sm
     state rename_crdirent_timer
     {
 	run rename_generic_timer;
-	default => rename_crdirent_setup_msgpair;
+	default => rename_crdirent_init;
     }
 
     state rename_rmdirent_setup_msgpair
@@ -432,7 +447,7 @@ static int rename_lookups_comp_fn(
             PINT_SM_GETATTR_STATE_FILL(
                 sm_p->getattr,
                 sm_p->object_ref,
-                PVFS_ATTR_COMMON_ALL,
+                PVFS_ATTR_COMMON_ALL|PVFS_ATTR_CAPABILITY,
                 PVFS_TYPE_NONE,
                 0);
 
@@ -518,9 +533,6 @@ static PINT_sm_action rename_lookups_set
     struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
     int ret = -PVFS_EINVAL, i = 0;
     PINT_sm_msgpair_state *msg_p;
-    PVFS_capability xxremovemexx;
-
-    memset(&xxremovemexx, 0, sizeof(PVFS_capability));
 
     js_p->error_code = 0;
 
@@ -542,7 +554,7 @@ static PINT_sm_action rename_lookups_set
 
         PINT_SERVREQ_LOOKUP_PATH_FILL(
             msg_p->req,
-            xxremovemexx,
+            *PINT_null_capability(),
             sm_p->u.rename.entries[i],
             sm_p->u.rename.parent_refns[i].fs_id,
             sm_p->u.rename.parent_refns[i].handle,
@@ -577,6 +589,24 @@ static PINT_sm_action rename_lookups_fai
     return SM_ACTION_COMPLETE;
 }
 
+static PINT_sm_action getattr_crdirent_init(
+        struct PINT_smcb *smcb, job_status_s *js_p)
+{
+    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+
+    PINT_SM_GETATTR_STATE_CLEAR(sm_p->getattr);
+    gossip_debug(GOSSIP_CLIENT_DEBUG, "rename state: grabbing cap crdirent\n");
+
+    PINT_SM_GETATTR_STATE_FILL(
+        sm_p->getattr,
+        sm_p->u.rename.parent_refns[1],
+        PVFS_ATTR_COMMON_ALL|PVFS_ATTR_DIR_HINT|PVFS_ATTR_CAPABILITY, 
+        PVFS_TYPE_DIRECTORY,
+        0);
+
+   return SM_ACTION_COMPLETE;
+}
+
 static PINT_sm_action rename_crdirent_setup_msgpair(
         struct PINT_smcb *smcb, job_status_s *js_p)
 {
@@ -974,10 +1004,10 @@ static PINT_sm_action rename_getattr_src
      * happens to be a directory rather than a file.
      */
     PINT_SM_GETATTR_STATE_FILL(sm_p->getattr,
-                               sm_p->object_ref,
-                               (PVFS_ATTR_COMMON_ALL|PVFS_ATTR_DIR_DIRENT_COUNT),
-                               PVFS_TYPE_NONE,
-                               PINT_SM_GETATTR_BYPASS_CACHE);
+         sm_p->object_ref,
+         (PVFS_ATTR_COMMON_ALL|PVFS_ATTR_DIR_DIRENT_COUNT|PVFS_ATTR_CAPABILITY),
+         PVFS_TYPE_NONE,
+         PINT_SM_GETATTR_BYPASS_CACHE);
     js_p->error_code = 0;
     return SM_ACTION_COMPLETE;
 }



More information about the Pvfs2-cvs mailing list