diff options
author | kib <kib@FreeBSD.org> | 2017-04-12 09:22:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2017-04-12 09:22:02 +0000 |
commit | a1620c5c0c8461cda616da9ff3529627c6404763 (patch) | |
tree | f8f1c4a356fc10dcb1fb77897de47a7487176b28 /sys/kern | |
parent | b4e0ebca416aa114600baa89a05bc5cb65c7c897 (diff) | |
download | FreeBSD-src-a1620c5c0c8461cda616da9ff3529627c6404763.zip FreeBSD-src-a1620c5c0c8461cda616da9ff3529627c6404763.tar.gz |
MFC r316528:
Add V_VMIO flag for vinvalbuf(9).
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_subr.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2d2beab..c3106f5 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1603,13 +1603,15 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo) */ do { bufobj_wwait(bo, 0, 0); - BO_UNLOCK(bo); - if (bo->bo_object != NULL) { - VM_OBJECT_WLOCK(bo->bo_object); - vm_object_pip_wait(bo->bo_object, "bovlbx"); - VM_OBJECT_WUNLOCK(bo->bo_object); + if ((flags & V_VMIO) == 0) { + BO_UNLOCK(bo); + if (bo->bo_object != NULL) { + VM_OBJECT_WLOCK(bo->bo_object); + vm_object_pip_wait(bo->bo_object, "bovlbx"); + VM_OBJECT_WUNLOCK(bo->bo_object); + } + BO_LOCK(bo); } - BO_LOCK(bo); } while (bo->bo_numoutput > 0); BO_UNLOCK(bo); @@ -1617,7 +1619,7 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo) * Destroy the copy in the VM cache, too. */ if (bo->bo_object != NULL && - (flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0) { + (flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0) { VM_OBJECT_WLOCK(bo->bo_object); vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ? OBJPR_CLEANONLY : 0); @@ -1626,7 +1628,7 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo) #ifdef INVARIANTS BO_LOCK(bo); - if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0 && + if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0 && (bo->bo_dirty.bv_cnt > 0 || bo->bo_clean.bv_cnt > 0)) panic("vinvalbuf: flush failed"); BO_UNLOCK(bo); |