Lines Matching refs:rsm_resource

448 static struct rsmresource_table rsm_resource;  variable
613 rw_init(&rsm_resource.rsmrc_lock, NULL, RW_DRIVER, NULL); in _init()
698 rw_destroy(&rsm_resource.rsmrc_lock); in _fini()
1129 rw_enter(&rsm_resource.rsmrc_lock, RW_WRITER); in rsmresource_alloc()
1132 for (i = 0; i < rsm_resource.rsmrc_len; i++) { in rsmresource_alloc()
1133 blk = rsm_resource.rsmrc_root[i]; in rsmresource_alloc()
1145 rw_exit(&rsm_resource. in rsmresource_alloc()
1164 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_alloc()
1182 if (rsm_resource.rsmrc_len == rsm_resource.rsmrc_sz) { in rsmresource_alloc()
1187 uint_t newsz = (uint_t)rsm_resource.rsmrc_sz + in rsmresource_alloc()
1192 if (rsm_resource.rsmrc_len*RSMRC_BLKSZ >= in rsmresource_alloc()
1194 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_alloc()
1202 if (rsm_resource.rsmrc_root) { in rsmresource_alloc()
1205 oldsz = (uint_t)(rsm_resource.rsmrc_sz * in rsmresource_alloc()
1212 bcopy(rsm_resource.rsmrc_root, p, oldsz); in rsmresource_alloc()
1213 kmem_free(rsm_resource.rsmrc_root, oldsz); in rsmresource_alloc()
1216 rsm_resource.rsmrc_root = p; in rsmresource_alloc()
1217 rsm_resource.rsmrc_sz = (int)newsz; in rsmresource_alloc()
1220 empty = rsm_resource.rsmrc_len; in rsmresource_alloc()
1221 rsm_resource.rsmrc_len++; in rsmresource_alloc()
1228 ASSERT(rsm_resource.rsmrc_root[empty] == NULL); in rsmresource_alloc()
1229 rsm_resource.rsmrc_root[empty] = blk; in rsmresource_alloc()
1242 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_alloc()
1251 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_alloc()
1274 if (i >= rsm_resource.rsmrc_len) { in rsmresource_free()
1280 rw_enter(&rsm_resource.rsmrc_lock, RW_WRITER); in rsmresource_free()
1282 ASSERT(rsm_resource.rsmrc_root); in rsmresource_free()
1283 ASSERT(i < rsm_resource.rsmrc_len); in rsmresource_free()
1284 ASSERT(i < rsm_resource.rsmrc_sz); in rsmresource_free()
1285 blk = rsm_resource.rsmrc_root[i]; in rsmresource_free()
1287 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_free()
1305 rsm_resource.rsmrc_root[i] = NULL; in rsmresource_free()
1308 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_free()
1332 if (i >= rsm_resource.rsmrc_len) { in rsmresource_lookup()
1338 rw_enter(&rsm_resource.rsmrc_lock, RW_READER); in rsmresource_lookup()
1340 blk = rsm_resource.rsmrc_root[i]; in rsmresource_lookup()
1342 ASSERT(i < rsm_resource.rsmrc_len); in rsmresource_lookup()
1343 ASSERT(i < rsm_resource.rsmrc_sz); in rsmresource_lookup()
1356 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_lookup()
1382 rw_enter(&rsm_resource.rsmrc_lock, RW_READER); in rsmresource_insert()
1384 ASSERT(rsm_resource.rsmrc_root); in rsmresource_insert()
1385 ASSERT(i < rsm_resource.rsmrc_len); in rsmresource_insert()
1386 ASSERT(i < rsm_resource.rsmrc_sz); in rsmresource_insert()
1388 blk = rsm_resource.rsmrc_root[i]; in rsmresource_insert()
1398 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_insert()
1409 rw_enter(&rsm_resource.rsmrc_lock, RW_WRITER); in rsmresource_destroy()
1411 for (i = 0; i < rsm_resource.rsmrc_len; i++) { in rsmresource_destroy()
1414 blk = rsm_resource.rsmrc_root[i]; in rsmresource_destroy()
1426 rsm_resource.rsmrc_root[i] = NULL; in rsmresource_destroy()
1428 if (rsm_resource.rsmrc_root) { in rsmresource_destroy()
1429 i = rsm_resource.rsmrc_sz * (int)sizeof (rsmresource_blk_t *); in rsmresource_destroy()
1430 kmem_free(rsm_resource.rsmrc_root, (uint_t)i); in rsmresource_destroy()
1431 rsm_resource.rsmrc_root = NULL; in rsmresource_destroy()
1432 rsm_resource.rsmrc_len = 0; in rsmresource_destroy()
1433 rsm_resource.rsmrc_sz = 0; in rsmresource_destroy()
1439 rw_exit(&rsm_resource.rsmrc_lock); in rsmresource_destroy()
3562 rw_enter(&rsm_resource.rsmrc_lock, RW_READER); in rsm_export_force_destroy()
3564 for (i = 0; i < rsm_resource.rsmrc_len; i++) { in rsm_export_force_destroy()
3565 blk = rsm_resource.rsmrc_root[i]; in rsm_export_force_destroy()
3593 rw_exit(&rsm_resource.rsmrc_lock); in rsm_export_force_destroy()
9423 rw_enter(&rsm_resource.rsmrc_lock, RW_READER); in rsm_dr_process_local_segments()
9425 for (i = 0; i < rsm_resource.rsmrc_len; i++) { in rsm_dr_process_local_segments()
9426 blk = rsm_resource.rsmrc_root[i]; in rsm_dr_process_local_segments()
9443 rw_exit(&rsm_resource.rsmrc_lock); in rsm_dr_process_local_segments()