diff options
author | kib <kib@FreeBSD.org> | 2014-09-15 12:28:29 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-09-15 12:28:29 +0000 |
commit | ebd8a253bb50d17048c8bbdcc4d20b61c1fa75b5 (patch) | |
tree | 1fa12b673a05ff33b8b047e0e2780130b56d0e15 /sys/ufs | |
parent | 0dba5e79e39c9f67a8f141a37d5c6b8fcaff6b46 (diff) | |
download | FreeBSD-src-ebd8a253bb50d17048c8bbdcc4d20b61c1fa75b5.zip FreeBSD-src-ebd8a253bb50d17048c8bbdcc4d20b61c1fa75b5.tar.gz |
Provide the unique implementation for the VOP_GETPAGES() method used
by ffs and ext2fs. Remove duplicated call to vm_page_zero_invalid(),
done by VOP and by vm_pager_getpages(). Use vm_pager_free_nonreq().
Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 6 weeks (after r271596)
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index b6f255e..0dd4d16 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -104,7 +104,6 @@ extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); #endif static vop_fsync_t ffs_fsync; static vop_lock1_t ffs_lock; -static vop_getpages_t ffs_getpages; static vop_read_t ffs_read; static vop_write_t ffs_write; static int ffs_extread(struct vnode *vp, struct uio *uio, int ioflag); @@ -124,7 +123,7 @@ static vop_vptofh_t ffs_vptofh; struct vop_vector ffs_vnodeops1 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, - .vop_getpages = ffs_getpages, + .vop_getpages = vnode_pager_local_getpages, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -143,7 +142,7 @@ struct vop_vector ffs_fifoops1 = { struct vop_vector ffs_vnodeops2 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, - .vop_getpages = ffs_getpages, + .vop_getpages = vnode_pager_local_getpages, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -847,53 +846,6 @@ ffs_write(ap) } /* - * get page routine - */ -static int -ffs_getpages(ap) - struct vop_getpages_args *ap; -{ - int i; - vm_page_t mreq; - int pcount; - - mreq = ap->a_m[ap->a_reqpage]; - - /* - * Since the caller has busied the requested page, that page's valid - * field will not be changed by other threads. - */ - vm_page_assert_xbusied(mreq); - - /* - * if ANY DEV_BSIZE blocks are valid on a large filesystem block, - * then the entire page is valid. Since the page may be mapped, - * user programs might reference data beyond the actual end of file - * occuring within the page. We have to zero that data. - */ - if (mreq->valid) { - VM_OBJECT_WLOCK(mreq->object); - if (mreq->valid != VM_PAGE_BITS_ALL) - vm_page_zero_invalid(mreq, TRUE); - pcount = round_page(ap->a_count) / PAGE_SIZE; - for (i = 0; i < pcount; i++) { - if (i != ap->a_reqpage) { - vm_page_lock(ap->a_m[i]); - vm_page_free(ap->a_m[i]); - vm_page_unlock(ap->a_m[i]); - } - } - VM_OBJECT_WUNLOCK(mreq->object); - return VM_PAGER_OK; - } - - return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, - ap->a_count, - ap->a_reqpage); -} - - -/* * Extended attribute area reading. */ static int |