prison             36 drivers/md/dm-bio-prison-v1.c 	struct dm_bio_prison *prison = kzalloc(sizeof(*prison), GFP_KERNEL);
prison             39 drivers/md/dm-bio-prison-v1.c 	if (!prison)
prison             42 drivers/md/dm-bio-prison-v1.c 	spin_lock_init(&prison->lock);
prison             44 drivers/md/dm-bio-prison-v1.c 	ret = mempool_init_slab_pool(&prison->cell_pool, MIN_CELLS, _cell_cache);
prison             46 drivers/md/dm-bio-prison-v1.c 		kfree(prison);
prison             50 drivers/md/dm-bio-prison-v1.c 	prison->cells = RB_ROOT;
prison             52 drivers/md/dm-bio-prison-v1.c 	return prison;
prison             56 drivers/md/dm-bio-prison-v1.c void dm_bio_prison_destroy(struct dm_bio_prison *prison)
prison             58 drivers/md/dm-bio-prison-v1.c 	mempool_exit(&prison->cell_pool);
prison             59 drivers/md/dm-bio-prison-v1.c 	kfree(prison);
prison             63 drivers/md/dm-bio-prison-v1.c struct dm_bio_prison_cell *dm_bio_prison_alloc_cell(struct dm_bio_prison *prison, gfp_t gfp)
prison             65 drivers/md/dm-bio-prison-v1.c 	return mempool_alloc(&prison->cell_pool, gfp);
prison             69 drivers/md/dm-bio-prison-v1.c void dm_bio_prison_free_cell(struct dm_bio_prison *prison,
prison             72 drivers/md/dm-bio-prison-v1.c 	mempool_free(cell, &prison->cell_pool);
prison            109 drivers/md/dm-bio-prison-v1.c static int __bio_detain(struct dm_bio_prison *prison,
prison            116 drivers/md/dm-bio-prison-v1.c 	struct rb_node **new = &prison->cells.rb_node, *parent = NULL;
prison            141 drivers/md/dm-bio-prison-v1.c 	rb_insert_color(&cell_prealloc->node, &prison->cells);
prison            146 drivers/md/dm-bio-prison-v1.c static int bio_detain(struct dm_bio_prison *prison,
prison            155 drivers/md/dm-bio-prison-v1.c 	spin_lock_irqsave(&prison->lock, flags);
prison            156 drivers/md/dm-bio-prison-v1.c 	r = __bio_detain(prison, key, inmate, cell_prealloc, cell_result);
prison            157 drivers/md/dm-bio-prison-v1.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            162 drivers/md/dm-bio-prison-v1.c int dm_bio_detain(struct dm_bio_prison *prison,
prison            168 drivers/md/dm-bio-prison-v1.c 	return bio_detain(prison, key, inmate, cell_prealloc, cell_result);
prison            172 drivers/md/dm-bio-prison-v1.c int dm_get_cell(struct dm_bio_prison *prison,
prison            177 drivers/md/dm-bio-prison-v1.c 	return bio_detain(prison, key, NULL, cell_prealloc, cell_result);
prison            184 drivers/md/dm-bio-prison-v1.c static void __cell_release(struct dm_bio_prison *prison,
prison            188 drivers/md/dm-bio-prison-v1.c 	rb_erase(&cell->node, &prison->cells);
prison            197 drivers/md/dm-bio-prison-v1.c void dm_cell_release(struct dm_bio_prison *prison,
prison            203 drivers/md/dm-bio-prison-v1.c 	spin_lock_irqsave(&prison->lock, flags);
prison            204 drivers/md/dm-bio-prison-v1.c 	__cell_release(prison, cell, bios);
prison            205 drivers/md/dm-bio-prison-v1.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            212 drivers/md/dm-bio-prison-v1.c static void __cell_release_no_holder(struct dm_bio_prison *prison,
prison            216 drivers/md/dm-bio-prison-v1.c 	rb_erase(&cell->node, &prison->cells);
prison            220 drivers/md/dm-bio-prison-v1.c void dm_cell_release_no_holder(struct dm_bio_prison *prison,
prison            226 drivers/md/dm-bio-prison-v1.c 	spin_lock_irqsave(&prison->lock, flags);
prison            227 drivers/md/dm-bio-prison-v1.c 	__cell_release_no_holder(prison, cell, inmates);
prison            228 drivers/md/dm-bio-prison-v1.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            232 drivers/md/dm-bio-prison-v1.c void dm_cell_error(struct dm_bio_prison *prison,
prison            239 drivers/md/dm-bio-prison-v1.c 	dm_cell_release(prison, cell, &bios);
prison            248 drivers/md/dm-bio-prison-v1.c void dm_cell_visit_release(struct dm_bio_prison *prison,
prison            255 drivers/md/dm-bio-prison-v1.c 	spin_lock_irqsave(&prison->lock, flags);
prison            257 drivers/md/dm-bio-prison-v1.c 	rb_erase(&cell->node, &prison->cells);
prison            258 drivers/md/dm-bio-prison-v1.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            262 drivers/md/dm-bio-prison-v1.c static int __promote_or_release(struct dm_bio_prison *prison,
prison            266 drivers/md/dm-bio-prison-v1.c 		rb_erase(&cell->node, &prison->cells);
prison            274 drivers/md/dm-bio-prison-v1.c int dm_cell_promote_or_release(struct dm_bio_prison *prison,
prison            280 drivers/md/dm-bio-prison-v1.c 	spin_lock_irqsave(&prison->lock, flags);
prison            281 drivers/md/dm-bio-prison-v1.c 	r = __promote_or_release(prison, cell);
prison            282 drivers/md/dm-bio-prison-v1.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison             50 drivers/md/dm-bio-prison-v1.h void dm_bio_prison_destroy(struct dm_bio_prison *prison);
prison             59 drivers/md/dm-bio-prison-v1.h struct dm_bio_prison_cell *dm_bio_prison_alloc_cell(struct dm_bio_prison *prison,
prison             61 drivers/md/dm-bio-prison-v1.h void dm_bio_prison_free_cell(struct dm_bio_prison *prison,
prison             70 drivers/md/dm-bio-prison-v1.h int dm_get_cell(struct dm_bio_prison *prison,
prison             81 drivers/md/dm-bio-prison-v1.h int dm_bio_detain(struct dm_bio_prison *prison,
prison             87 drivers/md/dm-bio-prison-v1.h void dm_cell_release(struct dm_bio_prison *prison,
prison             90 drivers/md/dm-bio-prison-v1.h void dm_cell_release_no_holder(struct dm_bio_prison *prison,
prison             93 drivers/md/dm-bio-prison-v1.h void dm_cell_error(struct dm_bio_prison *prison,
prison            100 drivers/md/dm-bio-prison-v1.h void dm_cell_visit_release(struct dm_bio_prison *prison,
prison            114 drivers/md/dm-bio-prison-v1.h int dm_cell_promote_or_release(struct dm_bio_prison *prison,
prison             38 drivers/md/dm-bio-prison-v2.c 	struct dm_bio_prison_v2 *prison = kzalloc(sizeof(*prison), GFP_KERNEL);
prison             41 drivers/md/dm-bio-prison-v2.c 	if (!prison)
prison             44 drivers/md/dm-bio-prison-v2.c 	prison->wq = wq;
prison             45 drivers/md/dm-bio-prison-v2.c 	spin_lock_init(&prison->lock);
prison             47 drivers/md/dm-bio-prison-v2.c 	ret = mempool_init_slab_pool(&prison->cell_pool, MIN_CELLS, _cell_cache);
prison             49 drivers/md/dm-bio-prison-v2.c 		kfree(prison);
prison             53 drivers/md/dm-bio-prison-v2.c 	prison->cells = RB_ROOT;
prison             55 drivers/md/dm-bio-prison-v2.c 	return prison;
prison             59 drivers/md/dm-bio-prison-v2.c void dm_bio_prison_destroy_v2(struct dm_bio_prison_v2 *prison)
prison             61 drivers/md/dm-bio-prison-v2.c 	mempool_exit(&prison->cell_pool);
prison             62 drivers/md/dm-bio-prison-v2.c 	kfree(prison);
prison             66 drivers/md/dm-bio-prison-v2.c struct dm_bio_prison_cell_v2 *dm_bio_prison_alloc_cell_v2(struct dm_bio_prison_v2 *prison, gfp_t gfp)
prison             68 drivers/md/dm-bio-prison-v2.c 	return mempool_alloc(&prison->cell_pool, gfp);
prison             72 drivers/md/dm-bio-prison-v2.c void dm_bio_prison_free_cell_v2(struct dm_bio_prison_v2 *prison,
prison             75 drivers/md/dm-bio-prison-v2.c 	mempool_free(cell, &prison->cell_pool);
prison            114 drivers/md/dm-bio-prison-v2.c static bool __find_or_insert(struct dm_bio_prison_v2 *prison,
prison            120 drivers/md/dm-bio-prison-v2.c 	struct rb_node **new = &prison->cells.rb_node, *parent = NULL;
prison            144 drivers/md/dm-bio-prison-v2.c 	rb_insert_color(&cell_prealloc->node, &prison->cells);
prison            149 drivers/md/dm-bio-prison-v2.c static bool __get(struct dm_bio_prison_v2 *prison,
prison            156 drivers/md/dm-bio-prison-v2.c 	if (__find_or_insert(prison, key, cell_prealloc, cell)) {
prison            172 drivers/md/dm-bio-prison-v2.c bool dm_cell_get_v2(struct dm_bio_prison_v2 *prison,
prison            182 drivers/md/dm-bio-prison-v2.c 	spin_lock_irqsave(&prison->lock, flags);
prison            183 drivers/md/dm-bio-prison-v2.c 	r = __get(prison, key, lock_level, inmate, cell_prealloc, cell_result);
prison            184 drivers/md/dm-bio-prison-v2.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            190 drivers/md/dm-bio-prison-v2.c static bool __put(struct dm_bio_prison_v2 *prison,
prison            200 drivers/md/dm-bio-prison-v2.c 				queue_work(prison->wq, cell->quiesce_continuation);
prison            204 drivers/md/dm-bio-prison-v2.c 			rb_erase(&cell->node, &prison->cells);
prison            212 drivers/md/dm-bio-prison-v2.c bool dm_cell_put_v2(struct dm_bio_prison_v2 *prison,
prison            218 drivers/md/dm-bio-prison-v2.c 	spin_lock_irqsave(&prison->lock, flags);
prison            219 drivers/md/dm-bio-prison-v2.c 	r = __put(prison, cell);
prison            220 drivers/md/dm-bio-prison-v2.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            226 drivers/md/dm-bio-prison-v2.c static int __lock(struct dm_bio_prison_v2 *prison,
prison            234 drivers/md/dm-bio-prison-v2.c 	if (__find_or_insert(prison, key, cell_prealloc, &cell)) {
prison            257 drivers/md/dm-bio-prison-v2.c int dm_cell_lock_v2(struct dm_bio_prison_v2 *prison,
prison            266 drivers/md/dm-bio-prison-v2.c 	spin_lock_irqsave(&prison->lock, flags);
prison            267 drivers/md/dm-bio-prison-v2.c 	r = __lock(prison, key, lock_level, cell_prealloc, cell_result);
prison            268 drivers/md/dm-bio-prison-v2.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            274 drivers/md/dm-bio-prison-v2.c static void __quiesce(struct dm_bio_prison_v2 *prison,
prison            279 drivers/md/dm-bio-prison-v2.c 		queue_work(prison->wq, continuation);
prison            284 drivers/md/dm-bio-prison-v2.c void dm_cell_quiesce_v2(struct dm_bio_prison_v2 *prison,
prison            290 drivers/md/dm-bio-prison-v2.c 	spin_lock_irqsave(&prison->lock, flags);
prison            291 drivers/md/dm-bio-prison-v2.c 	__quiesce(prison, cell, continuation);
prison            292 drivers/md/dm-bio-prison-v2.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            296 drivers/md/dm-bio-prison-v2.c static int __promote(struct dm_bio_prison_v2 *prison,
prison            307 drivers/md/dm-bio-prison-v2.c int dm_cell_lock_promote_v2(struct dm_bio_prison_v2 *prison,
prison            314 drivers/md/dm-bio-prison-v2.c 	spin_lock_irqsave(&prison->lock, flags);
prison            315 drivers/md/dm-bio-prison-v2.c 	r = __promote(prison, cell, new_lock_level);
prison            316 drivers/md/dm-bio-prison-v2.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison            322 drivers/md/dm-bio-prison-v2.c static bool __unlock(struct dm_bio_prison_v2 *prison,
prison            336 drivers/md/dm-bio-prison-v2.c 	rb_erase(&cell->node, &prison->cells);
prison            340 drivers/md/dm-bio-prison-v2.c bool dm_cell_unlock_v2(struct dm_bio_prison_v2 *prison,
prison            347 drivers/md/dm-bio-prison-v2.c 	spin_lock_irqsave(&prison->lock, flags);
prison            348 drivers/md/dm-bio-prison-v2.c 	r = __unlock(prison, cell, bios);
prison            349 drivers/md/dm-bio-prison-v2.c 	spin_unlock_irqrestore(&prison->lock, flags);
prison             57 drivers/md/dm-bio-prison-v2.h void dm_bio_prison_destroy_v2(struct dm_bio_prison_v2 *prison);
prison             66 drivers/md/dm-bio-prison-v2.h struct dm_bio_prison_cell_v2 *dm_bio_prison_alloc_cell_v2(struct dm_bio_prison_v2 *prison,
prison             68 drivers/md/dm-bio-prison-v2.h void dm_bio_prison_free_cell_v2(struct dm_bio_prison_v2 *prison,
prison             87 drivers/md/dm-bio-prison-v2.h bool dm_cell_get_v2(struct dm_bio_prison_v2 *prison,
prison             98 drivers/md/dm-bio-prison-v2.h bool dm_cell_put_v2(struct dm_bio_prison_v2 *prison,
prison            115 drivers/md/dm-bio-prison-v2.h int dm_cell_lock_v2(struct dm_bio_prison_v2 *prison,
prison            121 drivers/md/dm-bio-prison-v2.h void dm_cell_quiesce_v2(struct dm_bio_prison_v2 *prison,
prison            133 drivers/md/dm-bio-prison-v2.h int dm_cell_lock_promote_v2(struct dm_bio_prison_v2 *prison,
prison            146 drivers/md/dm-bio-prison-v2.h bool dm_cell_unlock_v2(struct dm_bio_prison_v2 *prison,
prison            452 drivers/md/dm-cache-target.c 	struct dm_bio_prison_v2 *prison;
prison            545 drivers/md/dm-cache-target.c 	return dm_bio_prison_alloc_cell_v2(cache->prison, GFP_NOIO);
prison            550 drivers/md/dm-cache-target.c 	dm_bio_prison_free_cell_v2(cache->prison, cell);
prison            667 drivers/md/dm-cache-target.c 	r = dm_cell_get_v2(cache->prison, &key, lock_level(bio), bio, cell_prealloc, &cell);
prison           1167 drivers/md/dm-cache-target.c 	dm_cell_quiesce_v2(mg->cache->prison, mg->cell, &mg->k.ws);
prison           1209 drivers/md/dm-cache-target.c 	if (pb->cell && dm_cell_put_v2(cache->prison, pb->cell))
prison           1310 drivers/md/dm-cache-target.c 		if (dm_cell_unlock_v2(cache->prison, mg->cell, &bios))
prison           1417 drivers/md/dm-cache-target.c 		r = dm_cell_lock_promote_v2(mg->cache->prison, mg->cell,
prison           1497 drivers/md/dm-cache-target.c 	r = dm_cell_lock_v2(cache->prison, &key,
prison           1547 drivers/md/dm-cache-target.c 	if (dm_cell_unlock_v2(cache->prison, mg->cell, &bios))
prison           1617 drivers/md/dm-cache-target.c 	r = dm_cell_lock_v2(cache->prison, &key,
prison           1992 drivers/md/dm-cache-target.c 	if (cache->prison)
prison           1993 drivers/md/dm-cache-target.c 		dm_bio_prison_destroy_v2(cache->prison);
prison           2616 drivers/md/dm-cache-target.c 	cache->prison = dm_bio_prison_create_v2(cache->wq);
prison           2617 drivers/md/dm-cache-target.c 	if (!cache->prison) {
prison            247 drivers/md/dm-thin.c 	struct dm_bio_prison *prison;
prison            453 drivers/md/dm-thin.c 	cell_prealloc = dm_bio_prison_alloc_cell(pool->prison, GFP_NOIO);
prison            455 drivers/md/dm-thin.c 	r = dm_bio_detain(pool->prison, key, bio, cell_prealloc, cell_result);
prison            461 drivers/md/dm-thin.c 		dm_bio_prison_free_cell(pool->prison, cell_prealloc);
prison            470 drivers/md/dm-thin.c 	dm_cell_release(pool->prison, cell, bios);
prison            471 drivers/md/dm-thin.c 	dm_bio_prison_free_cell(pool->prison, cell);
prison            479 drivers/md/dm-thin.c 	dm_cell_visit_release(pool->prison, fn, context, cell);
prison            480 drivers/md/dm-thin.c 	dm_bio_prison_free_cell(pool->prison, cell);
prison            487 drivers/md/dm-thin.c 	dm_cell_release_no_holder(pool->prison, cell, bios);
prison            488 drivers/md/dm-thin.c 	dm_bio_prison_free_cell(pool->prison, cell);
prison            494 drivers/md/dm-thin.c 	dm_cell_error(pool->prison, cell, error_code);
prison            495 drivers/md/dm-thin.c 	dm_bio_prison_free_cell(pool->prison, cell);
prison           2931 drivers/md/dm-thin.c 	dm_bio_prison_destroy(pool->prison);
prison           2980 drivers/md/dm-thin.c 	pool->prison = dm_bio_prison_create();
prison           2981 drivers/md/dm-thin.c 	if (!pool->prison) {
prison           3073 drivers/md/dm-thin.c 	dm_bio_prison_destroy(pool->prison);