Lines Matching refs:cell

73 				struct dm_bio_prison_cell_v2 *cell)
75 mempool_free(cell, &prison->cell_pool);
80 struct dm_bio_prison_cell_v2 *cell)
82 memset(cell, 0, sizeof(*cell));
83 memcpy(&cell->key, key, sizeof(cell->key));
84 bio_list_init(&cell->bios);
123 struct dm_bio_prison_cell_v2 *cell =
126 r = cmp_keys(key, &cell->key);
136 *result = cell;
154 struct dm_bio_prison_cell_v2 **cell)
156 if (__find_or_insert(prison, key, cell_prealloc, cell)) {
157 if ((*cell)->exclusive_lock) {
158 if (lock_level <= (*cell)->exclusive_level) {
159 bio_list_add(&(*cell)->bios, inmate);
164 (*cell)->shared_count++;
167 (*cell)->shared_count = 1;
190 struct dm_bio_prison_cell_v2 *cell)
192 BUG_ON(!cell->shared_count);
193 cell->shared_count--;
196 if (!cell->shared_count) {
197 if (cell->exclusive_lock){
198 if (cell->quiesce_continuation) {
199 queue_work(prison->wq, cell->quiesce_continuation);
200 cell->quiesce_continuation = NULL;
203 rb_erase(&cell->node, &prison->cells);
212 struct dm_bio_prison_cell_v2 *cell)
218 r = __put(prison, cell);
231 struct dm_bio_prison_cell_v2 *cell;
233 if (__find_or_insert(prison, key, cell_prealloc, &cell)) {
234 if (cell->exclusive_lock)
237 cell->exclusive_lock = true;
238 cell->exclusive_level = lock_level;
239 *cell_result = cell;
243 return cell->shared_count > 0;
246 cell = cell_prealloc;
247 cell->shared_count = 0;
248 cell->exclusive_lock = true;
249 cell->exclusive_level = lock_level;
250 *cell_result = cell;
273 struct dm_bio_prison_cell_v2 *cell,
276 if (!cell->shared_count)
279 cell->quiesce_continuation = continuation;
283 struct dm_bio_prison_cell_v2 *cell,
287 __quiesce(prison, cell, continuation);
293 struct dm_bio_prison_cell_v2 *cell,
296 if (!cell->exclusive_lock)
299 cell->exclusive_level = new_lock_level;
300 return cell->shared_count > 0;
304 struct dm_bio_prison_cell_v2 *cell,
310 r = __promote(prison, cell, new_lock_level);
318 struct dm_bio_prison_cell_v2 *cell,
321 BUG_ON(!cell->exclusive_lock);
323 bio_list_merge(bios, &cell->bios);
324 bio_list_init(&cell->bios);
326 if (cell->shared_count) {
327 cell->exclusive_lock = false;
331 rb_erase(&cell->node, &prison->cells);
336 struct dm_bio_prison_cell_v2 *cell,
342 r = __unlock(prison, cell, bios);