Give brelse() a second argument so that it matches the kernel.
fsck_lfs now compiles again.
This commit is contained in:
parent
0a012aa1c5
commit
fe44973fe3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bufcache.c,v 1.10 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: bufcache.c,v 1.11 2007/10/08 21:39:49 ad Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -306,18 +306,20 @@ bwrite(struct ubuf * bp)
|
||||
VOP_STRATEGY(bp);
|
||||
bp->b_flags |= B_DONE;
|
||||
reassignbuf(bp, bp->b_vp);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
/* Put a buffer back on its free list, clear B_BUSY. */
|
||||
void
|
||||
brelse(struct ubuf * bp)
|
||||
brelse(struct ubuf * bp, int set)
|
||||
{
|
||||
int age;
|
||||
|
||||
assert(!(bp->b_flags & B_NEEDCOMMIT));
|
||||
assert(bp->b_flags & B_BUSY);
|
||||
|
||||
bp->b_flags |= set;
|
||||
|
||||
age = bp->b_flags & B_AGE;
|
||||
bp->b_flags &= ~(B_BUSY | B_AGE);
|
||||
if (bp->b_flags & B_INVAL) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bufcache.h,v 1.7 2006/05/03 15:04:51 yamt Exp $ */
|
||||
/* $NetBSD: bufcache.h,v 1.8 2007/10/08 21:39:49 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
||||
@ -123,7 +123,7 @@ void bremfree(struct ubuf *);
|
||||
struct ubuf *incore(struct uvnode *, int);
|
||||
struct ubuf *getblk(struct uvnode *, daddr_t, int);
|
||||
void bwrite(struct ubuf *);
|
||||
void brelse(struct ubuf *);
|
||||
void brelse(struct ubuf *, int);
|
||||
int bread(struct uvnode *, daddr_t, int, void *, struct ubuf **);
|
||||
void reassignbuf(struct ubuf *, struct uvnode *);
|
||||
void dump_free_lists(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dir.c,v 1.21 2006/10/16 03:21:05 christos Exp $ */
|
||||
/* $NetBSD: dir.c,v 1.22 2007/10/08 21:39:49 ad Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -186,7 +186,7 @@ fsck_readdir(struct uvnode *vp, struct inodesc *idesc)
|
||||
dp = (struct direct *) (bp->b_data + idesc->id_loc);
|
||||
if (dircheck(idesc, dp))
|
||||
goto dpok;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
if (idesc->id_fix == IGNORE)
|
||||
return (0);
|
||||
fix = dofix(idesc, "DIRECTORY CORRUPTED");
|
||||
@ -200,14 +200,14 @@ fsck_readdir(struct uvnode *vp, struct inodesc *idesc)
|
||||
if (fix)
|
||||
VOP_BWRITE(bp);
|
||||
else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
idesc->id_loc += DIRBLKSIZ;
|
||||
idesc->id_filesize -= DIRBLKSIZ;
|
||||
return (dp);
|
||||
}
|
||||
dpok:
|
||||
if (idesc->id_filesize <= 0 || idesc->id_loc >= blksiz) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return NULL;
|
||||
}
|
||||
dploc = idesc->id_loc;
|
||||
@ -215,13 +215,13 @@ dpok:
|
||||
idesc->id_loc += dp->d_reclen;
|
||||
idesc->id_filesize -= dp->d_reclen;
|
||||
if ((idesc->id_loc % DIRBLKSIZ) == 0) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return dp;
|
||||
}
|
||||
ndp = (struct direct *) (bp->b_data + idesc->id_loc);
|
||||
if (idesc->id_loc < blksiz && idesc->id_filesize > 0 &&
|
||||
dircheck(idesc, ndp) == 0) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ);
|
||||
idesc->id_loc += size;
|
||||
idesc->id_filesize -= size;
|
||||
@ -234,9 +234,9 @@ dpok:
|
||||
if (fix)
|
||||
VOP_BWRITE(bp);
|
||||
else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
} else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
return (dp);
|
||||
}
|
||||
@ -630,7 +630,7 @@ allocdir(ino_t parent, ino_t request, int mode)
|
||||
dp = VTOD(vp);
|
||||
bread(vp, dp->di_db[0], fs->lfs_fsize, NOCRED, &bp);
|
||||
if (bp->b_flags & B_ERROR) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
freeino(ino);
|
||||
return (0);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: inode.c,v 1.36 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: inode.c,v 1.37 2007/10/08 21:39:49 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -120,7 +120,7 @@ ginode(ino_t ino)
|
||||
LFS_IENTRY(ifp, fs, ino, bp);
|
||||
din_table[ino] = ifp->if_daddr;
|
||||
seg_table[dtosn(fs, ifp->if_daddr)].su_nbytes += DINODE1_SIZE;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
return (VTOI(vp)->i_din.ffs1_din);
|
||||
}
|
||||
@ -291,7 +291,7 @@ iblock(struct inodesc *idesc, long ilevel, u_int64_t isize)
|
||||
if (diddirty)
|
||||
VOP_BWRITE(bp);
|
||||
else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return (n);
|
||||
}
|
||||
} else {
|
||||
@ -312,7 +312,7 @@ iblock(struct inodesc *idesc, long ilevel, u_int64_t isize)
|
||||
if (diddirty)
|
||||
VOP_BWRITE(bp);
|
||||
else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return (STOP);
|
||||
}
|
||||
}
|
||||
@ -322,7 +322,7 @@ iblock(struct inodesc *idesc, long ilevel, u_int64_t isize)
|
||||
if (diddirty)
|
||||
VOP_BWRITE(bp);
|
||||
else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return (KEEPON);
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ clearinode(ino_t inumber)
|
||||
LFS_IENTRY(ifp, fs, inumber, bp);
|
||||
daddr = ifp->if_daddr;
|
||||
if (daddr == LFS_UNUSED_DADDR) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return;
|
||||
}
|
||||
ifp->if_daddr = LFS_UNUSED_DADDR;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs.c,v 1.26 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: lfs.c,v 1.27 2007/10/08 21:39:49 ad Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -152,7 +152,7 @@ lfs_vop_bwrite(struct ubuf * bp)
|
||||
}
|
||||
bp->b_flags |= B_DELWRI | B_LOCKED;
|
||||
reassignbuf(bp, bp->b_vp);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ ufs_bmaparray(struct lfs * fs, struct uvnode * vp, daddr_t bn, daddr_t * bnp, st
|
||||
* or we have a disk address for it, go fetch it.
|
||||
*/
|
||||
if (bp)
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
xap->in_exists = 1;
|
||||
bp = getblk(vp, metalbn, fs->lfs_bsize);
|
||||
@ -219,7 +219,7 @@ ufs_bmaparray(struct lfs * fs, struct uvnode * vp, daddr_t bn, daddr_t * bnp, st
|
||||
daddr = ((ufs_daddr_t *) bp->b_data)[xap->in_off];
|
||||
}
|
||||
if (bp)
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
daddr = fsbtodb(fs, (ufs_daddr_t) daddr);
|
||||
*bnp = daddr == 0 ? -1 : daddr;
|
||||
@ -376,13 +376,13 @@ lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, ufs_daddr_t daddr)
|
||||
bp->b_flags |= B_AGE;
|
||||
dip = lfs_ifind(fs, ino, bp);
|
||||
if (dip == NULL) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
free(ip);
|
||||
free(vp);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(ip->i_din.ffs1_din, dip, sizeof(*dip));
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
ip->i_number = ino;
|
||||
/* ip->i_devvp = fs->lfs_devvp; */
|
||||
@ -421,7 +421,7 @@ lfs_vget(void *vfs, ino_t ino)
|
||||
|
||||
LFS_IENTRY(ifp, fs, ino, bp);
|
||||
daddr = ifp->if_daddr;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
if (daddr <= 0 || dtosn(fs, daddr) >= fs->lfs_nseg)
|
||||
return NULL;
|
||||
return lfs_raw_vget(fs, ino, fs->lfs_ivnode->v_fd, daddr);
|
||||
@ -488,7 +488,7 @@ lfs_init(int devfd, daddr_t sblkno, daddr_t idaddr, int dummy_read, int debug)
|
||||
fs->lfs_dlfs = *((struct dlfs *) bp->b_data);
|
||||
fs->lfs_devvp = devvp;
|
||||
bp->b_flags |= B_INVAL;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
if (tryalt) {
|
||||
error = bread(devvp, fsbtodb(fs, fs->lfs_sboffs[1]),
|
||||
@ -497,7 +497,7 @@ lfs_init(int devfd, daddr_t sblkno, daddr_t idaddr, int dummy_read, int debug)
|
||||
altfs->lfs_dlfs = *((struct dlfs *) bp->b_data);
|
||||
altfs->lfs_devvp = devvp;
|
||||
bp->b_flags |= B_INVAL;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
if (check_sb(fs) || fs->lfs_idaddr <= 0) {
|
||||
if (debug)
|
||||
@ -610,7 +610,7 @@ try_verify(struct lfs *osb, struct uvnode *devvp, ufs_daddr_t goal, int debug)
|
||||
sp->ss_serial < serial || /* XXX strengthen this */
|
||||
sp->ss_sumsum != cksum(&sp->ss_datasum, osb->lfs_sumsize -
|
||||
sizeof(sp->ss_sumsum))) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
if (debug) {
|
||||
if (sp->ss_magic != SS_MAGIC)
|
||||
pwarn("pseg at 0x%x: "
|
||||
@ -639,7 +639,7 @@ try_verify(struct lfs *osb, struct uvnode *devvp, ufs_daddr_t goal, int debug)
|
||||
++serial;
|
||||
bc = check_summary(osb, sp, daddr, debug, devvp, NULL);
|
||||
if (bc == 0) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
break;
|
||||
}
|
||||
if (debug)
|
||||
@ -666,7 +666,7 @@ try_verify(struct lfs *osb, struct uvnode *devvp, ufs_daddr_t goal, int debug)
|
||||
if (hitclean == 0 && (sp->ss_flags & SS_CONT) == 0)
|
||||
nodirop_daddr = daddr;
|
||||
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
if (goal == 0)
|
||||
@ -796,7 +796,7 @@ check_summary(struct lfs *fs, SEGSUM *sp, ufs_daddr_t pseg_addr, int debug,
|
||||
while (j < howmany(sp->ss_ninos, INOPB(fs)) && *idp == daddr) {
|
||||
bread(devvp, fsbtodb(fs, daddr), fs->lfs_ibsize, NOCRED, &bp);
|
||||
datap[datac++] = ((u_int32_t *) (bp->b_data))[0];
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
++j;
|
||||
daddr += btofsb(fs, fs->lfs_ibsize);
|
||||
@ -811,7 +811,7 @@ check_summary(struct lfs *fs, SEGSUM *sp, ufs_daddr_t pseg_addr, int debug,
|
||||
: fs->lfs_bsize);
|
||||
bread(devvp, fsbtodb(fs, daddr), len, NOCRED, &bp);
|
||||
datap[datac++] = ((u_int32_t *) (bp->b_data))[0];
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
daddr += btofsb(fs, len);
|
||||
}
|
||||
fp = (FINFO *) (fp->fi_blocks + fp->fi_nblocks);
|
||||
@ -878,7 +878,7 @@ lfs_valloc(struct lfs *fs, ino_t ino)
|
||||
LFS_PUT_HEADFREE(fs, cip, cbp, ifp->if_nextfree);
|
||||
|
||||
new_gen = ifp->if_version; /* version was updated by vfree */
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
/* Extend IFILE so that the next lfs_valloc will succeed. */
|
||||
if (fs->lfs_freehd == LFS_UNUSED_INUM) {
|
||||
@ -1209,7 +1209,7 @@ lfs_fragextend(struct uvnode *vp, int osize, int nsize, daddr_t lbn,
|
||||
* Don't bother to read in that case.
|
||||
*/
|
||||
if (bpp && (error = bread(vp, lbn, osize, NOCRED, bpp))) {
|
||||
brelse(*bpp);
|
||||
brelse(*bpp, 0);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass0.c,v 1.29 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: pass0.c,v 1.30 2007/10/08 21:39:49 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -124,7 +124,7 @@ pass0(void)
|
||||
lowfreeino = maxino;
|
||||
LFS_CLEANERINFO(cip, fs, cbp);
|
||||
freehd = ino = cip->free_head;
|
||||
brelse(cbp);
|
||||
brelse(cbp, 0);
|
||||
|
||||
while (ino) {
|
||||
if (lowfreeino > ino)
|
||||
@ -149,7 +149,7 @@ pass0(void)
|
||||
LFS_IENTRY(ifp, fs, ino, bp);
|
||||
nextino = ifp->if_nextfree;
|
||||
daddr = ifp->if_daddr;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
if (daddr) {
|
||||
pwarn("INO %llu WITH DADDR 0x%llx ON FREE LIST\n",
|
||||
(unsigned long long)ino, (long long) daddr);
|
||||
@ -180,7 +180,7 @@ pass0(void)
|
||||
|
||||
LFS_IENTRY(ifp, fs, ino, bp);
|
||||
if (ifp->if_daddr) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
continue;
|
||||
}
|
||||
pwarn("INO %llu FREE BUT NOT ON FREE LIST\n",
|
||||
@ -197,7 +197,7 @@ pass0(void)
|
||||
if (plastino == 0)
|
||||
plastino = ino;
|
||||
} else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
LFS_CLEANERINFO(cip, fs, cbp);
|
||||
@ -227,7 +227,7 @@ pass0(void)
|
||||
if (writeit)
|
||||
LFS_SYNC_CLEANERINFO(cip, fs, cbp, writeit);
|
||||
else
|
||||
brelse(cbp);
|
||||
brelse(cbp, 0);
|
||||
|
||||
if (fs->lfs_freehd == 0) {
|
||||
pwarn("%sree list head is 0x0\n", preen ? "f" : "F");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass1.c,v 1.28 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: pass1.c,v 1.29 2007/10/08 21:39:49 ad Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -117,7 +117,7 @@ pass1(void)
|
||||
else {
|
||||
LFS_IENTRY(ifp, fs, i, bp);
|
||||
dins[i]->daddr = ifp->if_daddr;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
}
|
||||
qsort(dins, maxino, sizeof(*dins), i_d_cmp);
|
||||
@ -289,7 +289,7 @@ checkinode(ino_t inumber, struct inodesc * idesc)
|
||||
zlnp->next = orphead;
|
||||
orphead = zlnp;
|
||||
}
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
typemap[inumber] = IFTODT(mode);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass5.c,v 1.22 2006/10/16 03:21:34 christos Exp $ */
|
||||
/* $NetBSD: pass5.c,v 1.23 2007/10/08 21:39:49 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
|
||||
@ -136,7 +136,7 @@ pass5(void)
|
||||
if (diddirty)
|
||||
VOP_BWRITE(bp);
|
||||
else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
/* Also may be available bytes in current seg */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass6.c,v 1.18 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: pass6.c,v 1.19 2007/10/08 21:39:50 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
@ -245,7 +245,7 @@ remove_ino(struct uvnode *vp, ino_t ino)
|
||||
VOP_BWRITE(sbp);
|
||||
seg_table[dtosn(fs, daddr)].su_nbytes -= DINODE1_SIZE;
|
||||
} else
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
/* Do on-disk accounting */
|
||||
if (vp) {
|
||||
@ -348,13 +348,13 @@ account_indir(struct uvnode *vp, struct ufs1_dinode *dp, daddr_t ilbn, daddr_t d
|
||||
bread(fs->lfs_devvp, fsbtodb(fs, daddr), fs->lfs_bsize, NULL, &bp);
|
||||
buf = emalloc(fs->lfs_bsize);
|
||||
memcpy(buf, bp->b_data, fs->lfs_bsize);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
obuf = emalloc(fs->lfs_bsize);
|
||||
if (vp) {
|
||||
bread(vp, ilbn, fs->lfs_bsize, NULL, &bp);
|
||||
memcpy(obuf, bp->b_data, fs->lfs_bsize);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
} else
|
||||
memset(obuf, 0, fs->lfs_bsize);
|
||||
|
||||
@ -519,7 +519,7 @@ alloc_inode(ino_t thisino, ufs_daddr_t daddr)
|
||||
break;
|
||||
} else
|
||||
ino = ifp->if_nextfree;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -663,7 +663,7 @@ pass6(void)
|
||||
bread(devvp, fsbtodb(fs, ibdaddr), fs->lfs_ibsize,
|
||||
NOCRED, &ibp);
|
||||
memcpy(ibbuf, ibp->b_data, fs->lfs_ibsize);
|
||||
brelse(ibp);
|
||||
brelse(ibp, 0);
|
||||
|
||||
j = 0;
|
||||
for (dp = (struct ufs1_dinode *)ibbuf;
|
||||
@ -681,7 +681,7 @@ pass6(void)
|
||||
) {
|
||||
pwarn("BAD INODE AT 0x%" PRIx32 "\n",
|
||||
ibdaddr);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
free(inums);
|
||||
goto out;
|
||||
}
|
||||
@ -779,7 +779,7 @@ pass6(void)
|
||||
if (bc == 0) {
|
||||
pwarn("unexpected bad seg ptr at 0x%x with serial=%d\n",
|
||||
(int)daddr, (int)sp->ss_serial);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
break;
|
||||
} else {
|
||||
if (debug)
|
||||
@ -794,7 +794,7 @@ pass6(void)
|
||||
btofsb(fs, fs->lfs_sumsize + fs->lfs_bsize) - 1)) {
|
||||
daddr = ((SEGSUM *)bp->b_data)->ss_next;
|
||||
}
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
out:
|
||||
@ -854,7 +854,7 @@ pass6(void)
|
||||
if (bc == 0) {
|
||||
pwarn("unexpected bad seg ptr [2] at 0x%x with serial=%d\n",
|
||||
(int)daddr, (int)sp->ss_serial);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
break;
|
||||
}
|
||||
odaddr = daddr;
|
||||
@ -869,7 +869,7 @@ pass6(void)
|
||||
LFS_CLEANERINFO(cip, fs, cbp);
|
||||
LFS_SYNC_CLEANERINFO(cip, fs, cbp, 0);
|
||||
bp->b_flags |= B_AGE;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
/* Final address could also be a superblock */
|
||||
@ -897,7 +897,7 @@ pass6(void)
|
||||
VOP_BWRITE(bp);
|
||||
break;
|
||||
}
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
fs->lfs_nextseg = sntod(fs, sn);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: segwrite.c,v 1.15 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: segwrite.c,v 1.16 2007/10/08 21:39:50 ad Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -224,7 +224,7 @@ lfs_writefile(struct lfs * fs, struct segment * sp, struct uvnode * vp)
|
||||
fip->fi_ino = ip->i_number;
|
||||
LFS_IENTRY(ifp, fs, fip->fi_ino, bp);
|
||||
fip->fi_version = ifp->if_version;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
lfs_gather(fs, sp, vp, lfs_match_data);
|
||||
lfs_gather(fs, sp, vp, lfs_match_indir);
|
||||
@ -319,7 +319,7 @@ lfs_writeinode(struct lfs * fs, struct segment * sp, struct inode * ip)
|
||||
if (gotblk) {
|
||||
LFS_LOCK_BUF(bp);
|
||||
assert(!(bp->b_flags & B_INVAL));
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
/* Increment inode count in segment summary block. */
|
||||
++((SEGSUM *) (sp->segsum))->ss_ninos;
|
||||
@ -638,7 +638,7 @@ lfs_initseg(struct lfs * fs)
|
||||
fs->lfs_offset += btofsb(fs, LFS_SBPAD);
|
||||
sp->seg_bytes_left -= LFS_SBPAD;
|
||||
}
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
/* Segment zero could also contain the labelpad */
|
||||
if (fs->lfs_version > 1 && sp->seg_number == 0 &&
|
||||
fs->lfs_start < btofsb(fs, LFS_LABELPAD)) {
|
||||
@ -683,7 +683,7 @@ lfs_initseg(struct lfs * fs)
|
||||
sp->sum_bytes_left = fs->lfs_sumsize - SEGSUM_SIZE(fs);
|
||||
|
||||
LFS_LOCK_BUF(sbp);
|
||||
brelse(sbp);
|
||||
brelse(sbp, 0);
|
||||
return repeat;
|
||||
}
|
||||
|
||||
@ -719,7 +719,7 @@ lfs_newseg(struct lfs * fs)
|
||||
errx(1, "lfs_nextseg: no clean segments");
|
||||
LFS_SEGENTRY(sup, fs, sn, bp);
|
||||
isdirty = sup->su_flags & SEGUSE_DIRTY;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
if (!isdirty)
|
||||
break;
|
||||
@ -943,7 +943,7 @@ lfs_segunlock(struct lfs * fs)
|
||||
bp->b_flags &= ~B_DELWRI;
|
||||
reassignbuf(bp, bp->b_vp);
|
||||
bp->b_flags |= B_BUSY; /* XXX */
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
} else
|
||||
printf("unlock to 0 with no summary");
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: setup.c,v 1.32 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: setup.c,v 1.33 2007/10/08 21:39:50 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
@ -273,7 +273,7 @@ setup(const char *dev)
|
||||
if (sp->ss_sumsum != cksum(&sp->ss_datasum,
|
||||
fs->lfs_sumsize -
|
||||
sizeof(sp->ss_sumsum))) {
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
if (debug)
|
||||
printf("bad cksum at %x\n",
|
||||
(unsigned)tdaddr);
|
||||
@ -292,7 +292,7 @@ setup(const char *dev)
|
||||
tdaddr += btofsb(fs, bc) + 1;
|
||||
fs->lfs_offset = tdaddr;
|
||||
fs->lfs_serial = sp->ss_serial + 1;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -307,7 +307,7 @@ setup(const char *dev)
|
||||
errx(1, "init: no clean segments");
|
||||
LFS_SEGENTRY(sup, fs, sn, bp);
|
||||
isdirty = sup->su_flags & SEGUSE_DIRTY;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
|
||||
if (!isdirty)
|
||||
break;
|
||||
@ -425,7 +425,7 @@ setup(const char *dev)
|
||||
for (i = 0; i < VTOI(ivp)->i_ffs1_size; i += fs->lfs_bsize) {
|
||||
bread(ivp, i >> fs->lfs_bshift, fs->lfs_bsize, NOCRED, &bp);
|
||||
/* XXX check B_ERROR */
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -439,7 +439,7 @@ setup(const char *dev)
|
||||
seg_table[i].su_flags = sup->su_flags & ~SEGUSE_ACTIVE;
|
||||
if (preen)
|
||||
seg_table[i].su_nbytes = sup->su_nbytes;
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
}
|
||||
|
||||
/* Initialize Ifile entry */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vnode.c,v 1.6 2006/11/09 19:36:36 christos Exp $ */
|
||||
/* $NetBSD: vnode.c,v 1.7 2007/10/08 21:39:50 ad Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -93,7 +93,7 @@ raw_vop_bwrite(struct ubuf * bp)
|
||||
{
|
||||
bp->b_flags &= ~(B_READ | B_DELWRI | B_DONE | B_ERROR);
|
||||
raw_vop_strategy(bp);
|
||||
brelse(bp);
|
||||
brelse(bp, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user