summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2005-12-07 03:39:08 +0000
committerrodrigc <rodrigc@FreeBSD.org>2005-12-07 03:39:08 +0000
commit5a03a981740c885d3073378d42bb59ffe7d952f0 (patch)
tree30301a0a133f43c010b4ba2f4feb2cb5f71e742b /sys/kern/vfs_cluster.c
parent03a6ffac1f9a8616d4b74a4d631d27f024966a76 (diff)
downloadFreeBSD-src-5a03a981740c885d3073378d42bb59ffe7d952f0.zip
FreeBSD-src-5a03a981740c885d3073378d42bb59ffe7d952f0.tar.gz
Changes imported from XFS for FreeBSD project:
- add fields to struct buf (needed by XFS) - 3 private fields: b_fsprivate1, b_fsprivate2, b_fsprivate3 - b_pin_count, count of pinned buffer - add new B_MANAGED flag - add breada() function to initiate asynchronous I/O on read-ahead blocks. - add bufdone_finish(), bpin(), bunpin_wait() functions Patches provided by: kan Reviewed by: phk Silence on: arch@
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 885f1f9..3266829 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -770,6 +770,12 @@ cluster_wbuild(vp, size, start_lbn, len)
--len;
continue;
}
+ if (tbp->b_pin_count > 0) {
+ BUF_UNLOCK(tbp);
+ ++start_lbn;
+ --len;
+ continue;
+ }
bremfree(tbp);
tbp->b_flags &= ~B_DONE;
@@ -873,6 +879,15 @@ cluster_wbuild(vp, size, start_lbn, len)
BUF_UNLOCK(tbp);
break;
}
+
+ /*
+ * Do not pull in pinned buffers.
+ */
+ if (tbp->b_pin_count > 0) {
+ BUF_UNLOCK(tbp);
+ break;
+ }
+
/*
* Ok, it's passed all the tests,
* so remove it from the free list
OpenPOWER on IntegriCloud