diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2019-10-22 16:09:25 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2019-10-22 16:09:25 +0000 |
commit | 208b81bb050ff1ee50fccc3636eeeceec1546cc9 (patch) | |
tree | 89371e5f94f124dbcf825e307bae9c350ce7cc1e /sys/vm/vnode_pager.c | |
parent | be0c32e2ff3e52fbd07394602f71957b22be5709 (diff) |
Add VV_VMSIZEVNLOCK flag.
The flag specifies that vm_fault() handler should check the vnode'
vm_object size under the vnode lock. It is converted into the object'
OBJ_SIZEVNLOCK flag in vnode_pager_alloc().
Tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D21883
Notes
Notes:
svn path=/head/; revision=353890
Diffstat (limited to 'sys/vm/vnode_pager.c')
-rw-r--r-- | sys/vm/vnode_pager.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index f19c3a0af3f0..d9d14896051d 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -269,8 +269,12 @@ retry: object->un_pager.vnp.vnp_size = size; object->un_pager.vnp.writemappings = 0; object->domain.dr_policy = vnode_domainset; - object->handle = handle; + if ((vp->v_vflag & VV_VMSIZEVNLOCK) != 0) { + VM_OBJECT_WLOCK(object); + vm_object_set_flag(object, OBJ_SIZEVNLOCK); + VM_OBJECT_WUNLOCK(object); + } VI_LOCK(vp); if (vp->v_object != NULL) { /* |