[PVFS2-CVS] commit by neill in pvfs2/src/server: chdirent.sm crdirent.sm pvfs2-server.c pvfs2-server.h readdir.sm rmdirent.sm set-attr.sm

CVS commit program cvs at parl.clemson.edu
Thu Sep 9 11:29:13 EDT 2004


Update of /projects/cvsroot/pvfs2/src/server
In directory parlweb:/tmp/cvs-serv27089/src/server

Modified Files:
	chdirent.sm crdirent.sm pvfs2-server.c pvfs2-server.h 
	readdir.sm rmdirent.sm set-attr.sm 
Log Message:
- added a PVFS_util method to get the current system and return it as
  a valid PVFS_time type
- added arguments to the crdirent/chdirent/rmdirent operations that
  now can take optional parent atime/mtime/ctime fields
- added support on server *dirent operations that update the parent
  time attributes (if specified) on successful completion of the
  *dirent operation; null/zero time fields are not updated
- modified sys-create/sys-mkdir/sys-symlink/sys-rename/sys-remove to
  work with the new operations properly; in general,
  create/remove/rename operations updates the mtime and ctime of the
  parent directory, which is now properly supported
- moved some common server side attribute handling code into a macro
  to make it re-useable across several server state machines
- updated en{de}coding of modified operations
- misc cleanups


Index: chdirent.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/chdirent.sm,v
diff -p -u -r1.4 -r1.5
--- chdirent.sm	17 Aug 2004 17:51:23 -0000	1.4
+++ chdirent.sm	9 Sep 2004 14:29:12 -0000	1.5
@@ -12,12 +12,21 @@
 #include "pvfs2-attr.h"
 #include "gossip.h"
 
+enum
+{
+    UPDATE_DIR_ATTR_REQUIRED = 135
+};
+
 static int chdirent_verify_parent_metadata_and_read_directory_entry_handle(
     PINT_server_op *s_op, job_status_s* js_p);
 static int chdirent_cleanup(
     PINT_server_op *s_op, job_status_s* js_p);
 static int chdirent_change_directory_entry(
     PINT_server_op *s_op, job_status_s* js_p);
+static int chdirent_check_for_req_dir_update(
+    PINT_server_op *s_op, job_status_s *js_p);
+static int chdirent_update_directory_attr(
+    PINT_server_op *s_op, job_status_s *js_p);
 static int chdirent_read_directory_entry(
     PINT_server_op *s_op, job_status_s* js_p);
 static int chdirent_read_directory_entry_failure(
@@ -38,6 +47,8 @@ machine pvfs2_chdirent_sm(
     read_directory_entry_failure,
     change_directory_entry,
     change_directory_entry_failure,
+    check_for_req_dir_update,
+    update_directory_attr,
     setup_resp,
     final_response,
     cleanup)
@@ -72,7 +83,7 @@ machine pvfs2_chdirent_sm(
     state change_directory_entry
     {
         run chdirent_change_directory_entry;
-        success => setup_resp;
+        success => check_for_req_dir_update;
         default => change_directory_entry_failure;
     }
 
@@ -82,6 +93,19 @@ machine pvfs2_chdirent_sm(
         default => setup_resp;
     }
 
+    state check_for_req_dir_update
+    {
+        run chdirent_check_for_req_dir_update;
+        UPDATE_DIR_ATTR_REQUIRED => update_directory_attr;
+        default => setup_resp;
+    }
+
+    state update_directory_attr
+    {
+        run chdirent_update_directory_attr;
+        default => setup_resp;
+    }
+
     state setup_resp
     {
         run chdirent_setup_resp;
@@ -218,10 +242,10 @@ static int chdirent_change_directory_ent
            being changed to itself (?) */
     }
 
-    s_op->key.buffer    = s_op->req->u.chdirent.entry;
+    s_op->key.buffer = s_op->req->u.chdirent.entry;
     s_op->key.buffer_sz = strlen(s_op->req->u.chdirent.entry) + 1;
 
-    s_op->val.buffer    = &s_op->u.chdirent.new_dirent_handle;
+    s_op->val.buffer = &s_op->u.chdirent.new_dirent_handle;
     s_op->val.buffer_sz = sizeof(PVFS_handle);
 
     gossip_debug(GOSSIP_SERVER_DEBUG,
@@ -231,18 +255,78 @@ static int chdirent_change_directory_ent
                  Lu(s_op->u.chdirent.new_dirent_handle));
 
     ret = job_trove_keyval_write(
-        s_op->req->u.chdirent.fs_id,
-        s_op->u.chdirent.dirdata_handle,
-        &s_op->key,
-        &s_op->val,
-        PINT_config_get_trove_sync_meta(
+        s_op->req->u.chdirent.fs_id, s_op->u.chdirent.dirdata_handle,
+        &s_op->key, &s_op->val, PINT_config_get_trove_sync_meta(
             user_opts, s_op->req->u.crdirent.fs_id),
-        NULL,
-        s_op,
-        0,
-        js_p,
-        &j_id,
-        server_job_context);
+        NULL, s_op, 0, js_p, &j_id, server_job_context);
+
+    if (s_op->req->u.chdirent.parent_atime ||
+        s_op->req->u.chdirent.parent_mtime ||
+        s_op->req->u.chdirent.parent_ctime)
+    {
+        s_op->u.chdirent.dir_attr_update_required = 1;
+    }
+    return ret;
+}
+
+static int chdirent_check_for_req_dir_update(
+    PINT_server_op *s_op, job_status_s *js_p)
+{
+    if ((js_p->error_code == 0) &&
+        (s_op->u.chdirent.dir_attr_update_required))
+    {
+        js_p->error_code = UPDATE_DIR_ATTR_REQUIRED;
+    }
+    return 1;
+}
+
+static int chdirent_update_directory_attr(
+    PINT_server_op *s_op, job_status_s *js_p)
+{
+    int ret = -1;
+    job_id_t j_id;
+    PVFS_object_attr tmp_attr, *tmp_attr_ptr = &tmp_attr;
+    PVFS_object_attr *dspace_attr = NULL;
+    PVFS_ds_attributes *ds_attr = NULL;
+    struct server_configuration_s *user_opts = get_server_config_struct();
+
+    PINT_STATE_DEBUG("update_directory_entry");
+
+    if (js_p->error_code != UPDATE_DIR_ATTR_REQUIRED)
+    {
+        PVFS_perror_gossip("previous keyval write failed",
+                           js_p->error_code);
+        return 1;
+    }
+
+    memset(&tmp_attr, 0, sizeof(PVFS_object_attr));
+    dspace_attr = &s_op->attr;
+    ds_attr = &(s_op->ds_attr);
+
+    PVFS_object_attr_overwrite_setable(tmp_attr_ptr, dspace_attr);
+
+    /* overwrite all non-null attribute time fields */
+    if (s_op->req->u.chdirent.parent_atime)
+    {
+        tmp_attr_ptr->atime = s_op->req->u.chdirent.parent_atime;
+    }
+    if (s_op->req->u.chdirent.parent_mtime)
+    {
+        tmp_attr_ptr->mtime = s_op->req->u.chdirent.parent_mtime;
+    }
+    if (s_op->req->u.chdirent.parent_ctime)
+    {
+        tmp_attr_ptr->ctime = s_op->req->u.chdirent.parent_ctime;
+    }
+
+    ds_attr = &(s_op->ds_attr);
+    PVFS_object_attr_to_ds_attr(tmp_attr_ptr, ds_attr);
+
+    ret = job_trove_dspace_setattr(
+        s_op->req->u.chdirent.fs_id, s_op->req->u.chdirent.parent_handle,
+        ds_attr, PINT_config_get_trove_sync_meta(
+            user_opts, s_op->req->u.chdirent.fs_id),
+        s_op, 0, js_p, &j_id, server_job_context);
 
     return ret;
 }

Index: crdirent.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/crdirent.sm,v
diff -p -u -r1.48 -r1.49
--- crdirent.sm	25 Aug 2004 00:35:44 -0000	1.48
+++ crdirent.sm	9 Sep 2004 14:29:12 -0000	1.49
@@ -12,7 +12,11 @@
 #include "pvfs2-server.h"
 #include "pvfs2-attr.h"
 
-#define INVALID_OBJECT 131
+enum
+{
+    INVALID_OBJECT = 131,
+    UPDATE_DIR_ATTR_REQUIRED
+};
 
 static int crdirent_setup_op(
     PINT_server_op *s_op, job_status_s *js_p);
@@ -28,6 +32,10 @@ static int crdirent_create_dirdata_dspac
     PINT_server_op *s_op, job_status_s *js_p);
 static int crdirent_write_dirdata_handle(
     PINT_server_op *s_op, job_status_s *js_p);
+static int crdirent_check_for_req_dir_update(
+    PINT_server_op *s_op, job_status_s *js_p);
+static int crdirent_update_directory_attr(
+    PINT_server_op *s_op, job_status_s *js_p);
 static int crdirent_cleanup(
     PINT_server_op *s_op, job_status_s *js_p);
 static int crdirent_set_error_code(
@@ -100,6 +108,8 @@ machine pvfs2_crdirent_sm(
     setup_op,
     check_not_exist,
     write_directory_entry,
+    check_for_req_dir_update,
+    update_directory_attr,
     cleanup,
     final_response)
 {
@@ -126,6 +136,19 @@ machine pvfs2_crdirent_sm(
     state write_directory_entry
     {
         run crdirent_write_directory_entry;
+        default => check_for_req_dir_update;
+    }
+
+    state check_for_req_dir_update
+    {
+        run crdirent_check_for_req_dir_update;
+        UPDATE_DIR_ATTR_REQUIRED => update_directory_attr;
+        default => final_response;
+    }
+
+    state update_directory_attr
+    {
+        run crdirent_update_directory_attr;
         default => final_response;
     }
 
@@ -208,7 +231,6 @@ static int crdirent_validate(PINT_server
     return 1;
 }
 
-
 /*
  * Function: crdirent_read_directory_entry_handle
  *
@@ -232,9 +254,6 @@ static int crdirent_validate(PINT_server
  * attempt to retrieve the handle for the filename/handle key/val
  * space and if it does not exist, we need to create it.
  *
- * TODO: Semantics here of whether we want to create it here, or upon
- * the creation of the directory.
- *           
  */
 static int crdirent_read_directory_entry_handle(
     PINT_server_op *s_op, job_status_s *js_p)
@@ -408,7 +427,6 @@ static int crdirent_write_dirdata_handle
     return ret;
 }
 
-
 /*
  * Function: crdirent_write_directory_entry
  *
@@ -436,38 +454,102 @@ static int crdirent_write_directory_entr
 
     PINT_STATE_DEBUG("write_directory_entry");
 
+    js_p->error_code = 0;
+
     /* This buffer came from one of two places, either phase two of
      * creating the directory space when we wrote the value back to
      * trove, or from the initial read from trove.
      */
 
     /* this is the name for the parent entry */
-    s_op->key.buffer    = s_op->u.crdirent.name;
+    s_op->key.buffer = s_op->u.crdirent.name;
     s_op->key.buffer_sz = strlen(s_op->u.crdirent.name) + 1;
 
-    s_op->val.buffer    = &s_op->u.crdirent.new_handle;
+    s_op->val.buffer = &s_op->u.crdirent.new_handle;
     s_op->val.buffer_sz = sizeof(PVFS_handle);
 
-    gossip_debug(
-        GOSSIP_SERVER_DEBUG, "  writing new directory entry "
-        "for %s (handle = %Lu) to dirdata dspace %Lu\n",
-        s_op->u.crdirent.name,
-        Lu(s_op->u.crdirent.new_handle),
-        Lu(s_op->u.crdirent.dirent_handle));
+    gossip_debug(GOSSIP_SERVER_DEBUG, "  writing new directory entry "
+                 "for %s (handle = %Lu) to dirdata dspace %Lu\n",
+                 s_op->u.crdirent.name, Lu(s_op->u.crdirent.new_handle),
+                 Lu(s_op->u.crdirent.dirent_handle));
 
     ret = job_trove_keyval_write(
-        s_op->u.crdirent.fs_id,
-        s_op->u.crdirent.dirent_handle,
-        &s_op->key,
-        &s_op->val,
-        PINT_config_get_trove_sync_meta(
+        s_op->u.crdirent.fs_id, s_op->u.crdirent.dirent_handle,
+        &s_op->key, &s_op->val, PINT_config_get_trove_sync_meta(
             user_opts, s_op->u.crdirent.fs_id),
-        NULL,
-        s_op,
-        0,
-        js_p,
-        &i,
-        server_job_context);
+        NULL, s_op, 0, js_p, &i, server_job_context);
+
+    /*
+      check if any attributes have changed on the parent that require
+      an update; object times only are considered
+    */
+    if (s_op->req->u.crdirent.parent_atime ||
+        s_op->req->u.crdirent.parent_mtime ||
+        s_op->req->u.crdirent.parent_ctime)
+    {
+        s_op->u.crdirent.dir_attr_update_required = 1;
+    }
+    return ret;
+}
+
+static int crdirent_check_for_req_dir_update(
+    PINT_server_op *s_op, job_status_s *js_p)
+{
+    if ((js_p->error_code == 0) &&
+        (s_op->u.crdirent.dir_attr_update_required))
+    {
+        js_p->error_code = UPDATE_DIR_ATTR_REQUIRED;
+    }
+    return 1;
+}
+
+static int crdirent_update_directory_attr(
+    PINT_server_op *s_op, job_status_s *js_p)
+{
+    int ret = -1;
+    job_id_t j_id;
+    PVFS_object_attr tmp_attr, *tmp_attr_ptr = &tmp_attr;
+    PVFS_object_attr *dspace_attr = NULL;
+    PVFS_ds_attributes *ds_attr = NULL;
+    struct server_configuration_s *user_opts = get_server_config_struct();
+
+    PINT_STATE_DEBUG("update_directory_entry");
+
+    if (js_p->error_code != UPDATE_DIR_ATTR_REQUIRED)
+    {
+        PVFS_perror_gossip("previous keyval write failed",
+                           js_p->error_code);
+        return 1;
+    }
+
+    memset(&tmp_attr, 0, sizeof(PVFS_object_attr));
+    dspace_attr = &s_op->attr;
+    ds_attr = &(s_op->ds_attr);
+
+    PVFS_object_attr_overwrite_setable(tmp_attr_ptr, dspace_attr);
+
+    /* overwrite all non-null attribute time fields */
+    if (s_op->req->u.crdirent.parent_atime)
+    {
+        tmp_attr_ptr->atime = s_op->req->u.crdirent.parent_atime;
+    }
+    if (s_op->req->u.crdirent.parent_mtime)
+    {
+        tmp_attr_ptr->mtime = s_op->req->u.crdirent.parent_mtime;
+    }
+    if (s_op->req->u.crdirent.parent_ctime)
+    {
+        tmp_attr_ptr->ctime = s_op->req->u.crdirent.parent_ctime;
+    }
+
+    ds_attr = &(s_op->ds_attr);
+    PVFS_object_attr_to_ds_attr(tmp_attr_ptr, ds_attr);
+
+    ret = job_trove_dspace_setattr(
+        s_op->req->u.crdirent.fs_id, s_op->req->u.crdirent.parent_handle,
+        ds_attr, PINT_config_get_trove_sync_meta(
+            user_opts, s_op->req->u.crdirent.fs_id),
+        s_op, 0, js_p, &j_id, server_job_context);
 
     return ret;
 }
@@ -579,6 +661,7 @@ static int crdirent_setup_op(
     s_op->u.crdirent.new_handle = s_op->req->u.crdirent.new_handle;
     s_op->u.crdirent.parent_handle = s_op->req->u.crdirent.parent_handle;
     s_op->u.crdirent.fs_id = s_op->req->u.crdirent.fs_id;
+    s_op->u.crdirent.dir_attr_update_required = 0;
 
     js_p->error_code = 0;
     return 1;

Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/pvfs2-server.c,v
diff -p -u -r1.172 -r1.173
--- pvfs2-server.c	3 Sep 2004 14:57:03 -0000	1.172
+++ pvfs2-server.c	9 Sep 2004 14:29:12 -0000	1.173
@@ -1385,8 +1385,7 @@ int server_state_machine_start_noreq(PIN
     if (new_op)
     {
         /* execute first state */
-        ret = new_op->current_state->state_action(
-            new_op, &tmp_status);
+        ret = new_op->current_state->state_action(new_op, &tmp_status);
         if (ret < 0)
         {
             gossip_lerr("Error: failed to start state machine.\n");
@@ -1408,7 +1407,6 @@ int server_state_machine_start_noreq(PIN
     return ret;
 }
 
-
 /* server_state_machine_complete()
  *
  * function to be called at the completion of state machine execution;
@@ -1428,13 +1426,13 @@ int server_state_machine_complete(PINT_s
                          0, tmp_id, PVFS_EVENT_FLAG_END);
 
     /* release the decoding of the unexpected request */
-    if(ENCODING_IS_VALID(s_op->decoded.enc_type))
+    if (ENCODING_IS_VALID(s_op->decoded.enc_type))
     {
         PINT_decode_release(&(s_op->decoded),PINT_DECODE_REQ);
     }
 
     /* free the buffer that the unexpected request came in on */
-    if(s_op->unexp_bmi_buff.buffer)
+    if (s_op->unexp_bmi_buff.buffer)
     {
         free(s_op->unexp_bmi_buff.buffer);
     }
@@ -1485,41 +1483,41 @@ static void init_req_table(void)
                     PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_create_sm);
             OP_CASE(PVFS_SERV_REMOVE, "remove",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED, &pvfs2_remove_sm);
             OP_CASE(PVFS_SERV_MGMT_REMOVE_OBJECT, "mgmt-remove-object",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED,
                     &pvfs2_mgmt_remove_object_sm);
             OP_CASE(PVFS_SERV_MGMT_REMOVE_DIRENT, "mgmt-remove-dirent",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED,
                     &pvfs2_mgmt_remove_dirent_sm);
             OP_CASE(PVFS_SERV_MGMT_GET_DIRDATA_HANDLE,
                     "mgmt-get-dirdata-handle",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED,
                     &pvfs2_mgmt_get_dirdata_handle_sm);
             OP_CASE(PVFS_SERV_IO, "io",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED, &pvfs2_io_sm);
             OP_CASE(PVFS_SERV_GETATTR, "getattr",
                     PINT_SERVER_CHECK_ATTR,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED, &pvfs2_get_attr_sm);
             OP_CASE(PVFS_SERV_SETATTR, "setattr",
-                    PINT_SERVER_CHECK_ATTR, 
+                    PINT_SERVER_CHECK_ATTR,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED, &pvfs2_set_attr_sm);
             OP_CASE(PVFS_SERV_LOOKUP_PATH, "lookup_path",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_lookup_sm);
             OP_CASE(PVFS_SERV_CRDIRENT, "crdirent",
-                    PINT_SERVER_CHECK_WRITE, 
+                    PINT_SERVER_CHECK_WRITE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_crdirent_sm);
             OP_CASE(PVFS_SERV_RMDIRENT, "rmdirent",
-                    PINT_SERVER_CHECK_WRITE, 
+                    PINT_SERVER_CHECK_WRITE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_rmdirent_sm);
             OP_CASE(PVFS_SERV_CHDIRENT, "chdirent",
-                    PINT_SERVER_CHECK_WRITE, 
+                    PINT_SERVER_CHECK_WRITE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_chdirent_sm);
             OP_CASE(PVFS_SERV_TRUNCATE, "truncate",
                     PINT_SERVER_CHECK_NONE,
@@ -1540,10 +1538,10 @@ static void init_req_table(void)
                     PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_NOT_REQUIRED, &pvfs2_flush_sm);
             OP_CASE(PVFS_SERV_MGMT_SETPARAM, "mgmt_setparam",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_setparam_sm);
             OP_CASE(PVFS_SERV_MGMT_NOOP, "mgmt_noop",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_noop_sm);
             OP_CASE(PVFS_SERV_STATFS, "statfs",
                     PINT_SERVER_CHECK_NONE,
@@ -1552,7 +1550,7 @@ static void init_req_table(void)
                     PINT_SERVER_CHECK_INVALID, 
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_perf_update_sm);
             OP_CASE(PVFS_SERV_MGMT_PERF_MON, "mgmt_perf_mon",
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_perf_mon_sm);
             OP_CASE(PVFS_SERV_MGMT_ITERATE_HANDLES,
                     "mgmt_iterate_handles", PINT_SERVER_CHECK_NONE, 
@@ -1563,13 +1561,13 @@ static void init_req_table(void)
                     PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_REQUIRED, NULL);
             OP_CASE(PVFS_SERV_MGMT_EVENT_MON, "mgmt_event_mon", 
-                    PINT_SERVER_CHECK_NONE, 
+                    PINT_SERVER_CHECK_NONE,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_event_mon_sm);
             OP_CASE(PVFS_SERV_JOB_TIMER, "job_timer",
-                    PINT_SERVER_CHECK_INVALID, 
+                    PINT_SERVER_CHECK_INVALID,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_job_timer_sm);
             OP_CASE(PVFS_SERV_PROTO_ERROR, "proto_error",
-                    PINT_SERVER_CHECK_INVALID, 
+                    PINT_SERVER_CHECK_INVALID,
                     PINT_SERVER_ATTRIBS_REQUIRED, &pvfs2_proto_error_sm);
         }
     }

Index: pvfs2-server.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/pvfs2-server.h,v
diff -p -u -r1.108 -r1.109
--- pvfs2-server.h	8 Sep 2004 19:13:34 -0000	1.108
+++ pvfs2-server.h	9 Sep 2004 14:29:12 -0000	1.109
@@ -40,14 +40,15 @@ extern job_context_id server_job_context
 /* TODO: this should be read from a config file */
 #define PVFS2_SERVER_RESPONSE_TIMEOUT         30
 
-/* the server will give up on a flow if more than PVFS2_SERVER_FLOW_TIMEOUT
- * seconds pass without any progress being made on it
+/* the server will give up on a flow if more than
+ * PVFS2_SERVER_FLOW_TIMEOUT seconds pass without any progress being
+ * made on it
  */
 /* TODO: this should be read from a config file */
 #define PVFS2_SERVER_FLOW_TIMEOUT             30
 
-/* types of permission checking that a server may need to perform
- * for incoming requests
+/* types of permission checking that a server may need to perform for
+ * incoming requests
  */
 enum PINT_server_req_permissions
 {
@@ -59,16 +60,16 @@ enum PINT_server_req_permissions
                                       needs ownership */
 };
 
-/* indicates if the attributes for the target object must exist for the 
- * operation to proceed (see prelude.sm)
+/* indicates if the attributes for the target object must exist for
+ * the operation to proceed (see prelude.sm)
  */
 enum PINT_server_req_attrib_flags
 {
     PINT_SERVER_ATTRIBS_INVALID = 0,
     PINT_SERVER_ATTRIBS_REQUIRED = 1,
-    /* operations that operate on datafiles or on incomplete metafiles do
-     * not expect to necessarily find attributes present before starting the
-     * operation
+    /* operations that operate on datafiles or on incomplete metafiles
+     * do not expect to necessarily find attributes present before
+     * starting the operation
      */
     PINT_SERVER_ATTRIBS_NOT_REQUIRED = 2
 };
@@ -82,11 +83,10 @@ struct PINT_server_req_params
     struct PINT_state_machine_s* sm;
 };
 
-extern struct PINT_server_req_params
-    PINT_server_req_table[];
+extern struct PINT_server_req_params PINT_server_req_table[];
 
-/* TODO: maybe this should be put somewhere else? */
-/* PINT_map_server_op_to_string()
+/*
+ * PINT_map_server_op_to_string()
  *
  * provides a string representation of the server operation number
  *
@@ -95,14 +95,10 @@ extern struct PINT_server_req_params
  */
 static inline char* PINT_map_server_op_to_string(enum PVFS_server_op op)
 {
-    if(op > PVFS_MAX_SERVER_OP)
-	return(NULL);
-
-    return(PINT_server_req_table[op].string_name);
+    return (((op < 0) || (op > PVFS_MAX_SERVER_OP)) ? NULL :
+            PINT_server_req_table[op].string_name);
 }
 
-
-
 /* used to keep a random, but handy, list of keys around */
 typedef struct PINT_server_trove_keys
 {
@@ -148,7 +144,8 @@ typedef enum
  * All the data needed during lookup processing:
  *
  */
-struct PINT_server_lookup_op {
+struct PINT_server_lookup_op
+{
     /* current segment (0..N), number of segments in the path */
     int seg_ct, seg_nr; 
 
@@ -165,31 +162,44 @@ struct PINT_server_lookup_op {
     PVFS_ds_attributes *ds_attr_array;
 };
 
-struct PINT_server_readdir_op {
-    PVFS_handle dirent_handle;       /* holds handle of dirdata dspace from which entries are read */
+struct PINT_server_readdir_op
+{
+    PVFS_handle dirent_handle;  /* holds handle of dirdata dspace from
+                                   which entries are read */
 };
 
-struct PINT_server_chdirent_op
+struct PINT_server_crdirent_op
 {
-    PVFS_handle dirdata_handle;
-    PVFS_handle old_dirent_handle;
-    PVFS_handle new_dirent_handle;
+    char *name;
+    PVFS_handle new_handle;
+    PVFS_handle parent_handle;
+    PVFS_fs_id fs_id;
+    PVFS_handle dirent_handle;  /* holds handle of dirdata dspace that
+                                 * we'll write the dirent into */
+    int dir_attr_update_required;
 };
 
-struct PINT_server_rmdirent_op {
-    PVFS_handle dirdata_handle, entry_handle; /* holds handle of dirdata object, removed entry */
+struct PINT_server_rmdirent_op
+{
+    PVFS_handle dirdata_handle;
+    PVFS_handle entry_handle; /* holds handle of dirdata object,
+                               * removed entry */
+    int dir_attr_update_required;
 };
 
-struct PINT_server_crdirent_op {
-    char* name;
-    PVFS_handle new_handle;
-    PVFS_handle parent_handle;
-    PVFS_fs_id fs_id;
-    PVFS_handle dirent_handle;    /* holds handle of dirdata dspace that we'll write the dirent into */
+struct PINT_server_chdirent_op
+{
+    PVFS_handle dirdata_handle;
+    PVFS_handle old_dirent_handle;
+    PVFS_handle new_dirent_handle;
+    int dir_attr_update_required;
 };
 
-struct PINT_server_remove_op {
-    PVFS_handle dirdata_handle;   /* holds dirdata dspace handle in the event that we are removing a directory */
+struct PINT_server_remove_op
+{
+    PVFS_handle dirdata_handle;   /* holds dirdata dspace handle in
+                                   * the event that we are removing a
+                                   * directory */
 };
 
 struct PINT_server_mgmt_remove_dirent_op
@@ -202,20 +212,25 @@ struct PINT_server_mgmt_get_dirdata_op
     PVFS_handle dirdata_handle;
 };
 
-struct PINT_server_getconfig_op {
-    int strsize; /* used to hold string lengths during getconfig processing */
+struct PINT_server_getconfig_op
+{
+    int strsize; /* used to hold string lengths during getconfig
+                  * processing */
 };
 
-struct PINT_server_io_op {
+struct PINT_server_io_op
+{
     flow_descriptor* flow_d;
 };
 
-struct PINT_server_flush_op {
+struct PINT_server_flush_op
+{
     PVFS_handle handle;	    /* handle of data we want to flush to disk */
     int flags;		    /* any special flags for flush */
 };
 
-struct PINT_server_truncate_op {
+struct PINT_server_truncate_op
+{
     PVFS_handle handle;	    /* handle of datafile we resize */
     PVFS_offset size;	    /* new size of datafile */
 };
@@ -317,9 +332,6 @@ typedef struct PINT_server_op
     gossip_debug(GOSSIP_SERVER_DEBUG, "(%p) %s state: %s\n", s_op,\
     PINT_map_server_op_to_string(s_op->op), fn_name);
 
-/* Globals for Server Interface */
-
-
 /* server operation state machines */
 extern struct PINT_state_machine_s pvfs2_get_config_sm;
 extern struct PINT_state_machine_s pvfs2_get_attr_sm;
@@ -360,10 +372,11 @@ struct server_configuration_s *get_serve
 /* exported state machine resource reclamation function */
 int server_state_machine_complete(PINT_server_op *s_op);
 
-/* starts state machines that are not associated with an incoming request */
-int server_state_machine_alloc_noreq(enum PVFS_server_op op, PINT_server_op**
-    new_op);
-int server_state_machine_start_noreq(PINT_server_op* new_op);
+/* starts state machines not associated with an incoming request */
+int server_state_machine_alloc_noreq(
+    enum PVFS_server_op op, PINT_server_op** new_op);
+int server_state_machine_start_noreq(
+    PINT_server_op *new_op);
 
 /* INCLUDE STATE-MACHINE.H DOWN HERE */
 #define PINT_OP_STATE       PINT_server_op
@@ -371,6 +384,9 @@ int server_state_machine_start_noreq(PIN
 
 #include "state-machine.h"
 
+#endif /* __SM_CHECK_DEP */ 
+#endif /* __PVFS_SERVER_H */
+
 /*
  * Local variables:
  *  c-indent-level: 4
@@ -379,7 +395,3 @@ int server_state_machine_start_noreq(PIN
  *
  * vim: ts=8 sts=4 sw=4 expandtab
  */
-
-#endif /* __SM_CHECK_DEP */ 
-#endif /* __PVFS_SERVER_H */
-

Index: readdir.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/readdir.sm,v
diff -p -u -r1.36 -r1.37
--- readdir.sm	1 Sep 2004 17:32:03 -0000	1.36
+++ readdir.sm	9 Sep 2004 14:29:12 -0000	1.37
@@ -254,7 +254,6 @@ static int readdir_setup_resp(
     return 1;
 }
 
-
 static int readdir_cleanup(
     PINT_server_op *s_op, job_status_s* js_p)
 {

Index: rmdirent.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/rmdirent.sm,v
diff -p -u -r1.36 -r1.37
--- rmdirent.sm	12 Aug 2004 19:53:41 -0000	1.36
+++ rmdirent.sm	9 Sep 2004 14:29:12 -0000	1.37
@@ -12,12 +12,21 @@
 #include "pvfs2-attr.h"
 #include "gossip.h"
 
+enum
+{
+    UPDATE_DIR_ATTR_REQUIRED = 133
+};
+
 static int rmdirent_verify_parent_metadata_and_read_directory_entry_handle(
     PINT_server_op *s_op, job_status_s* js_p);
 static int rmdirent_cleanup(
     PINT_server_op *s_op, job_status_s* js_p);
 static int rmdirent_remove_directory_entry(
     PINT_server_op *s_op, job_status_s* js_p);
+static int rmdirent_check_for_req_dir_update(
+    PINT_server_op *s_op, job_status_s *js_p);
+static int rmdirent_update_directory_attr(
+    PINT_server_op *s_op, job_status_s *js_p);
 static int rmdirent_read_directory_entry(
     PINT_server_op *s_op, job_status_s* js_p);
 static int rmdirent_read_directory_entry_failure(
@@ -38,6 +47,8 @@ machine pvfs2_rmdirent_sm(
     read_directory_entry_failure,
     remove_directory_entry,
     remove_directory_entry_failure,
+    check_for_req_dir_update,
+    update_directory_attr,
     setup_resp,
     final_response,
     cleanup)
@@ -72,7 +83,7 @@ machine pvfs2_rmdirent_sm(
     state remove_directory_entry
     {
         run rmdirent_remove_directory_entry;
-        success => setup_resp;
+        success => check_for_req_dir_update;
         default => remove_directory_entry_failure;
     }
 
@@ -82,6 +93,19 @@ machine pvfs2_rmdirent_sm(
         default => setup_resp;
     }
 
+    state check_for_req_dir_update
+    {
+        run rmdirent_check_for_req_dir_update;
+        UPDATE_DIR_ATTR_REQUIRED => update_directory_attr;
+        default => setup_resp;
+    }
+
+    state update_directory_attr
+    {
+        run rmdirent_update_directory_attr;
+        default => setup_resp;
+    }
+
     state setup_resp
     {
         run rmdirent_setup_resp;
@@ -238,27 +262,86 @@ static int rmdirent_remove_directory_ent
     PINT_STATE_DEBUG("remove_directory_entry");
 
     /* set up key and structure for keyval remove */
-    s_op->key.buffer    = s_op->req->u.rmdirent.entry;
+    s_op->key.buffer = s_op->req->u.rmdirent.entry;
     s_op->key.buffer_sz = strlen(s_op->req->u.rmdirent.entry) + 1;
 
-    gossip_debug(
-        GOSSIP_SERVER_DEBUG,
-        "  removing entry %s from dirdata object (handle = %Lu)\n",
-        s_op->req->u.rmdirent.entry,
-        Lu(s_op->u.rmdirent.dirdata_handle));
+    gossip_debug(GOSSIP_SERVER_DEBUG, "  removing entry %s from dirdata "
+                 "object (handle = %Lu)\n", s_op->req->u.rmdirent.entry,
+                 Lu(s_op->u.rmdirent.dirdata_handle));
 
     ret = job_trove_keyval_remove(
-        s_op->req->u.rmdirent.fs_id,
-        s_op->u.rmdirent.dirdata_handle,
-        &s_op->key,
-        PINT_config_get_trove_sync_meta(
+        s_op->req->u.rmdirent.fs_id, s_op->u.rmdirent.dirdata_handle,
+        &s_op->key, PINT_config_get_trove_sync_meta(
             user_opts, s_op->req->u.rmdirent.fs_id),
-        NULL,
-        s_op,
-        0,
-        js_p,
-        &j_id,
-        server_job_context);
+        NULL, s_op, 0, js_p, &j_id, server_job_context);
+
+    if (s_op->req->u.rmdirent.parent_atime ||
+        s_op->req->u.rmdirent.parent_mtime ||
+        s_op->req->u.rmdirent.parent_ctime)
+    {
+        s_op->u.rmdirent.dir_attr_update_required = 1;
+    }
+    return ret;
+}
+
+static int rmdirent_check_for_req_dir_update(
+    PINT_server_op *s_op, job_status_s *js_p)
+{
+    if ((js_p->error_code == 0) &&
+        (s_op->u.rmdirent.dir_attr_update_required))
+    {
+        js_p->error_code = UPDATE_DIR_ATTR_REQUIRED;
+    }
+    return 1;
+}
+
+static int rmdirent_update_directory_attr(
+    PINT_server_op *s_op, job_status_s *js_p)
+{
+    int ret = -1;
+    job_id_t j_id;
+    PVFS_object_attr tmp_attr, *tmp_attr_ptr = &tmp_attr;
+    PVFS_object_attr *dspace_attr = NULL;
+    PVFS_ds_attributes *ds_attr = NULL;
+    struct server_configuration_s *user_opts = get_server_config_struct();
+
+    PINT_STATE_DEBUG("update_directory_entry");
+
+    if (js_p->error_code != UPDATE_DIR_ATTR_REQUIRED)
+    {
+        PVFS_perror_gossip("previous keyval remove failed",
+                           js_p->error_code);
+        return 1;
+    }
+
+    memset(&tmp_attr, 0, sizeof(PVFS_object_attr));
+    dspace_attr = &s_op->attr;
+    ds_attr = &(s_op->ds_attr);
+
+    PVFS_object_attr_overwrite_setable(tmp_attr_ptr, dspace_attr);
+
+    /* overwrite all non-null attribute time fields */
+    if (s_op->req->u.rmdirent.parent_atime)
+    {
+        tmp_attr_ptr->atime = s_op->req->u.rmdirent.parent_atime;
+    }
+    if (s_op->req->u.rmdirent.parent_mtime)
+    {
+        tmp_attr_ptr->mtime = s_op->req->u.rmdirent.parent_mtime;
+    }
+    if (s_op->req->u.rmdirent.parent_ctime)
+    {
+        tmp_attr_ptr->ctime = s_op->req->u.rmdirent.parent_ctime;
+    }
+
+    ds_attr = &(s_op->ds_attr);
+    PVFS_object_attr_to_ds_attr(tmp_attr_ptr, ds_attr);
+
+    ret = job_trove_dspace_setattr(
+        s_op->req->u.rmdirent.fs_id, s_op->req->u.rmdirent.parent_handle,
+        ds_attr, PINT_config_get_trove_sync_meta(
+            user_opts, s_op->req->u.rmdirent.fs_id),
+        s_op, 0, js_p, &j_id, server_job_context);
 
     return ret;
 }

Index: set-attr.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/set-attr.sm,v
diff -p -u -r1.53 -r1.54
--- set-attr.sm	17 Aug 2004 17:51:24 -0000	1.53
+++ set-attr.sm	9 Sep 2004 14:29:12 -0000	1.54
@@ -113,18 +113,18 @@ static int setattr_verify_attribs(
     req_a_p = &s_op->req->u.setattr.attr;
 
     gossip_debug(GOSSIP_SERVER_DEBUG, "  attrs read from dspace = "
-		 "(owner = %d, group = %d, perms = %o, type = %d)\n",
-		 a_p->owner,
-		 a_p->group,
-		 a_p->perms,
-		 a_p->objtype);
+                 "(owner = %d, group = %d, perms = %o, type = %d)\n",
+                 a_p->owner,
+                 a_p->group,
+                 a_p->perms,
+                 a_p->objtype);
 
     gossip_debug(GOSSIP_SERVER_DEBUG, "  attrs read from request = "
-		 "(owner = %d, group = %d, perms = %o, type = %d)\n",
-		 req_a_p->owner,
-		 req_a_p->group,
-		 req_a_p->perms,
-		 req_a_p->objtype);
+                 "(owner = %d, group = %d, perms = %o, type = %d)\n",
+                 req_a_p->owner,
+                 req_a_p->group,
+                 req_a_p->perms,
+                 req_a_p->objtype);
 
     /*
       here we're enforcing that no one can change the type of the
@@ -133,16 +133,16 @@ static int setattr_verify_attribs(
       been assigned yet)
     */
     if (a_p->objtype &&
-	(a_p->objtype != s_op->req->u.setattr.attr.objtype))
+        (a_p->objtype != s_op->req->u.setattr.attr.objtype))
     {
-	gossip_debug(GOSSIP_SERVER_DEBUG, "  handle %Lu is of type %d "
-		     "and cannot be changed to type %d\n",
-		     Lu(s_op->req->u.setattr.handle),
-		     a_p->objtype, s_op->req->u.setattr.attr.objtype);
-
-	/* set an error to bail out of set-attr processing */
-	js_p->error_code = -PVFS_EACCES;
-	return 1;
+        gossip_debug(GOSSIP_SERVER_DEBUG, "  handle %Lu is of type %d "
+                     "and cannot be changed to type %d\n",
+                     Lu(s_op->req->u.setattr.handle),
+                     a_p->objtype, s_op->req->u.setattr.attr.objtype);
+
+        /* set an error to bail out of set-attr processing */
+        js_p->error_code = -PVFS_EACCES;
+        return 1;
     }
 
     js_p->error_code = 0;
@@ -150,15 +150,15 @@ static int setattr_verify_attribs(
     if ((req_a_p->objtype == PVFS_TYPE_METAFILE) ||
         (a_p->objtype == PVFS_TYPE_METAFILE))
     {
-	gossip_debug(GOSSIP_SERVER_DEBUG,
-		     "  handle %Lu refers to a metafile\n",
-		     Lu(s_op->req->u.setattr.handle));
+        gossip_debug(GOSSIP_SERVER_DEBUG,
+                     "  handle %Lu refers to a metafile\n",
+                     Lu(s_op->req->u.setattr.handle));
 
-	gossip_debug(
+        gossip_debug(
             GOSSIP_SERVER_DEBUG, " ** dspace has dfile count of %d | "
             "request has dfile count of %d\n",
             a_p->u.meta.dfile_count, req_a_p->u.meta.dfile_count);
-	gossip_debug(
+        gossip_debug(
             GOSSIP_SERVER_DEBUG, " ** dspace has dist size of %d | "
             "request has dist size of %d\n",
             a_p->u.meta.dist_size, req_a_p->u.meta.dist_size);
@@ -192,28 +192,28 @@ static int setattr_verify_attribs(
                          " *** ignoring dist_size of %d\n",
                          req_a_p->u.meta.dist_size);
         }
-	js_p->error_code = STATE_METAFILE;
+        js_p->error_code = STATE_METAFILE;
     }
     else if ((req_a_p->objtype == PVFS_TYPE_DATAFILE) ||
              (a_p->objtype == PVFS_TYPE_DATAFILE))
     {
-	gossip_debug(GOSSIP_SERVER_DEBUG,
-		     "  handle %Lu refers to a datafile\n",
-		     Lu(s_op->req->u.setattr.handle));
+        gossip_debug(GOSSIP_SERVER_DEBUG,
+                     "  handle %Lu refers to a datafile\n",
+                     Lu(s_op->req->u.setattr.handle));
     }
     else if ((req_a_p->objtype == PVFS_TYPE_DIRECTORY) ||
              (a_p->objtype == PVFS_TYPE_DIRECTORY))
     {
-	gossip_debug(GOSSIP_SERVER_DEBUG,
-		     "  handle %Lu refers to a directory\n",
-		     Lu(s_op->req->u.setattr.handle));
+        gossip_debug(GOSSIP_SERVER_DEBUG,
+                     "  handle %Lu refers to a directory\n",
+                     Lu(s_op->req->u.setattr.handle));
     }
     else if ((req_a_p->objtype == PVFS_TYPE_SYMLINK) ||
              (a_p->objtype == PVFS_TYPE_SYMLINK))
     {
-	gossip_debug(GOSSIP_SERVER_DEBUG,
-		     "  handle %Lu refers to a symlink\n",
-		     Lu(s_op->req->u.setattr.handle));
+        gossip_debug(GOSSIP_SERVER_DEBUG,
+                     "  handle %Lu refers to a symlink\n",
+                     Lu(s_op->req->u.setattr.handle));
 
         if (req_a_p->mask & PVFS_ATTR_SYMLNK_ALL)
         {
@@ -233,17 +233,17 @@ static int setattr_verify_attribs(
     else if ((req_a_p->objtype == PVFS_TYPE_DIRDATA) ||
              (a_p->objtype == PVFS_TYPE_DIRDATA))
     {
-	gossip_debug(GOSSIP_SERVER_DEBUG,
-		     "  handle %Lu refers to a dirdata object\n",
-		     Lu(s_op->req->u.setattr.handle));
+        gossip_debug(GOSSIP_SERVER_DEBUG,
+                     "  handle %Lu refers to a dirdata object\n",
+                     Lu(s_op->req->u.setattr.handle));
     }
     else
     {
-	gossip_debug(GOSSIP_SERVER_DEBUG,
-		     "  handle %Lu refers to something unknown\n",
-		     Lu(s_op->req->u.setattr.handle));
+        gossip_debug(GOSSIP_SERVER_DEBUG,
+                     "  handle %Lu refers to something unknown\n",
+                     Lu(s_op->req->u.setattr.handle));
 
-	js_p->error_code = -PVFS_EACCES;
+        js_p->error_code = -PVFS_EACCES;
     }
     return 1;
 }
@@ -264,80 +264,34 @@ static int setattr_setobj_attribs(PINT_s
 
     if (a_p->mask & PVFS_ATTR_META_DFILES)
     {
-        gossip_debug(
-            GOSSIP_SERVER_DEBUG, " request has dfile_count of %d | "
-            "dspace has %d\n",
-            s_op->req->u.setattr.attr.u.meta.dfile_count,
-            s_op->attr.u.meta.dfile_count);
+        gossip_debug(GOSSIP_SERVER_DEBUG, " request has dfile_count of "
+                     "%d | dspace has %d\n",
+                     s_op->req->u.setattr.attr.u.meta.dfile_count,
+                     s_op->attr.u.meta.dfile_count);
 
-        gossip_debug(
-            GOSSIP_SERVER_DEBUG, " writing count of %d to disk\n",
-            dspace_a_p->u.meta.dfile_count);
+        gossip_debug(GOSSIP_SERVER_DEBUG, " writing count of %d to "
+                     "disk\n", dspace_a_p->u.meta.dfile_count);
     }
 
     /*
       we have the attribs stored in the dspace, as well as the
-      requested attribs to store.  overwrite the ones that are
-      setable and specified by the mask value in the request.
+      requested attribs to store.  overwrite the ones that are setable
+      and specified by the mask value in the request; macro defined in
+      pvfs2-storage.h
     */
-    if (a_p->mask & PVFS_ATTR_COMMON_UID)
-    {
-        dspace_a_p->owner = a_p->owner;
-    }
-    if (a_p->mask & PVFS_ATTR_COMMON_GID)
-    {
-        dspace_a_p->group = a_p->group;
-    }
-    if (a_p->mask & PVFS_ATTR_COMMON_PERM)
-    {
-        dspace_a_p->perms = a_p->perms;
-    }
-    if (a_p->mask & PVFS_ATTR_COMMON_ATIME)
-    {
-        dspace_a_p->atime = a_p->atime;
-    }
-    if (a_p->mask & PVFS_ATTR_COMMON_CTIME)
-    {
-        dspace_a_p->ctime = a_p->ctime;
-    }
-    if (a_p->mask & PVFS_ATTR_COMMON_MTIME)
-    {
-        dspace_a_p->mtime = a_p->mtime;
-    }
-
-    dspace_a_p->u.meta.dfile_count = 0;
-    dspace_a_p->u.meta.dist_size = 0;
-
-    if (a_p->mask & PVFS_ATTR_COMMON_TYPE)
-    {
-        dspace_a_p->objtype = a_p->objtype;
-        if ((a_p->objtype == PVFS_TYPE_METAFILE) && (a_p->mask &
-	    PVFS_ATTR_META_DIST))
-        {
-            dspace_a_p->u.meta.dist_size = a_p->u.meta.dist_size;
-        }
-        if ((a_p->objtype == PVFS_TYPE_METAFILE) && (a_p->mask &
-	    PVFS_ATTR_META_DFILES))
-        {
-            dspace_a_p->u.meta.dfile_count = a_p->u.meta.dfile_count;
-	}
-    }
+    PVFS_object_attr_overwrite_setable(dspace_a_p, a_p);
 
     gossip_debug(GOSSIP_SERVER_DEBUG,
                  "  attrs to write = (owner = %d, group = %d, "
-                 "perms = %o, type = %d, atime = %lld, mtime = %lld, "
-                 "ctime = %lld | dfile_count=%d | dist_size=%d)\n",
-		 dspace_a_p->owner,
-		 dspace_a_p->group,
-		 dspace_a_p->perms,
-		 dspace_a_p->objtype,
-		 (long long)dspace_a_p->atime,
-		 (long long)dspace_a_p->mtime,
-		 (long long)dspace_a_p->ctime,
+                 "perms = %o, type = %d, atime = %Ld, mtime = %Ld, "
+                 "ctime = %Ld | dfile_count=%d | dist_size=%d)\n",
+                 dspace_a_p->owner, dspace_a_p->group, dspace_a_p->perms,
+                 dspace_a_p->objtype, Ld(dspace_a_p->atime),
+                 Ld(dspace_a_p->mtime), Ld(dspace_a_p->ctime),
                  (int)dspace_a_p->u.meta.dfile_count,
                  (int)dspace_a_p->u.meta.dist_size);
 
-    /* finally, translate attrs to storage attr format */
+    /* translate attrs to storage attr format */
     ds_attr = &(s_op->ds_attr);
     PVFS_object_attr_to_ds_attr(dspace_a_p, ds_attr);
 
@@ -345,8 +299,7 @@ static int setattr_setobj_attribs(PINT_s
         s_op->req->u.setattr.fs_id, s_op->req->u.setattr.handle,
         ds_attr, PINT_config_get_trove_sync_meta(
             user_opts, s_op->req->u.setattr.fs_id),
-        s_op, 0 /* status tag */, js_p, &j_id,
-        server_job_context);
+        s_op, 0, js_p, &j_id, server_job_context);
 
     return ret;
 }
@@ -379,8 +332,8 @@ static int setattr_write_metafile_datafi
     {
         gossip_err("The requested dfile count of %d is invalid; "
                    "aborting operation.\n", dfile_count);
-	js_p->error_code = -PVFS_EOVERFLOW;
-	return 1;
+        js_p->error_code = -PVFS_EOVERFLOW;
+        return 1;
     }
 
     /* set up key and value structure for keyval write */
@@ -388,8 +341,8 @@ static int setattr_write_metafile_datafi
     s_op->key.buffer_sz = Trove_Common_Keys[METAFILE_HANDLES_KEY].size;
 
     gossip_debug(GOSSIP_SERVER_DEBUG,
-		 "  metafile has %d datafiles associated with it\n",
-		 s_op->req->u.setattr.attr.u.meta.dfile_count);
+                 "  metafile has %d datafiles associated with it\n",
+                 s_op->req->u.setattr.attr.u.meta.dfile_count);
 
     s_op->val.buffer    = s_op->req->u.setattr.attr.u.meta.dfile_array;
     s_op->val.buffer_sz = dfile_count * sizeof(PVFS_handle);
@@ -440,8 +393,8 @@ static int setattr_write_metafile_distri
     s_op->key.buffer_sz = Trove_Common_Keys[METAFILE_DIST_KEY].size;
 
     gossip_debug(GOSSIP_SERVER_DEBUG,
-		 "  metafile distribution size = %d\n",
-		 (int)s_op->req->u.setattr.attr.u.meta.dist_size);
+                 "  metafile distribution size = %d\n",
+                 (int)s_op->req->u.setattr.attr.u.meta.dist_size);
 
     s_op->val.buffer    = s_op->req->u.setattr.attr.u.meta.dist;
     s_op->val.buffer_sz = s_op->req->u.setattr.attr.u.meta.dist_size;
@@ -502,21 +455,21 @@ static int setattr_write_symlink_target_
     s_op->key.buffer_sz = Trove_Common_Keys[SYMLINK_TARGET_KEY].size;
 
     gossip_debug(GOSSIP_SERVER_DEBUG,
-		 "  symlink target_path_len = %d\n",
-		 s_op->req->u.setattr.attr.u.sym.target_path_len);
+                 "  symlink target_path_len = %d\n",
+                 s_op->req->u.setattr.attr.u.sym.target_path_len);
 
     s_op->val.buffer    = s_op->req->u.setattr.attr.u.sym.target_path;
     s_op->val.buffer_sz = s_op->req->u.setattr.attr.u.sym.target_path_len;
 
     gossip_debug(GOSSIP_SERVER_DEBUG,
-		 "  writing symlink target (coll_id = 0x%x, handle = "
+                 "  writing symlink target (coll_id = 0x%x, handle = "
                  "%Lu, key = %s (%d), val_buf = %p (%d))\n",
-		 s_op->req->u.setattr.fs_id,
-		 Lu(s_op->req->u.setattr.handle),
-		 (char *) s_op->key.buffer,
-		 s_op->key.buffer_sz,
-		 s_op->val.buffer,
-		 s_op->val.buffer_sz);
+                 s_op->req->u.setattr.fs_id,
+                 Lu(s_op->req->u.setattr.handle),
+                 (char *) s_op->key.buffer,
+                 s_op->key.buffer_sz,
+                 s_op->val.buffer,
+                 s_op->val.buffer_sz);
 
     ret = job_trove_keyval_write(
         s_op->req->u.setattr.fs_id,



More information about the PVFS2-CVS mailing list