diff options
| author | Stephan Uphoff <ups@FreeBSD.org> | 2005-10-28 01:03:26 +0000 |
|---|---|---|
| committer | Stephan Uphoff <ups@FreeBSD.org> | 2005-10-28 01:03:26 +0000 |
| commit | 5f37fe5bda086cdeb424ccd71001d318ef4ea4d2 (patch) | |
| tree | 296db6a0b320ac253e7f4a568ab036c1055e3d61 | |
| parent | 18d2ca12a1cf1de7991c38fd1bd689c71d2c6480 (diff) | |
Notes
| -rw-r--r-- | sys/kern/vfs_cluster.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index ed80fc522a91..01fa49e0f14a 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -142,11 +142,16 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) /* * Set another read-ahead mark so we know - * to check again. + * to check again. (If we can lock the + * buffer without waiting) */ - if (((i % racluster) == (racluster - 1)) || - (i == (maxra - 1))) + if ((((i % racluster) == (racluster - 1)) || + (i == (maxra - 1))) + && (0 == BUF_LOCK(rbp, + LK_EXCLUSIVE | LK_NOWAIT, NULL))) { rbp->b_flags |= B_RAM; + BUF_UNLOCK(rbp); + } } VI_UNLOCK(vp); if (i >= maxra) { |
