diff options
author | mm <mm@FreeBSD.org> | 2011-08-25 08:17:39 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2011-08-25 08:17:39 +0000 |
commit | e104c96f018139a8d2a85057c37ae2e5999cbd41 (patch) | |
tree | f8958cd0b60a86012d8905a34cb8bdc7e640171f /sys/kern | |
parent | 631a8abdff140aaa997d795f570b6c5e78f34991 (diff) | |
download | FreeBSD-src-e104c96f018139a8d2a85057c37ae2e5999cbd41.zip FreeBSD-src-e104c96f018139a8d2a85057c37ae2e5999cbd41.tar.gz |
Generalize ffs_pages_remove() into vn_pages_remove().
Remove mapped pages for all dataset vnodes in zfs_rezget() using
new vn_pages_remove() to fix mmapped files changed by
zfs rollback or zfs receive -F.
PR: kern/160035, kern/156933
Reviewed by: kib, pjd
Approved by: re (kib)
MFC after: 1 week
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_vnops.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index a8f1bf1..92fb0d9 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include <security/audit/audit.h> #include <security/mac/mac_framework.h> +#include <vm/vm.h> +#include <vm/vm_object.h> + static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; static fo_truncate_t vn_truncate; @@ -1398,3 +1401,15 @@ vn_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, VFS_UNLOCK_GIANT(vfslocked); return (error); } + +void +vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) +{ + vm_object_t object; + + if ((object = vp->v_object) == NULL) + return; + VM_OBJECT_LOCK(object); + vm_object_page_remove(object, start, end, 0); + VM_OBJECT_UNLOCK(object); +} |