diff options
author | jeff <jeff@FreeBSD.org> | 2003-08-31 08:50:11 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-08-31 08:50:11 +0000 |
commit | 86f70ead2114c0de8a016de4bb047d9ad8aeaf69 (patch) | |
tree | 8f00b473657a626826ca739d2ef725324497092d /sys/kern/vfs_bio.c | |
parent | d4a07597ca9fdc4cbb2b3a8176ec14dca7b7f96e (diff) | |
download | FreeBSD-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.c | 8 |
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) |