Mark directory buffers that have no valid data with B_INVAL

so that they are not put in the cache.
This commit is contained in:
Kirk McKusick 1998-09-29 22:01:10 +00:00
parent 113b88d241
commit 1cda241131
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39782
2 changed files with 12 additions and 2 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95
* $Id: nfs_bio.c,v 1.60 1998/09/04 08:06:56 dfr Exp $
* $Id: nfs_bio.c,v 1.61 1998/09/29 21:46:54 mckusick Exp $
*/
@ -555,6 +555,8 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
bp->b_flags |= B_READ;
vfs_busy_pages(bp, 0);
error = nfs_doio(bp, cred, p);
if (error == 0 && (bp->b_flags & B_INVAL))
break;
if (error) {
brelse(bp);
} else if (i < lbn) {
@ -573,6 +575,7 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
* directory offset cookie of the next block.)
*/
if (nfs_numasync > 0 && nmp->nm_readahead > 0 &&
(bp->b_flags & B_INVAL) == 0 &&
(np->n_direofoffset == 0 ||
(lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) &&
!(np->n_flag & NQNFSNONCACHE) &&
@ -1203,6 +1206,8 @@ nfs_doio(bp, cr, p)
}
if ((nmp->nm_flag & NFSMNT_RDIRPLUS) == 0)
error = nfs_readdirrpc(vp, uiop, cr);
if (error == 0 && uiop->uio_resid == bp->b_bcount)
bp->b_flags |= B_INVAL;
break;
default:
printf("nfs_doio: type %x unexpected\n",vp->v_type);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95
* $Id: nfs_bio.c,v 1.60 1998/09/04 08:06:56 dfr Exp $
* $Id: nfs_bio.c,v 1.61 1998/09/29 21:46:54 mckusick Exp $
*/
@ -555,6 +555,8 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
bp->b_flags |= B_READ;
vfs_busy_pages(bp, 0);
error = nfs_doio(bp, cred, p);
if (error == 0 && (bp->b_flags & B_INVAL))
break;
if (error) {
brelse(bp);
} else if (i < lbn) {
@ -573,6 +575,7 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
* directory offset cookie of the next block.)
*/
if (nfs_numasync > 0 && nmp->nm_readahead > 0 &&
(bp->b_flags & B_INVAL) == 0 &&
(np->n_direofoffset == 0 ||
(lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) &&
!(np->n_flag & NQNFSNONCACHE) &&
@ -1203,6 +1206,8 @@ nfs_doio(bp, cr, p)
}
if ((nmp->nm_flag & NFSMNT_RDIRPLUS) == 0)
error = nfs_readdirrpc(vp, uiop, cr);
if (error == 0 && uiop->uio_resid == bp->b_bcount)
bp->b_flags |= B_INVAL;
break;
default:
printf("nfs_doio: type %x unexpected\n",vp->v_type);