Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c
Show First 20 Lines • Show All 441 Lines • ▼ Show 20 Lines | #endif | ||||
zp->z_sa_hdl = NULL; | zp->z_sa_hdl = NULL; | ||||
zp->z_unlinked = 0; | zp->z_unlinked = 0; | ||||
zp->z_atime_dirty = 0; | zp->z_atime_dirty = 0; | ||||
zp->z_mapcnt = 0; | zp->z_mapcnt = 0; | ||||
zp->z_id = db->db_object; | zp->z_id = db->db_object; | ||||
zp->z_blksz = blksz; | zp->z_blksz = blksz; | ||||
zp->z_seq = 0x7A4653; | zp->z_seq = 0x7A4653; | ||||
zp->z_sync_cnt = 0; | zp->z_sync_cnt = 0; | ||||
atomic_store_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); | |||||
vp = ZTOV(zp); | vp = ZTOV(zp); | ||||
zfs_znode_sa_init(zfsvfs, zp, db, obj_type, hdl); | zfs_znode_sa_init(zfsvfs, zp, db, obj_type, hdl); | ||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zfsvfs), NULL, &mode, 8); | SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zfsvfs), NULL, &mode, 8); | ||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_GEN(zfsvfs), NULL, &zp->z_gen, 8); | SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_GEN(zfsvfs), NULL, &zp->z_gen, 8); | ||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_SIZE(zfsvfs), NULL, | SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_SIZE(zfsvfs), NULL, | ||||
▲ Show 20 Lines • Show All 777 Lines • ▼ Show 20 Lines | zfs_zinactive(znode_t *zp) | ||||
ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); | ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); | ||||
zfs_znode_free(zp); | zfs_znode_free(zp); | ||||
} | } | ||||
void | void | ||||
zfs_znode_free(znode_t *zp) | zfs_znode_free(znode_t *zp) | ||||
{ | { | ||||
zfsvfs_t *zfsvfs = zp->z_zfsvfs; | zfsvfs_t *zfsvfs = zp->z_zfsvfs; | ||||
char *symlink; | |||||
ASSERT(zp->z_sa_hdl == NULL); | ASSERT(zp->z_sa_hdl == NULL); | ||||
zp->z_vnode = NULL; | zp->z_vnode = NULL; | ||||
mutex_enter(&zfsvfs->z_znodes_lock); | mutex_enter(&zfsvfs->z_znodes_lock); | ||||
POINTER_INVALIDATE(&zp->z_zfsvfs); | POINTER_INVALIDATE(&zp->z_zfsvfs); | ||||
list_remove(&zfsvfs->z_all_znodes, zp); | list_remove(&zfsvfs->z_all_znodes, zp); | ||||
zfsvfs->z_nr_znodes--; | zfsvfs->z_nr_znodes--; | ||||
mutex_exit(&zfsvfs->z_znodes_lock); | mutex_exit(&zfsvfs->z_znodes_lock); | ||||
symlink = atomic_load_ptr(&zp->z_cached_symlink); | |||||
if (symlink != NULL) { | |||||
atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); | |||||
cache_symlink_free(symlink); | |||||
} | |||||
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; | ||||
} | } | ||||
zfs_znode_free_kmem(zp); | zfs_znode_free_kmem(zp); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 790 Lines • Show Last 20 Lines |