freebsd-dev/sys/cddl
Andriy Gapon c7d346f269 zfs: fix, improve and re-organize page_lookup and page_unlock
Now they are split into two pairs: page_hold/page_unhold for mappedread
and page_busy/page_unbusy for update_pages.

For mappedread we simply hold a page that is to be used as a source if it
is resident and valid (and not busy).  This is sufficient since we are
only doing page -> user buffer copying.  There is no page <-> backing
storage I/O involved.

update_pages is now better split to properly handle the putpages case
(page -> arc) and the regular write case (arc -> page).

For the latter we use complete protocol of marking an object with
paging-in-progress and marking a page with io_start (busy count).
Also, in this case we remove the write bit from all page mappings and
clear dirty bits of the pages, the former is needed to ensure that the
latter does the right thing.
Additionally we update a page if it is cached instead of just freeing it
as was done before.  This needs to be verified.

A minor detail: ZFS-backed pages should always be either fully valid
or fully invalid.  Assert this and use simpler API that does not deal
with sub-page blocks.

Reviewed by:	kib
MFC after:	26 days
2013-02-03 18:42:20 +00:00
..
boot/zfs forgotten file from r240346 2012-09-11 08:45:49 +00:00
compat/opensolaris solaris compat: remove KM_ZERO 2013-02-02 11:41:05 +00:00
contrib/opensolaris zfs: fix, improve and re-organize page_lookup and page_unlock 2013-02-03 18:42:20 +00:00
dev Fix the PowerPC DTrace copy functions. The kernel doesn't hold the same view to 2013-02-03 00:19:34 +00:00