zfs_znode.c (210470) | zfs_znode.c (211932) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 163 unchanged lines hidden (view full) --- 172 mutex_init(&zp->z_acl_lock, NULL, MUTEX_DEFAULT, NULL); 173 174 mutex_init(&zp->z_range_lock, NULL, MUTEX_DEFAULT, NULL); 175 avl_create(&zp->z_range_avl, zfs_range_compare, 176 sizeof (rl_t), offsetof(rl_t, r_node)); 177 178 zp->z_dbuf = NULL; 179 zp->z_dirlocks = NULL; | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 163 unchanged lines hidden (view full) --- 172 mutex_init(&zp->z_acl_lock, NULL, MUTEX_DEFAULT, NULL); 173 174 mutex_init(&zp->z_range_lock, NULL, MUTEX_DEFAULT, NULL); 175 avl_create(&zp->z_range_avl, zfs_range_compare, 176 sizeof (rl_t), offsetof(rl_t, r_node)); 177 178 zp->z_dbuf = NULL; 179 zp->z_dirlocks = NULL; |
180 zp->z_acl_cached = NULL; |
|
180 return (0); 181} 182 183/*ARGSUSED*/ 184static void 185zfs_znode_cache_destructor(void *buf, void *arg) 186{ 187 znode_t *zp = buf; --- 6 unchanged lines hidden (view full) --- 194 rw_destroy(&zp->z_parent_lock); 195 rw_destroy(&zp->z_name_lock); 196 mutex_destroy(&zp->z_acl_lock); 197 avl_destroy(&zp->z_range_avl); 198 mutex_destroy(&zp->z_range_lock); 199 200 ASSERT(zp->z_dbuf == NULL); 201 ASSERT(zp->z_dirlocks == NULL); | 181 return (0); 182} 183 184/*ARGSUSED*/ 185static void 186zfs_znode_cache_destructor(void *buf, void *arg) 187{ 188 znode_t *zp = buf; --- 6 unchanged lines hidden (view full) --- 195 rw_destroy(&zp->z_parent_lock); 196 rw_destroy(&zp->z_name_lock); 197 mutex_destroy(&zp->z_acl_lock); 198 avl_destroy(&zp->z_range_avl); 199 mutex_destroy(&zp->z_range_lock); 200 201 ASSERT(zp->z_dbuf == NULL); 202 ASSERT(zp->z_dirlocks == NULL); |
203 ASSERT(zp->z_acl_cached == NULL); |
|
202} 203 204#ifdef ZNODE_STATS 205static struct { 206 uint64_t zms_zfsvfs_invalid; 207 uint64_t zms_zfsvfs_recheck1; 208 uint64_t zms_zfsvfs_unmounted; 209 uint64_t zms_zfsvfs_recheck2; --- 29 unchanged lines hidden (view full) --- 239 nzp->z_seq = ozp->z_seq; 240 nzp->z_mapcnt = ozp->z_mapcnt; 241 nzp->z_last_itx = ozp->z_last_itx; 242 nzp->z_gen = ozp->z_gen; 243 nzp->z_sync_cnt = ozp->z_sync_cnt; 244 nzp->z_phys = ozp->z_phys; 245 nzp->z_dbuf = ozp->z_dbuf; 246 | 204} 205 206#ifdef ZNODE_STATS 207static struct { 208 uint64_t zms_zfsvfs_invalid; 209 uint64_t zms_zfsvfs_recheck1; 210 uint64_t zms_zfsvfs_unmounted; 211 uint64_t zms_zfsvfs_recheck2; --- 29 unchanged lines hidden (view full) --- 241 nzp->z_seq = ozp->z_seq; 242 nzp->z_mapcnt = ozp->z_mapcnt; 243 nzp->z_last_itx = ozp->z_last_itx; 244 nzp->z_gen = ozp->z_gen; 245 nzp->z_sync_cnt = ozp->z_sync_cnt; 246 nzp->z_phys = ozp->z_phys; 247 nzp->z_dbuf = ozp->z_dbuf; 248 |
249 /* 250 * Since this is just an idle znode and kmem is already dealing with 251 * memory pressure, release any cached ACL. 252 */ 253 if (ozp->z_acl_cached) { 254 zfs_acl_free(ozp->z_acl_cached); 255 ozp->z_acl_cached = NULL; 256 } 257 |
|
247 /* Update back pointers. */ 248 (void) dmu_buf_update_user(nzp->z_dbuf, ozp, nzp, &nzp->z_phys, 249 znode_evict_error); 250 251 /* 252 * Invalidate the original znode by clearing fields that provide a 253 * pointer back to the znode. Set the low bit of the vfs pointer to 254 * ensure that zfs_znode_move() recognizes the znode as invalid in any --- 237 unchanged lines hidden (view full) --- 492 znode_t *nzp; 493 494 ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs) || (zfsvfs == zp->z_zfsvfs)); 495 ASSERT(MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id))); 496 497 mutex_enter(&zp->z_lock); 498 499 ASSERT(zp->z_dbuf == NULL); | 258 /* Update back pointers. */ 259 (void) dmu_buf_update_user(nzp->z_dbuf, ozp, nzp, &nzp->z_phys, 260 znode_evict_error); 261 262 /* 263 * Invalidate the original znode by clearing fields that provide a 264 * pointer back to the znode. Set the low bit of the vfs pointer to 265 * ensure that zfs_znode_move() recognizes the znode as invalid in any --- 237 unchanged lines hidden (view full) --- 503 znode_t *nzp; 504 505 ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs) || (zfsvfs == zp->z_zfsvfs)); 506 ASSERT(MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id))); 507 508 mutex_enter(&zp->z_lock); 509 510 ASSERT(zp->z_dbuf == NULL); |
511 ASSERT(zp->z_acl_cached == NULL); |
|
500 zp->z_dbuf = db; 501 nzp = dmu_buf_set_user_ie(db, zp, &zp->z_phys, znode_evict_error); 502 503 /* 504 * there should be no 505 * concurrent zgets on this object. 506 */ 507 if (nzp != NULL) --- 467 unchanged lines hidden (view full) --- 975 } 976 977 if (((znode_phys_t *)db->db_data)->zp_gen != zp->z_gen) { 978 dmu_buf_rele(db, NULL); 979 ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); 980 return (EIO); 981 } 982 | 512 zp->z_dbuf = db; 513 nzp = dmu_buf_set_user_ie(db, zp, &zp->z_phys, znode_evict_error); 514 515 /* 516 * there should be no 517 * concurrent zgets on this object. 518 */ 519 if (nzp != NULL) --- 467 unchanged lines hidden (view full) --- 987 } 988 989 if (((znode_phys_t *)db->db_data)->zp_gen != zp->z_gen) { 990 dmu_buf_rele(db, NULL); 991 ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); 992 return (EIO); 993 } 994 |
995 mutex_enter(&zp->z_acl_lock); 996 if (zp->z_acl_cached) { 997 zfs_acl_free(zp->z_acl_cached); 998 zp->z_acl_cached = NULL; 999 } 1000 mutex_exit(&zp->z_acl_lock); 1001 |
|
983 zfs_znode_dmu_init(zfsvfs, zp, db); 984 zp->z_unlinked = (zp->z_phys->zp_links == 0); 985 zp->z_blksz = doi.doi_data_block_size; 986 987 ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); 988 989 return (0); 990} --- 69 unchanged lines hidden (view full) --- 1060 zfsvfs_t *zfsvfs = zp->z_zfsvfs; 1061 1062 ASSERT(ZTOV(zp) == NULL); 1063 mutex_enter(&zfsvfs->z_znodes_lock); 1064 POINTER_INVALIDATE(&zp->z_zfsvfs); 1065 list_remove(&zfsvfs->z_all_znodes, zp); 1066 mutex_exit(&zfsvfs->z_znodes_lock); 1067 | 1002 zfs_znode_dmu_init(zfsvfs, zp, db); 1003 zp->z_unlinked = (zp->z_phys->zp_links == 0); 1004 zp->z_blksz = doi.doi_data_block_size; 1005 1006 ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); 1007 1008 return (0); 1009} --- 69 unchanged lines hidden (view full) --- 1079 zfsvfs_t *zfsvfs = zp->z_zfsvfs; 1080 1081 ASSERT(ZTOV(zp) == NULL); 1082 mutex_enter(&zfsvfs->z_znodes_lock); 1083 POINTER_INVALIDATE(&zp->z_zfsvfs); 1084 list_remove(&zfsvfs->z_all_znodes, zp); 1085 mutex_exit(&zfsvfs->z_znodes_lock); 1086 |
1087 if (zp->z_acl_cached) { 1088 zfs_acl_free(zp->z_acl_cached); 1089 zp->z_acl_cached = NULL; 1090 } 1091 |
|
1068 kmem_cache_free(znode_cache, zp); 1069 1070 VFS_RELE(zfsvfs->z_vfs); 1071} 1072 1073void 1074zfs_time_stamper_locked(znode_t *zp, uint_t flag, dmu_tx_t *tx) 1075{ --- 552 unchanged lines hidden --- | 1092 kmem_cache_free(znode_cache, zp); 1093 1094 VFS_RELE(zfsvfs->z_vfs); 1095} 1096 1097void 1098zfs_time_stamper_locked(znode_t *zp, uint_t flag, dmu_tx_t *tx) 1099{ --- 552 unchanged lines hidden --- |