[PVFS2-CVS] commit by wujs in pvfs2/src/io/buffer: internal.c

CVS commit program cvs at parl.clemson.edu
Tue Sep 21 16:59:46 EDT 2004


Update of /projects/cvsroot/pvfs2/src/io/buffer
In directory parlweb:/tmp/cvs-serv24426

Modified Files:
	internal.c 
Log Message:
Bug fix for contiguous access.



Index: internal.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/buffer/internal.c,v
diff -p -u -r1.3 -r1.4
--- internal.c	21 Sep 2004 13:46:12 -0000	1.3
+++ internal.c	21 Sep 2004 19:59:46 -0000	1.4
@@ -296,14 +296,24 @@ static inline int NCAC_rwjob_prepare_sin
     foff[0] = ncac_req->pos - firstoff;
     cbufoff[0] = (char*)firstoff;     /* offsize to the extent address */
     cbufsize[0] = NCAC_dev.extsize - firstoff;
+    cbufflag[0] = NCAC_COMM_NOT_READY;
 
     for ( i= 1; i < comcnt; i++){
-        foff[i] = foff[i-1] + cbufsize[i-1];
+        foff[i] = foff[i-1] + NCAC_dev.extsize;
         cbufoff[i] = 0;
         cbufsize[i] = NCAC_dev.extsize;
         cbufflag[i] = NCAC_COMM_NOT_READY;
     }
+    /* adjust the size of the last buffer in each segment. */
     cbufsize[comcnt-1] = (ncac_req->pos + ncac_req->size)% NCAC_dev.extsize;
+
+#if 1
+    fprintf(stderr, "[%s] exit %d comm buffers\n", __FUNCTION__, comcnt);
+    for (i=0; i<comcnt; i++){
+        fprintf(stderr, "fpos:%Ld, buf_off:%ld, size:%Ld\n", foff[i],
+(unsigned long)cbufoff[i], cbufsize[i]);
+    }
+#endif
 
     fprintf(stderr, "[%s] exit %d comm buffers\n", __FUNCTION__, comcnt);
     return 0;



More information about the PVFS2-CVS mailing list