[Pvfs2-cvs] commit by nlmills in pvfs2/src/client/sysint: client-state-machine.h sys-mkdir.sm

CVS commit program cvs at parl.clemson.edu
Thu Jul 31 13:54:36 EDT 2008


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

Modified Files:
      Tag: cu-security-branch
	client-state-machine.h sys-mkdir.sm 
Log Message:



Index: client-state-machine.h
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/client-state-machine.h,v
diff -p -u -r1.173.4.4 -r1.173.4.5
--- client-state-machine.h	24 Jul 2008 21:22:33 -0000	1.173.4.4
+++ client-state-machine.h	31 Jul 2008 17:54:35 -0000	1.173.4.5
@@ -89,6 +89,49 @@ struct PINT_client_create_sm
     PVFS_object_attr cache_attr;
 };
 
+/* flag to disable cached lookup during getattr nested sm */
+#define PINT_SM_GETATTR_BYPASS_CACHE 1
+
+typedef struct PINT_sm_getattr_state
+{
+    PVFS_object_ref object_ref;
+
+   /* request sys attrmask.  Some combination of
+     * PVFS_ATTR_SYS_*
+     */
+    uint32_t req_attrmask;
+    
+    /*
+      Either from the acache or full getattr op, this is the resuling
+      attribute that can be used by calling state machines
+    */
+    PVFS_object_attr attr;
+
+    PVFS_ds_type ref_type;
+
+    PVFS_size * size_array;
+    PVFS_size size;
+
+    int flags;
+    
+} PINT_sm_getattr_state;
+
+#define PINT_SM_GETATTR_STATE_FILL(_state, _objref, _mask, _reftype, _flags) \
+    do { \
+        memset(&(_state), 0, sizeof(PINT_sm_getattr_state)); \
+        (_state).object_ref.fs_id = (_objref).fs_id; \
+        (_state).object_ref.handle = (_objref).handle; \
+        (_state).req_attrmask = _mask; \
+        (_state).ref_type = _reftype; \
+        (_state).flags = _flags; \
+    } while(0)
+
+#define PINT_SM_GETATTR_STATE_CLEAR(_state) \
+    do { \
+        PINT_free_object_attr(&(_state).attr); \
+        memset(&(_state), 0, sizeof(PINT_sm_getattr_state)); \
+    } while(0)
+
 struct PINT_client_mkdir_sm
 {
     char *object_name;              /* input parameter  */
@@ -100,6 +143,7 @@ struct PINT_client_mkdir_sm
     int retry_count;
     int stored_error_code;
     PVFS_handle metafile_handle;
+    PINT_sm_getattr_state metafile_getattr;
 };
 
 struct PINT_client_symlink_sm
@@ -376,49 +420,6 @@ struct PINT_server_fetch_config_sm_state
     char **fs_config_bufs;
     int32_t *fs_config_buf_size;
 };
-
-/* flag to disable cached lookup during getattr nested sm */
-#define PINT_SM_GETATTR_BYPASS_CACHE 1
-
-typedef struct PINT_sm_getattr_state
-{
-    PVFS_object_ref object_ref;
-
-   /* request sys attrmask.  Some combination of
-     * PVFS_ATTR_SYS_*
-     */
-    uint32_t req_attrmask;
-    
-    /*
-      Either from the acache or full getattr op, this is the resuling
-      attribute that can be used by calling state machines
-    */
-    PVFS_object_attr attr;
-
-    PVFS_ds_type ref_type;
-
-    PVFS_size * size_array;
-    PVFS_size size;
-
-    int flags;
-    
-} PINT_sm_getattr_state;
-
-#define PINT_SM_GETATTR_STATE_FILL(_state, _objref, _mask, _reftype, _flags) \
-    do { \
-        memset(&(_state), 0, sizeof(PINT_sm_getattr_state)); \
-        (_state).object_ref.fs_id = (_objref).fs_id; \
-        (_state).object_ref.handle = (_objref).handle; \
-        (_state).req_attrmask = _mask; \
-        (_state).ref_type = _reftype; \
-        (_state).flags = _flags; \
-    } while(0)
-
-#define PINT_SM_GETATTR_STATE_CLEAR(_state) \
-    do { \
-        PINT_free_object_attr(&(_state).attr); \
-        memset(&(_state), 0, sizeof(PINT_sm_getattr_state)); \
-    } while(0)
 
 #define PINT_SM_DATAFILE_SIZE_ARRAY_INIT(_array, _count) \
     do { \

Index: sys-mkdir.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/sys-mkdir.sm,v
diff -p -u -r1.63.2.3 -r1.63.2.4
--- sys-mkdir.sm	29 Jul 2008 20:01:06 -0000	1.63.2.3
+++ sys-mkdir.sm	31 Jul 2008 17:54:36 -0000	1.63.2.4
@@ -77,7 +77,7 @@ machine pvfs2_client_mkdir_sm
     state mkdir_msg_xfer_msgpair
     {
         jump pvfs2_msgpairarray_sm;
-        success => mkdir_seteattr_setup_msgpair;
+        success => mkdir_getattr_setup;
         default => mkdir_msg_failure;
     }
 
@@ -86,6 +86,19 @@ machine pvfs2_client_mkdir_sm
         run mkdir_msg_failure;
         default => cleanup;
     }
+    
+    state mkdir_getattr_setup
+    {
+        run mkdir_getattr_setup;
+        default => mkdir_getattr;
+    }
+
+    state mkdir_getattr
+    {
+        jump pvfs2_client_getattr_sm;
+        success => mkdir_seteattr_setup_msgpair;
+        default => delete_handle_setup_msgpair;
+    }
 
     state mkdir_seteattr_setup_msgpair
     {
@@ -480,7 +493,7 @@ static PINT_sm_action mkdir_delete_handl
 
     PINT_SERVREQ_REMOVE_FILL(
         msg_p->req,
-        sm_p->getattr.attr.capability,
+        sm_p->u.mkdir.metafile_getattr.attr.capability,
         sm_p->object_ref.fs_id,
         sm_p->u.mkdir.metafile_handle);
 
@@ -519,6 +532,9 @@ static PINT_sm_action mkdir_cleanup(
 
     PVFS_util_release_sys_attr(&sm_p->u.mkdir.sys_attr);
 
+    /* TODO: ensure this is always safe to call */
+    PINT_SM_GETATTR_STATE_CLEAR(sm_p->u.mkdir.metafile_getattr);
+    
     PINT_SM_GETATTR_STATE_CLEAR(sm_p->getattr);
 
     sm_p->error_code = (sm_p->u.mkdir.stored_error_code ?
@@ -592,6 +608,26 @@ static PINT_sm_action mkdir_parent_getat
     return SM_ACTION_COMPLETE;
 }
 
+static PINT_sm_action mkdir_getattr_setup(
+        struct PINT_smcb *smcb, job_status_s *js_p)
+{
+    struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+    PVFS_object_ref ref;
+
+    ref.fs_id = sm_p->object_ref.fs_id;
+    ref.handle = sm_p->u.mkdir.metafile_handle;
+
+    PINT_SM_GETATTR_STATE_FILL(
+        sm_p->u.mkdir.metafile_getattr,
+        ref,
+        PVFS_ATTR_CAPABILITY, 
+        PVFS_TYPE_DIRECTORY,
+        0);
+    
+    return SM_ACTION_COMPLETE;
+}
+
+
 static PINT_sm_action mkdir_seteattr_setup_msgpair(
         struct PINT_smcb *smcb, job_status_s *js_p)
 {
@@ -697,7 +733,7 @@ static PINT_sm_action mkdir_seteattr_set
 
     PINT_SERVREQ_SETEATTR_FILL(
             msg_p->req,
-            sm_p->getattr.attr.capability,
+            sm_p->u.mkdir.metafile_getattr.attr.capability,
             sm_p->object_ref.fs_id,
             sm_p->u.mkdir.metafile_handle,
             0,



More information about the Pvfs2-cvs mailing list