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/748587375c48
branches: trunk
changeset: 340341:748587375c48
user: dholland <dholland%NetBSD.org@localhost>
date: Tue Sep 01 06:13:57 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 2 of 3.
diffstat:
sbin/fsck_lfs/lfs.c | 33 +++++++++++++++++----------------
sbin/fsck_lfs/lfs_user.h | 6 +++---
sbin/fsck_lfs/pass6.c | 6 +++---
3 files changed, 23 insertions(+), 22 deletions(-)
diffs (140 lines):
diff -r c74afde80591 -r 748587375c48 sbin/fsck_lfs/lfs.c
--- a/sbin/fsck_lfs/lfs.c Tue Sep 01 06:13:33 2015 +0000
+++ b/sbin/fsck_lfs/lfs.c Tue Sep 01 06:13:57 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.61 2015/09/01 06:13:33 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.62 2015/09/01 06:13:57 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -579,14 +579,14 @@
* or "goal" if we reached it without failure (the partial segment *at* goal
* need not be valid).
*/
-ulfs_daddr_t
-try_verify(struct lfs *osb, struct uvnode *devvp, ulfs_daddr_t goal, int debug)
+daddr_t
+try_verify(struct lfs *osb, struct uvnode *devvp, daddr_t goal, int debug)
{
- ulfs_daddr_t daddr, odaddr;
+ daddr_t daddr, odaddr;
SEGSUM *sp;
int i, bc, hitclean;
struct ubuf *bp;
- ulfs_daddr_t nodirop_daddr;
+ daddr_t nodirop_daddr;
u_int64_t serial;
bc = 0;
@@ -603,6 +603,7 @@
if (daddr == lfs_sb_gets0addr(osb))
daddr += lfs_btofsb(osb, LFS_LABELPAD);
for (i = 0; i < LFS_MAXNUMSB; i++) {
+ /* XXX dholland 20150828 I think this is wrong */
if (lfs_sb_getsboff(osb, i) < daddr)
break;
if (lfs_sb_getsboff(osb, i) == daddr)
@@ -694,7 +695,7 @@
struct lfs *
lfs_verify(struct lfs *sb0, struct lfs *sb1, struct uvnode *devvp, int debug)
{
- ulfs_daddr_t daddr;
+ daddr_t daddr;
struct lfs *osb, *nsb;
/*
@@ -753,14 +754,14 @@
/* Verify a partial-segment summary; return the number of bytes on disk. */
int
-check_summary(struct lfs *fs, SEGSUM *sp, ulfs_daddr_t pseg_addr, int debug,
- struct uvnode *devvp, void (func(ulfs_daddr_t, FINFO *)))
+check_summary(struct lfs *fs, SEGSUM *sp, daddr_t pseg_addr, int debug,
+ struct uvnode *devvp, void (func(daddr_t, FINFO *)))
{
FINFO *fp;
int bc; /* Bytes in partial segment */
int nblocks;
- ulfs_daddr_t daddr;
- ulfs_daddr_t *dp, *idp;
+ daddr_t daddr;
+ uint32_t *dp, *idp; // XXX ondisk32
struct ubuf *bp;
int i, j, k, datac, len;
u_int32_t *datap;
@@ -786,8 +787,8 @@
datap = emalloc(nblocks * sizeof(*datap));
datac = 0;
- dp = (ulfs_daddr_t *) sp;
- dp += lfs_sb_getsumsize(fs) / sizeof(ulfs_daddr_t);
+ dp = (uint32_t *) sp; /* XXX ondisk32 */
+ dp += lfs_sb_getsumsize(fs) / sizeof(*dp);
dp--;
idp = dp;
@@ -796,13 +797,13 @@
for (i = 0, j = 0;
i < lfs_ss_getnfinfo(fs, sp) || j < howmany(lfs_ss_getninos(fs, sp), LFS_INOPB(fs)); i++) {
if (i >= lfs_ss_getnfinfo(fs, sp) && *idp != daddr) {
- pwarn("Not enough inode blocks in pseg at 0x%" PRIx32
- ": found %d, wanted %d\n",
+ pwarn("Not enough inode blocks in pseg at 0x%jx: "
+ "found %d, wanted %d\n",
pseg_addr, j, howmany(lfs_ss_getninos(fs, sp),
LFS_INOPB(fs)));
if (debug)
- pwarn("*idp=%x, daddr=%" PRIx32 "\n", *idp,
- daddr);
+ pwarn("*idp=0x%jx, daddr=0x%jx\n",
+ (uintmax_t)*idp, (intmax_t)daddr);
break;
}
while (j < howmany(lfs_ss_getninos(fs, sp), LFS_INOPB(fs)) && *idp == daddr) {
diff -r c74afde80591 -r 748587375c48 sbin/fsck_lfs/lfs_user.h
--- a/sbin/fsck_lfs/lfs_user.h Tue Sep 01 06:13:33 2015 +0000
+++ b/sbin/fsck_lfs/lfs_user.h Tue Sep 01 06:13:57 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_user.h,v 1.12 2015/09/01 06:13:33 dholland Exp $ */
+/* $NetBSD: lfs_user.h,v 1.13 2015/09/01 06:13:57 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -86,8 +86,8 @@
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 *));
-ulfs_daddr_t try_verify(struct lfs *, struct uvnode *, ulfs_daddr_t, int);
+int check_summary(struct lfs *, union segsum *, daddr_t, int, struct uvnode *, void (*)(daddr_t, union finfo *));
+daddr_t try_verify(struct lfs *, struct uvnode *, daddr_t, int);
union lfs_dinode *lfs_ifind(struct lfs *, ino_t, struct ubuf *);
void call_panic(const char *, ...);
void my_vpanic(int, const char *, va_list);
diff -r c74afde80591 -r 748587375c48 sbin/fsck_lfs/pass6.c
--- a/sbin/fsck_lfs/pass6.c Tue Sep 01 06:13:33 2015 +0000
+++ b/sbin/fsck_lfs/pass6.c Tue Sep 01 06:13:57 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.46 2015/09/01 06:13:33 dholland Exp $ */
+/* $NetBSD: pass6.c,v 1.47 2015/09/01 06:13:57 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
* Account for this change in the segment table.
*/
static void
-rfw_update_single(struct uvnode *vp, daddr_t lbn, ulfs_daddr_t ndaddr, size_t size)
+rfw_update_single(struct uvnode *vp, daddr_t lbn, daddr_t ndaddr, size_t size)
{
SEGUSE *sup;
struct ubuf *bp;
@@ -260,7 +260,7 @@
* Use FIP records to update blocks, if the generation number matches.
*/
static void
-pass6harvest(ulfs_daddr_t daddr, FINFO *fip)
+pass6harvest(daddr_t daddr, FINFO *fip)
{
struct uvnode *vp;
int i;
Home |
Main Index |
Thread Index |
Old Index