[PVFS2-CVS] commit by slang in pvfs2/src/io/buffer: internal.c ncac-job.c ncac-lru.c ncac-trove.c state.c

CVS commit program cvs at parl.clemson.edu
Wed Nov 9 20:27:04 EST 2005


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

Modified Files:
	internal.c ncac-job.c ncac-lru.c ncac-trove.c state.c 
Log Message:
* malloc.h is obsolete in freebsd, check for it
* No error.h in freebsd
* linux allows Lu,Lx, and Ld to be interchangeable with llu,llx, and
lld.  Other platforms (solaris, bsd) don't.  Replaced all the L*
with ll*.
* bsd doesn't have mntent.h.  use fstab.h and our own funcs.
* bsd doesn't know about ssize_t.  Use size_t instead.
* bsd doesn't have asm errnos.  Check for each of those
errno macros and if not defined define to -1
* check for db3/db.h db4/db.h header if db path is specified using
--with-db
* darwin has aio support builtin, doesn't need -lrt
* remove kernel stuff in pvfs2-types.h that sets WORDSIZE.  gcc
defines __LP64__ on archs with 64bit longs so we use that instead.
* darwin's open doesn't accept O_LARGEFILE.  off_t is an int64 by
default.  define O_LARGEFILE if it hasn't been.
* need to run ranlib on darwin after libpvfs2.a gets installed to regenerate
table of contents



Index: internal.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/buffer/internal.c,v
diff -p -u -r1.6 -r1.7
--- internal.c	25 Oct 2005 18:00:58 -0000	1.6
+++ internal.c	10 Nov 2005 01:27:04 -0000	1.7
@@ -315,8 +315,8 @@ static inline int NCAC_rwjob_prepare_sin
 #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", Ld(foff[i]),
-(unsigned long)cbufoff[i], Ld(cbufsize[i]));
+        fprintf(stderr, "fpos:%lld, buf_off:%ld, size:%lld\n", lld(foff[i]),
+(unsigned long)cbufoff[i], lld(cbufsize[i]));
     }
 #endif
 
@@ -449,8 +449,8 @@ static inline int NCAC_rwjob_prepare_lis
 
 #if  1
     for (i=0; i<ncac_req->offcnt; i++){
-        fprintf(stderr, "fpos:%Ld, size:%Ld\n", Ld(fregions[i].fpos),
-Ld(fregions[i].size));
+        fprintf(stderr, "fpos:%lld, size:%lld\n", lld(fregions[i].fpos),
+lld(fregions[i].size));
     }
 #endif
 
@@ -490,8 +490,8 @@ Ld(fregions[i].size));
 #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", Ld(foff[i]),
-(unsigned long)cbufoff[i], Ld(cbufsize[i]));
+        fprintf(stderr, "fpos:%lld, buf_off:%ld, size:%lld\n", lld(foff[i]),
+(unsigned long)cbufoff[i], lld(cbufsize[i]));
     }
 #endif
 
@@ -776,7 +776,7 @@ static inline struct inode *get_inode(PV
 	/* search the inode list with the index of "inode_index" */
 	inode = search_inode_list (handle);
 
-	fprintf(stderr, "handle: %Ld, index: %d, inode:%p\n", Ld(handle), inode_index, inode);
+	fprintf(stderr, "handle: %lld, index: %d, inode:%p\n", lld(handle), inode_index, inode);
 
 	if ( NULL == inode ){
 		inode=(struct inode*)malloc(sizeof(struct inode));
@@ -811,7 +811,7 @@ static inline struct inode *get_inode(PV
 static inline void extent_dump(struct extent *extent)
 {
 	fprintf(stderr, "flags:%x\t status:%d\t	index:%d\t\n", (int)extent->flags, extent->status, (int)extent->index);
-	fprintf(stderr, "writes:%d\t reads:%d\t	ioreq:%Ld\t\n", extent->writes, extent->reads, Ld(extent->ioreq));
+	fprintf(stderr, "writes:%d\t reads:%d\t	ioreq:%lld\t\n", extent->writes, extent->reads, lld(extent->ioreq));
 
 }
 

Index: ncac-job.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/buffer/ncac-job.c,v
diff -p -u -r1.7 -r1.8
--- ncac-job.c	25 Oct 2005 18:00:58 -0000	1.7
+++ ncac-job.c	10 Nov 2005 01:27:04 -0000	1.8
@@ -117,7 +117,7 @@ int NCAC_do_a_read_job(struct NCAC_req *
         if ( cbufhash[i] ){
             ret = 1;
             if ( PageReadPending(cbufhash[i]) ){
-                fprintf(stderr, "extent:%p ioreq:%Ld\n", cbufhash[i], Ld(cbufhash[i]->ioreq));
+                fprintf(stderr, "extent:%p ioreq:%lld\n", cbufhash[i], lld(cbufhash[i]->ioreq));
                 ret = check_extent_read(ncac_req, cbufhash[i]);
                 if (ret < 0){
 				    ncac_req->error = ret;	
@@ -286,7 +286,7 @@ static inline int init_extent_read(NCAC_
         return ret;
     }
     extent->ioreq = ioreq;
-    fprintf(stderr, "init_extent_read: foff:%Ld, size:%Ld, extent:%p, opid:%Ld\n", Ld(foffset), Ld(size), extent, Ld(ioreq));
+    fprintf(stderr, "init_extent_read: foff:%lld, size:%lld, extent:%p, opid:%lld\n", lld(foffset), lld(size), extent, lld(ioreq));
     return 0;
 }
 

Index: ncac-lru.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/buffer/ncac-lru.c,v
diff -p -u -r1.4 -r1.5
--- ncac-lru.c	26 Oct 2005 16:27:18 -0000	1.4
+++ ncac-lru.c	10 Nov 2005 01:27:04 -0000	1.5
@@ -62,8 +62,8 @@ int LRU_shrink_cache(struct cache_stack 
         if (PageReadPending(victim) || PageWritePending(victim)){
             ret = NCAC_check_ioreq(victim);
             if (ret < 0){
-                NCAC_error("NCAC_check_ioreq error: index=%ld, ioreq=%Ld\n",
-                        victim->index, Ld(victim->ioreq));
+                NCAC_error("NCAC_check_ioreq error: index=%ld, ioreq=%lld\n",
+                        victim->index, lld(victim->ioreq));
                 break;
             }
 

Index: ncac-trove.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/buffer/ncac-trove.c,v
diff -p -u -r1.4 -r1.5
--- ncac-trove.c	25 Oct 2005 18:00:58 -0000	1.4
+++ ncac-trove.c	10 Nov 2005 01:27:04 -0000	1.5
@@ -54,7 +54,7 @@ int NCAC_aio_read_ext( PVFS_fs_id coll_i
     DPRINT("NCAC_aio_read_ext: info\n");
 
     for (i=0; i< m_cnt; i++ ) {
-        DPRINT( "off:%Ld, size=%Ld, buff:%p, size=%Ld\n", 
+        DPRINT( "off:%lld, size=%lld, buff:%p, size=%lld\n", 
 				stream_offset_array[i], stream_size_array[i],
 				 mem_offset_array[i], mem_size_array[i] );
     }
@@ -77,7 +77,7 @@ int NCAC_aio_read_ext( PVFS_fs_id coll_i
 			mem_offset_array[i] -= off;
 		}
 
-        DPRINT( "off:%Ld, size=%Ld, buff:%p, size=%Ld\n", 
+        DPRINT( "off:%lld, size=%lld, buff:%p, size=%lld\n", 
 				stream_offset_array[i], stream_size_array[i],
 				 mem_offset_array[i], mem_size_array[i] );
 
@@ -93,13 +93,13 @@ int NCAC_aio_read_ext( PVFS_fs_id coll_i
 
     DPRINT("--------------after offset_shorten: s_cnt=%d\n", s_cnt);
     for (i=0; i< s_cnt; i++ ) {
-        DPRINT( "off:%Ld, size=%Ld\n", 
+        DPRINT( "off:%lld, size=%lld\n", 
 				stream_offset_array[i], stream_size_array[i] );
     }
 
     DPRINT("--------------after offset_shorten: m_cnt=%d\n", m_cnt);
     for (i=0; i< m_cnt; i++ ) {
-        DPRINT( "buff:%p, size=%Ld\n", 
+        DPRINT( "buff:%p, size=%lld\n", 
 			    mem_offset_array[i], mem_size_array[i] );
     }
 
@@ -125,7 +125,7 @@ int NCAC_aio_read_ext( PVFS_fs_id coll_i
 
     *ioreq = op_id;
 
-    DPRINT("NCAC_aio_read_ext: io request=%Ld(%d)\n", op_id, *ioreq);
+    DPRINT("NCAC_aio_read_ext: io request=%lld(%d)\n", op_id, *ioreq);
 
     return 0;
 }
@@ -169,7 +169,7 @@ int NCAC_aio_write( PVFS_fs_id coll_id, 
 			mem_offset_array[i] -= off;
 		}
 
-        DPRINT( "off:%Ld, size=%Ld, buff:%p, size=%Ld\n", 
+        DPRINT( "off:%lld, size=%lld, buff:%p, size=%lld\n", 
 				stream_offset_array[i], stream_size_array[i],
 				 mem_offset_array[i], mem_size_array[i] );
 
@@ -187,13 +187,13 @@ int NCAC_aio_write( PVFS_fs_id coll_id, 
 #ifdef DEBUG
     fprintf(stderr, "--------------after offset_shorten: s_cnt=%d\n", s_cnt);
     for (i=0; i< s_cnt; i++ ) {
-        fprintf(stderr, "off:%Ld, size=%Ld\n", 
+        fprintf(stderr, "off:%lld, size=%lld\n", 
 				stream_offset_array[i], stream_size_array[i] );
     }
 
     fprintf(stderr, "--------------after offset_shorten: m_cnt=%d\n", m_cnt);
     for (i=0; i< m_cnt; i++ ) {
-        fprintf(stderr, "buff:%p, size=%Ld\n", 
+        fprintf(stderr, "buff:%p, size=%lld\n", 
 			    mem_offset_array[i], mem_size_array[i] );
     }
 #endif
@@ -220,7 +220,7 @@ int NCAC_aio_write( PVFS_fs_id coll_id, 
 
     *ioreq = op_id;
 
-    DPRINT("NCAC_aio_write: io request=%Ld(%d)\n", op_id, *ioreq);
+    DPRINT("NCAC_aio_write: io request=%lld(%d)\n", op_id, *ioreq);
 
     return 0;
 }
@@ -242,13 +242,13 @@ int do_read_for_rmw(PVFS_fs_id coll_id, 
 	buf = extent->addr;
 	inout_size = NCAC_dev.extsize;
 
-    DPRINT("do_read_for_rmw; pos=%Ld, buf=%p, size=%Ld\n", pos, buf, inout_size);
+    DPRINT("do_read_for_rmw; pos=%lld, buf=%p, size=%lld\n", pos, buf, inout_size);
     ret = trove_bstream_read_at(coll_id, handle,
                                 buf, &inout_size,
                                 0, 0, NULL, NULL,
                                 context, &op_id);
 
-    DPRINT("do_read_for_rmw; req=%Ld\n", op_id);
+    DPRINT("do_read_for_rmw; req=%lld\n", op_id);
 
     *ioreq = op_id;
     return 0;
@@ -283,12 +283,12 @@ int NCAC_check_ioreq(struct extent *exte
     coll_id = extent->mapping->coll_id;
     context_id = extent->mapping->context_id;
 
-    DPRINT("NCAC_check_ioreq: req=%Ld, coll_id=%d, context=%d, index=%ld\n", op_id, coll_id, context_id, extent->index);
+    DPRINT("NCAC_check_ioreq: req=%lld, coll_id=%d, context=%d, index=%ld\n", op_id, coll_id, context_id, extent->index);
 
     ret = trove_dspace_test(coll_id, op_id, context_id, &count, NULL, NULL, &state, TROVE_DEFAULT_TEST_TIMEOUT);
 
     if ( ret > 0 ) {
-    	fprintf(stderr, "++++++++++++NCAC_check_ioreq: finished %Ld\n", Ld(op_id));
+    	fprintf(stderr, "++++++++++++NCAC_check_ioreq: finished %lld\n", lld(op_id));
         extent->ioreq = INVAL_IOREQ;
     }
 

Index: state.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/buffer/state.c,v
diff -p -u -r1.5 -r1.6
--- state.c	21 Sep 2004 13:46:13 -0000	1.5
+++ state.c	10 Nov 2005 01:27:04 -0000	1.6
@@ -485,7 +485,7 @@ int data_sync_inode(struct inode *inode)
 		mem[cnt] = extent->addr;
 		memsize[cnt] = NCAC_dev.extsize;
 
-		DPRINT("to write: pos:%Ld, size=%Ld, buf=%p\n", 
+		DPRINT("to write: pos:%lld, size=%lld, buf=%p\n", 
 			 offset[cnt], offsize[cnt], mem[cnt]);
 		cnt ++;
 		tail = tail->next;



More information about the PVFS2-CVS mailing list