"#define lfs_devvp lfs_unlockvp" for readability, since that's what we

use it for in fsck_lfs/newfs_lfs.
This commit is contained in:
perseant 2005-03-25 20:16:37 +00:00
parent f1f5ecd1a9
commit dcba0206d6
5 changed files with 24 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: inode.c,v 1.25 2005/02/06 06:13:12 perry Exp $ */
/* $NetBSD: inode.c,v 1.26 2005/03/25 20:16:37 perseant Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -249,7 +249,7 @@ iblock(struct inodesc *idesc, long ilevel, u_int64_t isize)
if (chkrange(idesc->id_blkno, fragstofsb(fs, idesc->id_numfrags)))
return (SKIP);
devvp = fs->lfs_unlockvp;
devvp = fs->lfs_devvp;
bread(devvp, fsbtodb(fs, idesc->id_blkno), fs->lfs_bsize, NOCRED, &bp);
ilevel--;
for (sizepb = fs->lfs_bsize, i = 0; i < ilevel; i++)

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs.c,v 1.8 2005/02/26 05:45:54 perseant Exp $ */
/* $NetBSD: lfs.c,v 1.9 2005/03/25 20:16:37 perseant Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@ -374,7 +374,7 @@ lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, ufs_daddr_t daddr)
/* Load inode block and find inode */
if (daddr > 0) {
bread(fs->lfs_unlockvp, fsbtodb(fs, daddr), fs->lfs_ibsize, NULL, &bp);
bread(fs->lfs_devvp, fsbtodb(fs, daddr), fs->lfs_ibsize, NULL, &bp);
bp->b_flags |= B_AGE;
dip = lfs_ifind(fs, ino, bp);
if (dip == NULL) {
@ -387,7 +387,7 @@ lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, ufs_daddr_t daddr)
brelse(bp);
}
ip->i_number = ino;
/* ip->i_devvp = fs->lfs_unlockvp; */
/* ip->i_devvp = fs->lfs_devvp; */
ip->i_lfs = fs;
ip->i_ffs_effnlink = ip->i_ffs1_nlink;
@ -478,7 +478,7 @@ lfs_init(int devfd, daddr_t sblkno, daddr_t idaddr, int dummy_read, int debug)
sblkno = btodb(LFS_LABELPAD);
fs = (struct lfs *) malloc(sizeof(*fs));
memset(fs, 0, sizeof(*fs));
fs->lfs_unlockvp = devvp;
fs->lfs_devvp = devvp;
} else {
if (sblkno == 0) {
sblkno = btodb(LFS_LABELPAD);
@ -490,7 +490,7 @@ lfs_init(int devfd, daddr_t sblkno, daddr_t idaddr, int dummy_read, int debug)
fs = (struct lfs *) malloc(sizeof(*fs));
memset(fs, 0, sizeof(*fs));
fs->lfs_dlfs = *((struct dlfs *) bp->b_data);
fs->lfs_unlockvp = devvp;
fs->lfs_devvp = devvp;
bp->b_flags |= B_INVAL;
brelse(bp);
@ -500,7 +500,7 @@ lfs_init(int devfd, daddr_t sblkno, daddr_t idaddr, int dummy_read, int debug)
altfs = (struct lfs *) malloc(sizeof(*altfs));
memset(altfs, 0, sizeof(*altfs));
altfs->lfs_dlfs = *((struct dlfs *) bp->b_data);
altfs->lfs_unlockvp = devvp;
altfs->lfs_devvp = devvp;
bp->b_flags |= B_INVAL;
brelse(bp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs.h,v 1.3 2005/02/26 05:45:54 perseant Exp $ */
/* $NetBSD: lfs.h,v 1.4 2005/03/25 20:16:37 perseant Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@ -41,6 +41,12 @@ struct lfs;
struct segsum;
struct finfo;
/*
* In the fsck code we don't need lfs_unlockvp, but we don't have a mount
* structure to give us the devvp. Overload the unlockvp with devvp.
*/
#define lfs_devvp lfs_unlockvp
/*
* Structure used to pass around logical block paths generated by
* ufs_getlbns and used by truncate and bmap code.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pass6.c,v 1.3 2003/04/02 10:39:28 fvdl Exp $ */
/* $NetBSD: pass6.c,v 1.4 2005/03/25 20:16:37 perseant Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -461,7 +461,7 @@ pass6(void)
int i, j, bc;
ufs_daddr_t hassuper;
devvp = fs->lfs_unlockvp;
devvp = fs->lfs_devvp;
/* Find last valid partial segment */
lastgood = try_verify(fs, devvp, 0, debug);

View File

@ -1,4 +1,4 @@
/* $NetBSD: segwrite.c,v 1.7 2005/02/26 05:45:54 perseant Exp $ */
/* $NetBSD: segwrite.c,v 1.8 2005/03/25 20:16:37 perseant Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@ -271,7 +271,7 @@ lfs_writeinode(struct lfs * fs, struct segment * sp, struct inode * ip)
daddr = fs->lfs_offset;
fs->lfs_offset += btofsb(fs, fs->lfs_ibsize);
sp->ibp = *sp->cbpp++ =
getblk(fs->lfs_unlockvp, fsbtodb(fs, daddr),
getblk(fs->lfs_devvp, fsbtodb(fs, daddr),
fs->lfs_ibsize);
sp->ibp->b_flags |= B_GATHERED;
gotblk++;
@ -661,7 +661,7 @@ lfs_initseg(struct lfs * fs)
/* Get a new buffer for SEGSUM and enter it into the buffer list. */
sp->cbpp = sp->bpp;
sbp = *sp->cbpp = getblk(fs->lfs_unlockvp,
sbp = *sp->cbpp = getblk(fs->lfs_devvp,
fsbtodb(fs, fs->lfs_offset), fs->lfs_sumsize);
sp->segsum = sbp->b_data;
memset(sp->segsum, 0, fs->lfs_sumsize);
@ -752,7 +752,7 @@ lfs_writeseg(struct lfs * fs, struct segment * sp)
if ((nblocks = sp->cbpp - sp->bpp) == 1)
return 0;
devvp = fs->lfs_unlockvp;
devvp = fs->lfs_devvp;
/* Update the segment usage information. */
LFS_SEGENTRY(sup, fs, sp->seg_number, bp);
@ -830,11 +830,11 @@ lfs_writeseg(struct lfs * fs, struct segment * sp)
printf("i = %d, bp = %p, flags %lx, bn = %" PRIx64 "\n",
nblocks - i, bp, bp->b_flags, bp->b_blkno);
printf(" vp = %p\n", bp->b_vp);
if (bp->b_vp != fs->lfs_unlockvp)
if (bp->b_vp != fs->lfs_devvp)
printf(" ino = %d lbn = %" PRId64 "\n",
VTOI(bp->b_vp)->i_number, bp->b_lblkno);
#endif
if (bp->b_vp == fs->lfs_unlockvp)
if (bp->b_vp == fs->lfs_devvp)
written_dev += bp->b_bcount;
else {
if (bp->b_lblkno >= 0)
@ -1003,7 +1003,7 @@ lfs_writesuper(struct lfs *fs, ufs_daddr_t daddr)
/* Checksum the superblock and copy it into a buffer. */
fs->lfs_cksum = lfs_sb_cksum(&(fs->lfs_dlfs));
assert(daddr > 0);
bp = getblk(fs->lfs_unlockvp, fsbtodb(fs, daddr), LFS_SBPAD);
bp = getblk(fs->lfs_devvp, fsbtodb(fs, daddr), LFS_SBPAD);
memset(bp->b_data + sizeof(struct dlfs), 0,
LFS_SBPAD - sizeof(struct dlfs));
*(struct dlfs *) bp->b_data = fs->lfs_dlfs;