[PVFS2-CVS] commit by neill in pvfs2/src/common/misc: pvfs2-util.c

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


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

Modified Files:
	pvfs2-util.c 
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: pvfs2-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-util.c,v
diff -p -u -r1.68 -r1.69
--- pvfs2-util.c	28 Jul 2004 14:32:37 -0000	1.68
+++ pvfs2-util.c	9 Sep 2004 14:29:10 -0000	1.69
@@ -12,6 +12,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <sys/types.h>
+#include <sys/time.h>
 
 #include "pvfs2-config.h"
 #include "pvfs2-sysint.h"
@@ -35,7 +36,6 @@
 #define PVFS_util_min(x1,x2) ((x1) > (x2))? (x2):(x1)
 #endif
 
-
 #define PVFS2_MAX_INVALID_MNTENTS                     256
 #define PVFS2_MAX_TABFILES                              8
 #define PVFS2_DYNAMIC_TAB_INDEX  (PVFS2_MAX_TABFILES - 1)
@@ -1177,10 +1177,17 @@ void PINT_release_pvfstab(void)
     }
 
     gen_mutex_unlock(&s_stat_tab_mutex);
-    return;
 }
 
+PVFS_time PVFS_util_get_current_time(void)
+{
+    struct timeval t = {0,0};
+    PVFS_time current_time = 0;
 
+    gettimeofday(&t, NULL);
+    current_time = (PVFS_time)t.tv_sec;
+    return current_time;
+}
 
 /*
  * Local variables:



More information about the PVFS2-CVS mailing list