avoid unnecessary aging of buffers. This used to make sense, when buffer
caches were much smaller, but makes little sense now, and will become more useless as RAM (and buffer cache) sizes grow. Suggested by Bob Baron.
This commit is contained in:
parent
83b019efaa
commit
e9d17d38b5
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cd9660_vnops.c,v 1.23 1995/06/28 05:10:45 cgd Exp $ */
|
||||
/* $NetBSD: cd9660_vnops.c,v 1.24 1995/07/24 21:19:27 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994
|
||||
@ -307,9 +307,6 @@ cd9660_read(ap)
|
||||
}
|
||||
|
||||
error = uiomove(bp->b_data + on, (int)n, uio);
|
||||
if (n + on == imp->logical_block_size ||
|
||||
uio->uio_offset == (off_t)ip->i_size)
|
||||
bp->b_flags |= B_AGE;
|
||||
brelse(bp);
|
||||
} while (error == 0 && uio->uio_resid > 0 && n != 0);
|
||||
return (error);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_cluster.c,v 1.7 1994/12/13 09:14:35 mycroft Exp $ */
|
||||
/* $NetBSD: vfs_cluster.c,v 1.8 1995/07/24 21:19:50 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
@ -717,6 +717,10 @@ redo:
|
||||
|
||||
tbp->b_bufsize -= size;
|
||||
tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI);
|
||||
/*
|
||||
* We might as well AGE the buffer here; it's either empty, or
|
||||
* contains data that we couldn't get rid of (but wanted to).
|
||||
*/
|
||||
tbp->b_flags |= (B_ASYNC | B_AGE);
|
||||
s = splbio();
|
||||
reassignbuf(tbp, tbp->b_vp); /* put on clean list */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: spec_vnops.c,v 1.25 1995/07/08 00:42:45 cgd Exp $ */
|
||||
/* $NetBSD: spec_vnops.c,v 1.26 1995/07/24 21:20:11 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -279,8 +279,6 @@ spec_read(ap)
|
||||
return (error);
|
||||
}
|
||||
error = uiomove((char *)bp->b_data + on, n, uio);
|
||||
if (n + on == bsize)
|
||||
bp->b_flags |= B_AGE;
|
||||
brelse(bp);
|
||||
} while (error == 0 && uio->uio_resid > 0 && n != 0);
|
||||
return (error);
|
||||
@ -361,10 +359,9 @@ spec_write(ap)
|
||||
return (error);
|
||||
}
|
||||
error = uiomove((char *)bp->b_data + on, n, uio);
|
||||
if (n + on == bsize) {
|
||||
bp->b_flags |= B_AGE;
|
||||
if (n + on == bsize)
|
||||
bawrite(bp);
|
||||
} else
|
||||
else
|
||||
bdwrite(bp);
|
||||
} while (error == 0 && uio->uio_resid > 0 && n != 0);
|
||||
return (error);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msdosfs_fat.c,v 1.17 1995/03/19 20:52:36 ws Exp $ */
|
||||
/* $NetBSD: msdosfs_fat.c,v 1.18 1995/07/24 21:20:28 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
@ -963,10 +963,8 @@ extendfile(dep, count, bpp, ncp, flags)
|
||||
if (bpp) {
|
||||
*bpp = bp;
|
||||
bpp = NULL;
|
||||
} else {
|
||||
bp->b_flags |= B_AGE;
|
||||
bawrite(bp);
|
||||
}
|
||||
} else
|
||||
bdwrite(bp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.35 1995/06/02 15:33:29 mycroft Exp $ */
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.36 1995/07/24 21:20:34 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
@ -446,16 +446,6 @@ msdosfs_read(ap)
|
||||
return (error);
|
||||
}
|
||||
error = uiomove(bp->b_data + on, (int) n, uio);
|
||||
/*
|
||||
* If we have read everything from this block or have read
|
||||
* to end of file then we are done with this block. Mark
|
||||
* it to say the buffer can be reused if need be.
|
||||
*/
|
||||
#if 0
|
||||
if (n + on == pmp->pm_bpcluster ||
|
||||
uio->uio_offset == dep->de_FileSize)
|
||||
bp->b_flags |= B_AGE;
|
||||
#endif
|
||||
brelse(bp);
|
||||
} while (error == 0 && uio->uio_resid > 0 && n != 0);
|
||||
return (error);
|
||||
@ -645,10 +635,9 @@ msdosfs_write(ap)
|
||||
*/
|
||||
if (ioflag & IO_SYNC)
|
||||
(void) bwrite(bp);
|
||||
else if (n + croffset == pmp->pm_bpcluster) {
|
||||
bp->b_flags |= B_AGE;
|
||||
else if (n + croffset == pmp->pm_bpcluster)
|
||||
bawrite(bp);
|
||||
} else
|
||||
else
|
||||
bdwrite(bp);
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
} while (error == 0 && uio->uio_resid > 0);
|
||||
@ -1489,17 +1478,6 @@ msdosfs_readdir(ap)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* If we have read everything from this block or have read
|
||||
* to end of file then we are done with this block. Mark
|
||||
* it to say the buffer can be reused if need be.
|
||||
*/
|
||||
if (n + on == pmp->pm_bpcluster ||
|
||||
dep->de_FileSize - (offset - bias) == 0)
|
||||
bp->b_flags |= B_AGE;
|
||||
#endif /* if 0 */
|
||||
brelse(bp);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_bio.c,v 1.20 1995/03/18 05:49:51 gwr Exp $ */
|
||||
/* $NetBSD: nfs_bio.c,v 1.21 1995/07/24 21:20:46 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -332,10 +332,6 @@ again:
|
||||
error = uiomove(baddr + on, (int)n, uio);
|
||||
}
|
||||
switch (vp->v_type) {
|
||||
case VREG:
|
||||
if (n + on == biosize || uio->uio_offset == np->n_size)
|
||||
bp->b_flags |= B_AGE;
|
||||
break;
|
||||
case VLNK:
|
||||
n = 0;
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ufs_readwrite.c,v 1.6 1995/03/24 15:33:31 cgd Exp $ */
|
||||
/* $NetBSD: ufs_readwrite.c,v 1.7 1995/07/24 21:20:53 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
@ -148,10 +148,6 @@ READ(ap)
|
||||
if (error =
|
||||
uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio))
|
||||
break;
|
||||
|
||||
if (S_ISREG(mode) && (xfersize + blkoffset == fs->fs_bsize ||
|
||||
uio->uio_offset == ip->i_size))
|
||||
bp->b_flags |= B_AGE;
|
||||
brelse(bp);
|
||||
}
|
||||
if (bp != NULL)
|
||||
@ -268,10 +264,8 @@ WRITE(ap)
|
||||
else if (xfersize + blkoffset == fs->fs_bsize)
|
||||
if (doclusterwrite)
|
||||
cluster_write(bp, ip->i_size);
|
||||
else {
|
||||
bp->b_flags |= B_AGE;
|
||||
else
|
||||
bawrite(bp);
|
||||
}
|
||||
else
|
||||
bdwrite(bp);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user