Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/fsck_lfs Use daddr_t, not ulfs_daddr_t, as the latter's...
details: https://anonhg.NetBSD.org/src/rev/c74afde80591
branches: trunk
changeset: 340340:c74afde80591
user: dholland <dholland%NetBSD.org@localhost>
date: Tue Sep 01 06:13:33 2015 +0000
description:
Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide.
Don't use either for on-disk items.
Part 1 of 3.
diffstat:
sbin/fsck_lfs/lfs.c | 6 +++---
sbin/fsck_lfs/lfs_user.h | 4 ++--
sbin/fsck_lfs/pass6.c | 41 ++++++++++++++++++++++-------------------
3 files changed, 27 insertions(+), 24 deletions(-)
diffs (171 lines):
diff -r cae6449b9f16 -r c74afde80591 sbin/fsck_lfs/lfs.c
--- a/sbin/fsck_lfs/lfs.c Tue Sep 01 06:13:09 2015 +0000
+++ b/sbin/fsck_lfs/lfs.c Tue Sep 01 06:13:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.60 2015/09/01 06:12:04 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.61 2015/09/01 06:13:33 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -336,7 +336,7 @@
* XXX it currently loses atime information.
*/
struct uvnode *
-lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, ulfs_daddr_t daddr)
+lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, daddr_t daddr)
{
struct uvnode *vp;
struct inode *ip;
@@ -412,7 +412,7 @@
lfs_vget(void *vfs, ino_t ino)
{
struct lfs *fs = (struct lfs *)vfs;
- ulfs_daddr_t daddr;
+ daddr_t daddr;
struct ubuf *bp;
IFILE *ifp;
diff -r cae6449b9f16 -r c74afde80591 sbin/fsck_lfs/lfs_user.h
--- a/sbin/fsck_lfs/lfs_user.h Tue Sep 01 06:13:09 2015 +0000
+++ b/sbin/fsck_lfs/lfs_user.h Tue Sep 01 06:13:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_user.h,v 1.11 2015/08/19 20:33:29 dholland Exp $ */
+/* $NetBSD: lfs_user.h,v 1.12 2015/09/01 06:13:33 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -83,7 +83,7 @@
int lfs_vop_bwrite(struct ubuf *);
int lfs_vop_bmap(struct uvnode *, daddr_t, daddr_t *);
-struct uvnode *lfs_raw_vget(struct lfs *, ino_t, int, ulfs_daddr_t);
+struct uvnode *lfs_raw_vget(struct lfs *, ino_t, int, daddr_t);
struct lfs *lfs_init(int, daddr_t, daddr_t, int, int);
struct lfs *lfs_verify(struct lfs *, struct lfs *, struct uvnode *, int);
int check_summary(struct lfs *, union segsum *, ulfs_daddr_t, int, struct uvnode *, void (*)(ulfs_daddr_t, union finfo *));
diff -r cae6449b9f16 -r c74afde80591 sbin/fsck_lfs/pass6.c
--- a/sbin/fsck_lfs/pass6.c Tue Sep 01 06:13:09 2015 +0000
+++ b/sbin/fsck_lfs/pass6.c Tue Sep 01 06:13:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.45 2015/09/01 06:12:04 dholland Exp $ */
+/* $NetBSD: pass6.c,v 1.46 2015/09/01 06:13:33 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -219,7 +219,7 @@
CLEANERINFO *cip;
struct ubuf *bp, *sbp, *cbp;
struct inodesc idesc;
- ulfs_daddr_t daddr;
+ daddr_t daddr;
if (debug)
pwarn("remove ino %d\n", (int)ino);
@@ -422,13 +422,13 @@
* free list accounting is done.
*/
static void
-readdress_inode(union lfs_dinode *dp, ulfs_daddr_t daddr)
+readdress_inode(union lfs_dinode *dp, daddr_t daddr)
{
IFILE *ifp;
SEGUSE *sup;
struct ubuf *bp;
int sn;
- ulfs_daddr_t odaddr;
+ daddr_t odaddr;
ino_t thisino = lfs_dino_getinumber(fs, dp);
struct uvnode *vp;
@@ -443,10 +443,10 @@
VOP_BWRITE(bp);
if (debug)
- pwarn("readdress ino %ju from 0x%x to 0x%x mode %o nlink %d\n",
+ pwarn("readdress ino %ju from 0x%jx to 0x%jx mode %o nlink %d\n",
(uintmax_t)lfs_dino_getinumber(fs, dp),
- (unsigned)odaddr,
- (unsigned)daddr,
+ (uintmax_t)odaddr,
+ (intmax_t)daddr,
(int)lfs_dino_getmode(fs, dp),
(int)lfs_dino_getnlink(fs, dp));
@@ -549,7 +549,8 @@
void
pass6(void)
{
- ulfs_daddr_t daddr, ibdaddr, odaddr, lastgood, *idaddrp;
+ daddr_t daddr, ibdaddr, odaddr, lastgood;
+ uint32_t *idaddrp; /* XXX ondisk32 */
struct uvnode *vp, *devvp;
CLEANERINFO *cip;
SEGUSE *sup;
@@ -618,13 +619,14 @@
break;
}
}
+ KASSERT(hassuper == 0 || hassuper == 1);
/* Read in summary block */
bread(devvp, LFS_FSBTODB(fs, daddr), lfs_sb_getsumsize(fs), 0, &bp);
sp = (SEGSUM *)bp->b_data;
if (debug)
- pwarn("sum at 0x%x: ninos=%d nfinfo=%d\n",
- (unsigned)daddr, (int)lfs_ss_getninos(fs, sp),
+ pwarn("sum at 0x%jx: ninos=%d nfinfo=%d\n",
+ (intmax_t)daddr, (int)lfs_ss_getninos(fs, sp),
(int)lfs_ss_getnfinfo(fs, sp));
/* We have verified that this is a good summary. */
@@ -650,7 +652,8 @@
LFS_INOPB(fs)) *
lfs_sb_getibsize(fs)));
}
- idaddrp = ((ulfs_daddr_t *)((char *)bp->b_data + lfs_sb_getsumsize(fs)));
+ // XXX ondisk32
+ idaddrp = ((uint32_t *)((char *)bp->b_data + lfs_sb_getsumsize(fs)));
for (i = 0; i < howmany(lfs_ss_getninos(fs, sp), LFS_INOPB(fs)); i++) {
ino_t *inums;
@@ -676,8 +679,8 @@
|| lfs_dino_getsize(fs, dp) < 0
#endif
) {
- pwarn("BAD INODE AT 0x%" PRIx32 "\n",
- ibdaddr);
+ pwarn("BAD INODE AT 0x%jx\n",
+ (intmax_t)ibdaddr);
brelse(bp, 0);
free(inums);
goto out;
@@ -783,14 +786,14 @@
bc = check_summary(fs, sp, daddr, debug, devvp, NULL);
if (bc == 0) {
- pwarn("unexpected bad seg ptr at 0x%x with serial=%d\n",
- (int)daddr, (int)lfs_ss_getserial(fs, sp));
+ pwarn("unexpected bad seg ptr at 0x%jx with serial=%ju\n",
+ (intmax_t)daddr, (uintmax_t)lfs_ss_getserial(fs, sp));
brelse(bp, 0);
break;
} else {
if (debug)
- pwarn("good seg ptr at 0x%x with serial=%d\n",
- (int)daddr, (int)lfs_ss_getserial(fs, sp));
+ pwarn("good seg ptr at 0x%jx with serial=%ju\n",
+ (intmax_t)daddr, (uintmax_t)lfs_ss_getserial(fs, sp));
lastserial = lfs_ss_getserial(fs, sp);
}
odaddr = daddr;
@@ -858,8 +861,8 @@
sp = (SEGSUM *)bp->b_data;
bc = check_summary(fs, sp, daddr, debug, devvp, pass6harvest);
if (bc == 0) {
- pwarn("unexpected bad seg ptr [2] at 0x%x with serial=%d\n",
- (int)daddr, (int)lfs_ss_getserial(fs, sp));
+ pwarn("unexpected bad seg ptr [2] at 0x%jx with serial=%ju\n",
+ (intmax_t)daddr, (uintmax_t)lfs_ss_getserial(fs, sp));
brelse(bp, 0);
break;
}
Home |
Main Index |
Thread Index |
Old Index