summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-08-31 08:50:11 +0000
committerjeff <jeff@FreeBSD.org>2003-08-31 08:50:11 +0000
commit86f70ead2114c0de8a016de4bb047d9ad8aeaf69 (patch)
tree8f00b473657a626826ca739d2ef725324497092d /sys/kern/vfs_bio.c
parentd4a07597ca9fdc4cbb2b3a8176ec14dca7b7f96e (diff)
downloadFreeBSD-src-86f70ead2114c0de8a016de4bb047d9ad8aeaf69.zip
FreeBSD-src-86f70ead2114c0de8a016de4bb047d9ad8aeaf69.tar.gz
- Define a new flag for getblk(): GB_NOCREAT. This flag causes getblk() to
bail out if the buffer is not already present. - The buffer returned by incore() is not locked and should not be sent to brelse(). Use getblk() with the new GB_NOCREAT flag to preserve the desired semantics.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index bea2269..021458c 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2537,6 +2537,14 @@ loop:
* buffer is also considered valid (not marked B_INVAL).
*/
VI_UNLOCK(vp);
+ /*
+ * If the user does not want us to create the buffer, bail out
+ * here.
+ */
+ if (flags & GB_NOCREAT) {
+ splx(s);
+ return NULL;
+ }
if (vn_isdisk(vp, NULL))
bsize = DEV_BSIZE;
else if (vp->v_mountedhere)
OpenPOWER on IntegriCloud