[Pvfs2-cvs] commit by kunkel in pvfs2/src/io/trove/trove-dbpf: dbpf-bstream-threaded.c

CVS commit program cvs at parl.clemson.edu
Wed Aug 2 17:56:59 EDT 2006


Update of /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf
In directory parlweb1:/tmp/cvs-serv3364/src/io/trove/trove-dbpf

Modified Files:
      Tag: kunkel-branch
	dbpf-bstream-threaded.c 
Log Message:



Index: dbpf-bstream-threaded.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/Attic/dbpf-bstream-threaded.c,v
diff -p -u -r1.1.2.9 -r1.1.2.10
--- dbpf-bstream-threaded.c	2 Aug 2006 02:13:03 -0000	1.1.2.9
+++ dbpf-bstream-threaded.c	2 Aug 2006 21:56:59 -0000	1.1.2.10
@@ -35,8 +35,7 @@
 #include "pthread.h"
 #include "dbpf-bstream.h"
 
-#define PREAD pread
-#define PWRITE pwrite
+
 
 /*
  * Size for doing only one read operation instead of 
@@ -59,6 +58,33 @@
  * THIS IS DEFINITELY A HACK FOR NOW, for evaluation purpose only ! 
  */
 /*#define THREADS_SCHEDULE_ONLY_ONE_HANDLE 1*/
+    
+int PREAD(int fd, void *buf, size_t count, off_t offset);
+int PWRITE(int fd, const void *buf, size_t count, off_t offset);
+
+inline int PREAD(int fd, void *buf, size_t count, off_t offset){
+    int ret = 0;
+    int retSize = 0;
+    do{
+        ret = pread(fd, buf, count, offset);
+        if (ret){
+            retSize +=ret;
+        }
+    }while(ret == -1 && errno == EINTR);
+    return retSize;
+}
+
+inline int PWRITE(int fd, const void *buf, size_t count, off_t offset){
+    int ret = 0;
+    int retSize = 0;
+    do{
+        ret = pwrite(fd, buf, count, offset);
+        if (ret){
+            retSize +=ret;
+        }
+    }while(ret == -1 && errno == EINTR);
+    return retSize;
+}
 
 enum active_queue_e
 {



More information about the Pvfs2-cvs mailing list