[PVFS2-CVS] commit by neill in pvfs2/src/client/sysint: sys-readdir.sm

CVS commit program cvs at parl.clemson.edu
Tue Oct 19 12:02:51 EDT 2004


Update of /projects/cvsroot/pvfs2/src/client/sysint
In directory parlweb:/tmp/cvs-serv31256/src/client/sysint

Modified Files:
	sys-readdir.sm 
Log Message:
- fixed test program ls.c and admin program pvfs2-ls.c to not issue
  an extra call to readdir on every run by fixing a slight logic bug
- changed some readdir debugging
- added a directory version that is passed back from the server to
  the client on each successful readdir call (happens to be the
  directory's mtime encoded as an opaque uint64_t)
- updated client and server response structures and encoder to
  accomodate this
- NOTE: the versioning is not perfect since retrieving the directory
  mtime and iterating the handle list isn't an atomic operation with
  respect to the overall readdir op; i.e. there's still a window where
  a difference may not be detected.  then again, since the mtime is in
  seconds granularity, this should not present a major detectable
  problem anyway.  can use a different version number if problems
  arise often in practice


Index: sys-readdir.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-readdir.sm,v
diff -p -u -r1.30 -r1.31
--- sys-readdir.sm	13 Oct 2004 21:03:00 -0000	1.30
+++ sys-readdir.sm	19 Oct 2004 15:02:51 -0000	1.31
@@ -267,6 +267,8 @@ static int readdir_msg_comp_fn(void *v_p
     assert(sm_p->u.readdir.readdir_resp);
 
     sm_p->u.readdir.readdir_resp->token = resp_p->u.readdir.token;
+    sm_p->u.readdir.readdir_resp->directory_version =
+        resp_p->u.readdir.directory_version;
     sm_p->u.readdir.readdir_resp->pvfs_dirent_outcount =
         resp_p->u.readdir.dirent_count;
     if (sm_p->u.readdir.readdir_resp->pvfs_dirent_outcount > 0)
@@ -297,9 +299,11 @@ static int readdir_msg_comp_fn(void *v_p
                 sm_p->object_ref);
         }
     }
-    gossip_debug(
-        GOSSIP_READDIR_DEBUG, "*** Got %d directory entries\n",
-        sm_p->u.readdir.readdir_resp->pvfs_dirent_outcount);
+
+    gossip_debug(GOSSIP_READDIR_DEBUG, "*** Got %d directory entries "
+                 "[version %Ld]\n",
+                 sm_p->u.readdir.readdir_resp->pvfs_dirent_outcount,
+                 sm_p->u.readdir.readdir_resp->directory_version);
 
     return 0;
 }



More information about the PVFS2-CVS mailing list