freebsd-dev/sys/cddl/contrib/opensolaris/uts/common/fs
Andriy Gapon 8a3883cfb7 zfs vn_has_cached_data: take into account v_object->cache != NULL
This mirrors code in tmpfs.
This changge shouldn't affect much read path, it may cause unnecessary
vm_page_lookup calls in the case where v_object has no active or inactive
pages but has some cache pages.  I believe this situation to be non-essential.

In write path this change should allow us to properly detect the above
case and free a cache page when we write to a range that corresponds to it.
If this situation is undetected then we could have a discrepancy between
data in page cache and in ARC or on disk.

This change allows us to re-enable vn_has_cached_data() check in zfs_write.

NOTE: strictly speaking resident_page_count and cache fields of v_object
should be exmined under VM_OBJECT_LOCK, but for this particular usage
we may get away with it.

Discussed with:	alc, kib
Approved by:	pjd
Tested with:	tools/regression/fsx
MFC after:	3 weeks
2010-09-15 11:05:41 +00:00
..
zfs zfs vn_has_cached_data: take into account v_object->cache != NULL 2010-09-15 11:05:41 +00:00
gfs.c - Don't depend on value returned by gfs_*_inactive(), it doesn't work 2009-09-26 00:04:30 +00:00
vnode.c Manage asynchronous vnode release just like Solaris. 2009-08-17 09:48:34 +00:00