[Tux3] [PATCH] Add inode.c to Makefile

Shapor Naghibzadeh shapor at gmail.com
Sun Aug 17 23:47:49 PDT 2008


# HG changeset patch
# User shapor at yzf.shapor.com
# Date 1219041999 25200
# Node ID 0fd115950cdd598542e869026860f20abe9d7efa
# Parent  57754a21edcda37f86c8243c2038b071ccaf090c
Add inode.c to Makefile
Fix more 64 bit format string warnings

diff -r 57754a21edcd -r 0fd115950cdd user/test/Makefile
--- a/user/test/Makefile	Sun Aug 17 16:25:18 2008 -0700
+++ b/user/test/Makefile	Sun Aug 17 23:46:39 2008 -0700
@@ -2,7 +2,7 @@ CFLAGS += -std=gnu99 -Wall
 CFLAGS += -std=gnu99 -Wall
 VG=valgrind
 VGFLAGS=--error-exitcode=200
-binaries = dleaf ileaf btree dir
+binaries = dleaf ileaf btree dir inode
 
 all: $(binaries)
 tests: dleaftest ileaftest
@@ -27,5 +27,10 @@ dirtest: dir
 dirtest: dir
 	$(VG) $(VGFLAGS) ./dir
 
+inode: inode.c buffer.h tux3.h buffer.c buffer.h diskio.c
+	$(CC) $(CFLAGS) inode.c buffer.c diskio.c -o inode
+inodetest: inode
+	$(VG) $(VGFLAGS) ./inode
+
 clean:
 	rm -f $(binaries) *.o a.out foodev
diff -r 57754a21edcd -r 0fd115950cdd user/test/balloc.c
--- a/user/test/balloc.c	Sun Aug 17 16:25:18 2008 -0700
+++ b/user/test/balloc.c	Sun Aug 17 23:46:39 2008 -0700
@@ -89,11 +89,11 @@ block_t bitmap_dump(struct inode *inode,
 					begin = found;
 				else {
 					if ((begin >> mapshift) != block)
-						printf("-%Lx ", found - 1);
+						printf("-%Lx ", (L)(found - 1));
 					else if (begin == found - 1)
-						printf("%Lx ", begin);
+						printf("%Lx ", (L)begin);
 					else
-						printf("%Lx-%Lx ", begin, found - 1);
+						printf("%Lx-%Lx ", (L)begin, (L)(found - 1));
 					begin = -1;
 					ended++;
 				}
@@ -104,7 +104,7 @@ block_t bitmap_dump(struct inode *inode,
 		tail -= bytes;
 		offset = 0;
 		if (begin >= 0)
-			printf("%Lx-", begin);
+			printf("%Lx-", (L)begin);
 		if (any)
 			printf("\n");
 	}
@@ -169,7 +169,7 @@ block_t balloc(SB)
 		goto found;
 	return -1;
 found:
-	printf("balloc -> %Lxh\n", block);
+	printf("balloc -> %Lxh\n", (L)block);
 	return block;
 }
 
@@ -180,7 +180,7 @@ void bfree(SB, block_t block)
 	unsigned mapblock = block >> mapshift;
 	char *why = "free failed";
 	struct buffer *buffer = bread(sb->bitmap->map, mapblock);
-	printf("free <- %Lxh\n", block);
+	printf("free <- %Lxh\n", (L)block);
 	if (!buffer)
 		goto eek;
 	if (!get_bit(buffer->data, block & mapmask))
diff -r 57754a21edcd -r 0fd115950cdd user/test/inode.c
--- a/user/test/inode.c	Sun Aug 17 16:25:18 2008 -0700
+++ b/user/test/inode.c	Sun Aug 17 23:46:39 2008 -0700
@@ -38,7 +38,7 @@ int filemap_blockio(struct buffer *buffe
 	struct sb *sb = inode->sb;
 	struct map *devmap = sb->devmap;
 	struct dev *dev = devmap->dev;
-	warn("%s <%Lx:%Lx>", write ? "write" : "read", inode->inum, buffer->index);
+	warn("%s <%Lx:%Lx>", write ? "write" : "read", (L)inode->inum, buffer->index);
 	assert(dev->bits >= 9 && dev->fd);
 
 	int err, levels = inode->root.levels;
@@ -60,10 +60,10 @@ int filemap_blockio(struct buffer *buffe
 	if (write) {
 		if (count) {
 			physical = found->block;
-			trace(warn("found physical block %Lx", (long long)physical);)
+			trace(warn("found physical block %Lx", (L)physical);)
 		} else {
 			physical = balloc(sb); // !!! need an error return
-			trace(warn("new physical block %Lx", physical);)
+			trace(warn("new physical block %Lx", (L)physical);)
 			struct extent *store = tree_expand(sb, &sb->image.iroot, buffer->index, sizeof(struct extent), path, levels, &dtree_ops);
 			if (!store)
 				goto eek;
@@ -123,16 +123,16 @@ struct inode *open_inode(SB, inum_t inum
 	//ileaf_dump(sb, leafbuf->data);
 
 	if (size) {
-		trace(warn("found inode 0x%Lx", inum);)
+		trace(warn("found inode 0x%Lx", (L)inum);)
 		hexdump(ibase, size);
 		/* may have to expand */
 	} else {
-		trace(warn("no inode 0x%Lx", inum);)
+		trace(warn("no inode 0x%Lx", (L)inum);)
 		if (!create) {
 			err = -ENOENT;
 			goto eek;
 		}
-		trace(warn("new inode 0x%Lx", inum);)
+		trace(warn("new inode 0x%Lx", (L)inum);)
 		/*
 		 * We know target is less than base inum of succ block (do we?)
 		 * if lie inside actual inum range of this block, or if the block

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list