1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

The patch is needed in order to not throw away unmodified

local filesystem metadata at the first brelse call when the
block device vnode has v_tag set to VT_NFS.

Reviewed by:	phk
Submitted by:	Tor Egge <tegge@idi.ntnu.no>
This commit is contained in:
Poul-Henning Kamp 1997-09-10 20:09:22 +00:00
parent 07b2d0aaa3
commit c1f95f1378
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29289

View File

@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
* $Id: vfs_bio.c,v 1.124 1997/08/26 04:36:16 dyson Exp $
* $Id: vfs_bio.c,v 1.125 1997/09/07 16:56:29 bde Exp $
*/
/*
@ -593,9 +593,11 @@ brelse(struct buf * bp)
*/
if ((bp->b_flags & B_VMIO)
&& !(bp->b_vp->v_tag == VT_NFS &&
bp->b_vp->v_type != VBLK &&
(bp->b_flags & B_DELWRI) != 0)
#ifdef notdef
&& (bp->b_vp->v_tag != VT_NFS
|| bp->b_vp->v_type == VBLK
|| (bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR))
|| bp->b_validend == 0
|| (bp->b_validoff == 0
@ -1683,7 +1685,8 @@ allocbuf(struct buf * bp, int size)
bp->b_pages[pageindex] = m;
curbpnpages = pageindex + 1;
}
if (vp->v_tag == VT_NFS) {
if (vp->v_tag == VT_NFS &&
vp->v_type != VBLK) {
if (bp->b_dirtyend > 0) {
bp->b_validoff = min(bp->b_validoff, bp->b_dirtyoff);
bp->b_validend = max(bp->b_validend, bp->b_dirtyend);
@ -1993,7 +1996,7 @@ vfs_buf_set_valid(struct buf *bp,
vm_ooffset_t foff, vm_offset_t off, vm_offset_t size,
vm_page_t m)
{
if (bp->b_vp->v_tag == VT_NFS) {
if (bp->b_vp->v_tag == VT_NFS && bp->b_vp->v_type != VBLK) {
vm_offset_t svalid, evalid;
int validbits = m->valid;
@ -2043,7 +2046,7 @@ vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, int pageno, vm_page_t m)
vm_page_set_invalid(m,
(vm_offset_t) (soff & PAGE_MASK),
(vm_offset_t) (eoff - soff));
if (vp->v_tag == VT_NFS) {
if (vp->v_tag == VT_NFS && vp->v_type != VBLK) {
vm_ooffset_t sv, ev;
off = off - pageno * PAGE_SIZE;
sv = off + ((bp->b_validoff + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1));