Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jul 2006 21:14:36 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 100791 for review
Message-ID:  <200607062114.k66LEaCK048925@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100791

Change 100791 by jb@jb_freebsd2 on 2006/07/06 21:13:54

	Remove debugging printfs and #ifdef the UltraSparc T1 simulator
	support code.
	
	This unbreaks i386.

Affected files ...

.. //depot/projects/dtrace/src/lib/libstand/ufs.c#3 edit

Differences ...

==== //depot/projects/dtrace/src/lib/libstand/ufs.c#3 (text+ko) ====

@@ -111,6 +111,7 @@
 	ufs_readdir
 };
 
+#if defined(__sparc64__) && defined(T1_SIMULATOR)
 typedef int32_t daddr32_t;
 typedef int32_t time32_t;
 typedef unsigned char uchar_t;
@@ -238,6 +239,7 @@
         uchar_t fs_space[1];            /* list of blocks for each rotation */
 /* actually longer */
 };
+#endif
 
 /*
  * In-core open file.
@@ -277,6 +279,7 @@
  * i_number.
  */
 
+#if defined(__sparc64__) && defined(T1_SIMULATOR)
 static void hdump(uint8_t *bp, int size)
 {
 	int i;
@@ -311,6 +314,7 @@
 		printf(" : %s\n", tmp);
 	}
 }
+#endif
 
 
 /*
@@ -330,11 +334,6 @@
 	if (fs == NULL)
 	    panic("fs == NULL");
 
-	printf("read_inode : inumber=0x%llx fsba=0x%llx dba=0x%llx\n",
-	       (uint64_t)inumber,
-	       (uint64_t)ino_to_fsba(fs, inumber),
-	       (uint64_t)fsbtodb(fs, ino_to_fsba(fs, inumber)) );
-
 	/*
 	 * Read inode and save it.
 	 */
@@ -580,21 +579,12 @@
 	file_block = lblkno(fs, fp->f_seekp);
 	file_size = DIP(fp, di_size);
 	block_size = sblksize(fs, file_size, file_block);
-#if 0
-	printf("buf_read_file: fs->f_seekp=0x%llx : off=0x%lx : file_block=0x%lx : block_size=0x%llx\n",
-	       (uint64_t)fp->f_seekp, off, file_block, (uint64_t)block_size);
-	printf("\tfile_size=0x%llx : fs_bsize=0x%llx\n", (uint64_t)file_size, (uint64_t)fs->fs_bsize);
-	printf("fragroundup[blkoff[%lld]=%lld]=%lld\n", file_size, blkoff(fs, file_size),
-	       fragroundup(fs, blkoff(fs, file_size)));
-	printf("fs->fs_qbmask=%llx fs->fs_qfmask=%llx fs->fs_fmask=%lx\n", fs->fs_qbmask, fs->fs_qfmask, fs->fs_fmask);
-#endif
 
+#if defined(__sparc64__) && defined(T1_SIMULATOR)
 	if (block_size > 8192) {
 		block_size=8192;
 		printf("FORCE ROUND block_size\n");
 	}
-#if 0
-	printf("\tfp->f_buf_blkno = 0x%lx\n", fp->f_buf_blkno);
 #endif
 	if (file_block != fp->f_buf_blkno) {
 		if (fp->f_buf == (char *)0)
@@ -603,27 +593,16 @@
 		rc = block_map(f, file_block, &disk_block);
 		if (rc)
 			return (rc);
-#if 0
-		printf("\tblock_map : disk_block = 0x%lx\n", disk_block);
-#endif
 		if (disk_block == 0) {
 			bzero(fp->f_buf, block_size);
 			fp->f_buf_size = block_size;
 		} else {
 			twiddle();
-#if 0
-			printf("\tcalling dev_strategy for block read fsbtodb[0x%lx]=0x%lx\n",
-			       disk_block, fsbtodb(fs, disk_block));
-#endif
 			rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
 				fsbtodb(fs, disk_block),
 				block_size, fp->f_buf, &fp->f_buf_size);
 			if (rc)
 				return (rc);
-#if 0
-			printf("\treturned from block read with 0x%lx bytes\n", fp->f_buf_size);
-			hdump(fp->f_buf, fp->f_buf_size);
-#endif
 		}
 
 		fp->f_buf_blkno = file_block;
@@ -646,6 +625,7 @@
 	return (0);
 }
 
+#if defined(__sparc64__) && defined(T1_SIMULATOR)
 static void
 test_disk(struct open_file *f)
 {
@@ -666,14 +646,10 @@
 	
 		if (rc || read_size != 512)
 			printf("strategy failed\n");
-#if 0
-		printf("%04d\n", i);
-		hdump(buf, 512);
-#endif		
-		
 	}
 
 }
+#endif
 
 static int
 search_directory(name, f, inumber_p)
@@ -688,34 +664,17 @@
 	size_t buf_size;
 	int namlen, length;
 	int rc;
-#if 0
-	test_disk(f);
-#endif
 	length = strlen(name);
-#if 0
-	printf("search_directory: name=%s\n", name);
-#endif
 	fp->f_seekp = 0;
 	while (fp->f_seekp < DIP(fp, di_size)) {
 		int i;
 		rc = buf_read_file(f, &buf, &buf_size);
 		if (rc)
 			return (rc);
-#if 0
-		printf("scan directory entries: @ 0x%llx (size=0x%llx)\n",
-		       (uint64_t)buf, (uint64_t)buf_size);
-#endif
 		dp = (struct direct *)buf;
 		edp = (struct direct *)(buf + buf_size);
 		i = 0;
-#if 0
-		hdump(buf, buf_size);
-#endif
 		while (dp < edp) {
-#if 0
-			printf("\tdirent# %d  (dp=0x%llx edp=0x%llx\n", i,
-			       (uint64_t)dp, (uint64_t)edp);
-#endif
 			if (dp->d_ino == (ino_t)0)
 				goto next;
 #if BYTE_ORDER == LITTLE_ENDIAN
@@ -724,9 +683,6 @@
 			else
 #endif
 				namlen = dp->d_namlen;
-#if 0
-			printf("namlen: %d dp->d_name: %s\n", namlen, dp->d_name);
-#endif
 			if (namlen == length &&
 			    !strcmp(name, dp->d_name)) {
 				/* found entry */
@@ -743,32 +699,19 @@
 }
 
 static int sblock_try[] = SBLOCKSEARCH;
+
+#if defined(__sparc64__) && defined(T1_SIMULATOR)
 #define SOLARIS_SBLOCK_CONVERT 1
 void map_sblock(struct fs *fsp)
 {
 	struct solaris_fs sfs = *(struct solaris_fs *)fsp;
-#if 0
-	printf("fbsd fs_qfmask offset %lx solaris fs_qfmask offset %lx\n",
-	       offsetof(struct fs, fs_qfmask), offsetof(struct solaris_fs, fs_qfmask));
-	printf("fbsd fs_qbmask offset %lx solaris fs_qbmask offset %lx\n",
-	       offsetof(struct fs, fs_qbmask), offsetof(struct solaris_fs, fs_qbmask));
 
-
-	printf("	fsp->fs_qbmask: %llx = sfs.fs_qbmask %08lx%08lx;\n",
-	       fsp->fs_qbmask, sfs.fs_qbmask.val[0], sfs.fs_qbmask.val[1]);       	
-	printf("	fsp->fs_qfmask: %llx = sfs.fs_qfmask %08lx%08lx;\n",
-	       fsp->fs_qfmask, sfs.fs_qfmask.val[0], sfs.fs_qfmask.val[1]);
-#endif
 	fsp->fs_qbmask = ((uint64_t)sfs.fs_qbmask.val[0]) << 32 | sfs.fs_qbmask.val[1];
 	fsp->fs_qfmask = ((uint64_t)sfs.fs_qfmask.val[0]) << 32 | sfs.fs_qfmask.val[1];
 
 }
-
-
-
-
+#endif
 
-
 /*
  * Open a file.
  */
@@ -808,15 +751,6 @@
 		if (rc)
 			goto out;
 
-
-
-
-#if 0
-		printf("fs->fs_magic: %x fs->fs_bsize: %x fs->fs_sblockloc: %lx\n", 
-		       fs->fs_magic, fs->fs_bsize, fs->fs_sblockloc);
-		printf("sblock_try[i]: %x buf_size %lx\n", 
-		       sblock_try[i], buf_size);
-#endif
 		if ((fs->fs_magic == FS_UFS1_MAGIC ||
 		     (fs->fs_magic == FS_UFS2_MAGIC &&
 		      fs->fs_sblockloc == sblock_try[i])) &&
@@ -829,7 +763,7 @@
 		rc = EINVAL;
 		goto out;
 	}
-#if 1
+#if defined(__sparc64__) && defined(T1_SIMULATOR)
 	map_sblock(fs);
 #endif
 	/*
@@ -852,9 +786,6 @@
 		goto out; 
 
 	}
-#if 0
-	printf("read root inode \n");
-#endif	
 	cp = path = strdup(upath);
 	if (path == NULL) {
 	    rc = ENOMEM;
@@ -901,8 +832,6 @@
 		 * symbolic link.
 		 */
 		parent_inumber = inumber;
-		printf("-- searching %s @ inode = 0x%x - found @ 0x%x\n",
-		       ncp, parent_inumber, inumber);
 		rc = search_directory(ncp, f, &inumber);
 		*cp = c;
 		if (rc)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607062114.k66LEaCK048925>