mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
Linux: use filemap_range_has_page()
As of the 4.13 kernel filemap_range_has_page() can be used to check if there is a page mapped in a given file range. When available this interface should be used which eliminates the need for the zp->z_is_mapped boolean. Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #14493
This commit is contained in:
@@ -987,7 +987,7 @@ top:
|
||||
|
||||
mutex_enter(&zp->z_lock);
|
||||
may_delete_now = atomic_read(&ZTOI(zp)->i_count) == 1 &&
|
||||
!(zp->z_is_mapped);
|
||||
!zn_has_cached_data(zp, 0, LLONG_MAX);
|
||||
mutex_exit(&zp->z_lock);
|
||||
|
||||
/*
|
||||
@@ -1075,7 +1075,8 @@ top:
|
||||
&xattr_obj_unlinked, sizeof (xattr_obj_unlinked));
|
||||
delete_now = may_delete_now && !toobig &&
|
||||
atomic_read(&ZTOI(zp)->i_count) == 1 &&
|
||||
!(zp->z_is_mapped) && xattr_obj == xattr_obj_unlinked &&
|
||||
!zn_has_cached_data(zp, 0, LLONG_MAX) &&
|
||||
xattr_obj == xattr_obj_unlinked &&
|
||||
zfs_external_acl(zp) == acl_obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user