Lines Matching full:cell

74 				struct dm_bio_prison_cell_v2 *cell)  in dm_bio_prison_free_cell_v2()  argument
76 mempool_free(cell, &prison->cell_pool); in dm_bio_prison_free_cell_v2()
81 struct dm_bio_prison_cell_v2 *cell) in __setup_new_cell() argument
83 memset(cell, 0, sizeof(*cell)); in __setup_new_cell()
84 memcpy(&cell->key, key, sizeof(cell->key)); in __setup_new_cell()
85 bio_list_init(&cell->bios); in __setup_new_cell()
124 struct dm_bio_prison_cell_v2 *cell = in __find_or_insert() local
127 r = cmp_keys(key, &cell->key); in __find_or_insert()
137 *result = cell; in __find_or_insert()
155 struct dm_bio_prison_cell_v2 **cell) in __get() argument
157 if (__find_or_insert(prison, key, cell_prealloc, cell)) { in __get()
158 if ((*cell)->exclusive_lock) { in __get()
159 if (lock_level <= (*cell)->exclusive_level) { in __get()
160 bio_list_add(&(*cell)->bios, inmate); in __get()
165 (*cell)->shared_count++; in __get()
168 (*cell)->shared_count = 1; in __get()
191 struct dm_bio_prison_cell_v2 *cell) in __put() argument
193 BUG_ON(!cell->shared_count); in __put()
194 cell->shared_count--; in __put()
197 if (!cell->shared_count) { in __put()
198 if (cell->exclusive_lock) { in __put()
199 if (cell->quiesce_continuation) { in __put()
200 queue_work(prison->wq, cell->quiesce_continuation); in __put()
201 cell->quiesce_continuation = NULL; in __put()
204 rb_erase(&cell->node, &prison->cells); in __put()
213 struct dm_bio_prison_cell_v2 *cell) in dm_cell_put_v2() argument
219 r = __put(prison, cell); in dm_cell_put_v2()
232 struct dm_bio_prison_cell_v2 *cell; in __lock() local
234 if (__find_or_insert(prison, key, cell_prealloc, &cell)) { in __lock()
235 if (cell->exclusive_lock) in __lock()
238 cell->exclusive_lock = true; in __lock()
239 cell->exclusive_level = lock_level; in __lock()
240 *cell_result = cell; in __lock()
244 return cell->shared_count > 0; in __lock()
247 cell = cell_prealloc; in __lock()
248 cell->shared_count = 0; in __lock()
249 cell->exclusive_lock = true; in __lock()
250 cell->exclusive_level = lock_level; in __lock()
251 *cell_result = cell; in __lock()
274 struct dm_bio_prison_cell_v2 *cell, in __quiesce() argument
277 if (!cell->shared_count) in __quiesce()
280 cell->quiesce_continuation = continuation; in __quiesce()
284 struct dm_bio_prison_cell_v2 *cell, in dm_cell_quiesce_v2() argument
288 __quiesce(prison, cell, continuation); in dm_cell_quiesce_v2()
294 struct dm_bio_prison_cell_v2 *cell, in __promote() argument
297 if (!cell->exclusive_lock) in __promote()
300 cell->exclusive_level = new_lock_level; in __promote()
301 return cell->shared_count > 0; in __promote()
305 struct dm_bio_prison_cell_v2 *cell, in dm_cell_lock_promote_v2() argument
311 r = __promote(prison, cell, new_lock_level); in dm_cell_lock_promote_v2()
319 struct dm_bio_prison_cell_v2 *cell, in __unlock() argument
322 BUG_ON(!cell->exclusive_lock); in __unlock()
324 bio_list_merge_init(bios, &cell->bios); in __unlock()
326 if (cell->shared_count) { in __unlock()
327 cell->exclusive_lock = false; in __unlock()
331 rb_erase(&cell->node, &prison->cells); in __unlock()
336 struct dm_bio_prison_cell_v2 *cell, in dm_cell_unlock_v2() argument
342 r = __unlock(prison, cell, bios); in dm_cell_unlock_v2()