- We are not guaranteed that read ahead blocks are not in memory already.
Check for B_DELWRI as well as B_CACHED before issuing io on a buffer. This is especially important since we are changing the b_iocmd.
This commit is contained in:
parent
a5a502558e
commit
83e8b19361
@ -264,12 +264,20 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
|
||||
rbp = cluster_rbuild(vp, filesize, lblkno, blkno,
|
||||
size, ncontig, NULL);
|
||||
lblkno += (rbp->b_bufsize / size);
|
||||
if (rbp->b_flags & B_DELWRI) {
|
||||
bqrelse(rbp);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
rbp = getblk(vp, lblkno, size, 0, 0, 0);
|
||||
lblkno += 1;
|
||||
if (rbp->b_flags & B_DELWRI) {
|
||||
bqrelse(rbp);
|
||||
continue;
|
||||
}
|
||||
rbp->b_flags |= B_ASYNC | B_RAM;
|
||||
rbp->b_iocmd = BIO_READ;
|
||||
rbp->b_blkno = blkno;
|
||||
lblkno += 1;
|
||||
}
|
||||
if (rbp->b_flags & B_CACHE) {
|
||||
rbp->b_flags &= ~B_ASYNC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user