Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c
Show First 20 Lines • Show All 1,073 Lines • ▼ Show 20 Lines | zfs_rezget(znode_t *zp) | ||||
uint64_t gen; | uint64_t gen; | ||||
/* | /* | ||||
* Remove cached pages before reloading the znode, so that they are not | * Remove cached pages before reloading the znode, so that they are not | ||||
* lingering after we run into any error. Ideally, we should vgone() | * lingering after we run into any error. Ideally, we should vgone() | ||||
* the vnode in case of error, but currently we cannot do that | * the vnode in case of error, but currently we cannot do that | ||||
* because of the LOR between the vnode lock and z_teardown_lock. | * because of the LOR between the vnode lock and z_teardown_lock. | ||||
* So, instead, we have to "doom" the znode in the illumos style. | * So, instead, we have to "doom" the znode in the illumos style. | ||||
* | |||||
* Ignore invalid pages during the scan. This is to avoid deadlocks | |||||
* between page busying and the teardown lock, as pages are typically | |||||
* busied prior to a VOP_GETPAGES operation, which acquires the teardown | |||||
* lock. Such pages will be invalid and can safely be skipped here. | |||||
*/ | */ | ||||
vp = ZTOV(zp); | vp = ZTOV(zp); | ||||
#if __FreeBSD_version >= 1400042 | |||||
vn_pages_remove_valid(vp, 0, 0); | |||||
#else | |||||
vn_pages_remove(vp, 0, 0); | vn_pages_remove(vp, 0, 0); | ||||
#endif | |||||
ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); | ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); | ||||
mutex_enter(&zp->z_acl_lock); | mutex_enter(&zp->z_acl_lock); | ||||
if (zp->z_acl_cached) { | if (zp->z_acl_cached) { | ||||
zfs_acl_free(zp->z_acl_cached); | zfs_acl_free(zp->z_acl_cached); | ||||
zp->z_acl_cached = NULL; | zp->z_acl_cached = NULL; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,010 Lines • Show Last 20 Lines |