]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vm pager: writemapping accounting for OBJT_SWAP
authorkevans <kevans@FreeBSD.org>
Tue, 3 Sep 2019 20:31:48 +0000 (20:31 +0000)
committerkevans <kevans@FreeBSD.org>
Tue, 3 Sep 2019 20:31:48 +0000 (20:31 +0000)
commitbc17200e76342ea12a704f0a5e8047717046af82
tree509f29e986a0209987ac59ac0bae562cac3b30c2
parent541e57af0b09cc226f89cc33027d9b9daf47812e
vm pager: writemapping accounting for OBJT_SWAP

Currently writemapping accounting is only done for vnode_pager which does
some accounting on the underlying vnode.

Extend this to allow accounting to be possible for any of the pager types.
New pageops are added to update/release writecount that need to be
implemented for any pager wishing to do said accounting, and we implement
these methods now for both vnode_pager (unchanged) and swap_pager.

The primary motivation for this is to allow other systems with OBJT_SWAP
objects to check if their objects have any write mappings and reject
operations with EBUSY if so. posixshm will be the first to do so in order to
reject adding write seals to the shmfd if any writable mappings exist.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D21456
sys/kern/vfs_vnops.c
sys/vm/swap_pager.c
sys/vm/vm_map.c
sys/vm/vm_map.h
sys/vm/vm_mmap.c
sys/vm/vm_object.h
sys/vm/vm_pager.h
sys/vm/vnode_pager.c
sys/vm/vnode_pager.h