Module Name: src
Committed By: christos
Date: Sun Jan 27 14:10:04 UTC 2013
Modified Files:
src/usr.sbin/makefs/ffs: buf.c
Log Message:
Don't print the pointers in debugging, it is not useful.
zero all memory
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/makefs/ffs/buf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/makefs/ffs/buf.c
diff -u src/usr.sbin/makefs/ffs/buf.c:1.13 src/usr.sbin/makefs/ffs/buf.c:1.14
--- src/usr.sbin/makefs/ffs/buf.c:1.13 Fri Jan 25 19:19:39 2013
+++ src/usr.sbin/makefs/ffs/buf.c Sun Jan 27 09:10:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.c,v 1.13 2013/01/26 00:19:39 christos Exp $ */
+/* $NetBSD: buf.c,v 1.14 2013/01/27 14:10:03 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: buf.c,v 1.13 2013/01/26 00:19:39 christos Exp $");
+__RCSID("$NetBSD: buf.c,v 1.14 2013/01/27 14:10:03 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -77,13 +77,12 @@ bread(struct vnode *vp, daddr_t blkno, i
assert (bpp != NULL);
if (debug & DEBUG_BUF_BREAD)
- printf("bread: fs %p blkno %lld size %d\n",
- fs, (long long)blkno, size);
+ printf("bread: blkno %lld size %d\n", (long long)blkno, size);
*bpp = getblk(vp, blkno, size, 0, 0);
offset = (*bpp)->b_blkno * sectorsize; /* XXX */
if (debug & DEBUG_BUF_BREAD)
- printf("bread: bp %p blkno %lld offset %lld bcount %ld\n",
- (*bpp), (long long)(*bpp)->b_blkno, (long long) offset,
+ printf("bread: blkno %lld offset %lld bcount %ld\n",
+ (long long)(*bpp)->b_blkno, (long long) offset,
(*bpp)->b_bcount);
if (lseek((*bpp)->b_fd, offset, SEEK_SET) == -1)
err(1, "bread: lseek %lld (%lld)",
@@ -141,9 +140,8 @@ bwrite(struct buf *bp)
assert (bp != NULL);
offset = bp->b_blkno * sectorsize; /* XXX */
if (debug & DEBUG_BUF_BWRITE)
- printf("bwrite: bp %p blkno %lld offset %lld bcount %ld\n",
- bp, (long long)bp->b_blkno, (long long) offset,
- bp->b_bcount);
+ printf("bwrite: blkno %lld offset %lld bcount %ld\n",
+ (long long)bp->b_blkno, (long long) offset, bp->b_bcount);
if (lseek(bp->b_fd, offset, SEEK_SET) == -1)
return (errno);
rv = write(bp->b_fd, bp->b_data, bp->b_bcount);
@@ -191,11 +189,10 @@ getblk(struct vnode *vp, daddr_t blkno,
int fd = vp->fd;
struct fs *fs = vp->fs;
- blkno += vp->offset;
+ // blkno += vp->offset;
assert (fs != NULL);
if (debug & DEBUG_BUF_GETBLK)
- printf("getblk: fs %p blkno %lld size %d\n", fs,
- (long long)blkno, size);
+ printf("getblk: blkno %lld size %d\n", (long long)blkno, size);
bp = NULL;
if (!buftailinitted) {
@@ -226,6 +223,7 @@ getblk(struct vnode *vp, daddr_t blkno,
n = realloc(bp->b_data, size);
if (n == NULL)
err(1, "getblk: realloc b_data %ld", bp->b_bcount);
+ memset(n, 0, size);
bp->b_data = n;
bp->b_bufsize = size;
}