#include "dm.h"
#include "dm-bio-prison-v1.h"
#include "dm-bio-prison-v2.h"
#include <linux/spinlock.h>
#include <linux/mempool.h>
#include <linux/module.h>
#include <linux/slab.h>
#define MIN_CELLS …
struct prison_region { … } ____cacheline_aligned_in_smp;
struct dm_bio_prison { … };
static struct kmem_cache *_cell_cache;
struct dm_bio_prison *dm_bio_prison_create(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void dm_bio_prison_destroy(struct dm_bio_prison *prison)
{ … }
EXPORT_SYMBOL_GPL(…);
struct dm_bio_prison_cell *dm_bio_prison_alloc_cell(struct dm_bio_prison *prison, gfp_t gfp)
{ … }
EXPORT_SYMBOL_GPL(…);
void dm_bio_prison_free_cell(struct dm_bio_prison *prison,
struct dm_bio_prison_cell *cell)
{ … }
EXPORT_SYMBOL_GPL(…);
static void __setup_new_cell(struct dm_cell_key *key,
struct bio *holder,
struct dm_bio_prison_cell *cell)
{ … }
static int cmp_keys(struct dm_cell_key *lhs,
struct dm_cell_key *rhs)
{ … }
static inline unsigned int lock_nr(struct dm_cell_key *key, unsigned int num_locks)
{ … }
bool dm_cell_key_has_valid_range(struct dm_cell_key *key)
{ … }
EXPORT_SYMBOL(…);
static int __bio_detain(struct rb_root *root,
struct dm_cell_key *key,
struct bio *inmate,
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result)
{ … }
static int bio_detain(struct dm_bio_prison *prison,
struct dm_cell_key *key,
struct bio *inmate,
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result)
{ … }
int dm_bio_detain(struct dm_bio_prison *prison,
struct dm_cell_key *key,
struct bio *inmate,
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result)
{ … }
EXPORT_SYMBOL_GPL(…);
int dm_get_cell(struct dm_bio_prison *prison,
struct dm_cell_key *key,
struct dm_bio_prison_cell *cell_prealloc,
struct dm_bio_prison_cell **cell_result)
{ … }
EXPORT_SYMBOL_GPL(…);
static void __cell_release(struct rb_root *root,
struct dm_bio_prison_cell *cell,
struct bio_list *inmates)
{ … }
void dm_cell_release(struct dm_bio_prison *prison,
struct dm_bio_prison_cell *cell,
struct bio_list *bios)
{ … }
EXPORT_SYMBOL_GPL(…);
static void __cell_release_no_holder(struct rb_root *root,
struct dm_bio_prison_cell *cell,
struct bio_list *inmates)
{ … }
void dm_cell_release_no_holder(struct dm_bio_prison *prison,
struct dm_bio_prison_cell *cell,
struct bio_list *inmates)
{ … }
EXPORT_SYMBOL_GPL(…);
void dm_cell_error(struct dm_bio_prison *prison,
struct dm_bio_prison_cell *cell, blk_status_t error)
{ … }
EXPORT_SYMBOL_GPL(…);
void dm_cell_visit_release(struct dm_bio_prison *prison,
void (*visit_fn)(void *, struct dm_bio_prison_cell *),
void *context,
struct dm_bio_prison_cell *cell)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __promote_or_release(struct rb_root *root,
struct dm_bio_prison_cell *cell)
{ … }
int dm_cell_promote_or_release(struct dm_bio_prison *prison,
struct dm_bio_prison_cell *cell)
{ … }
EXPORT_SYMBOL_GPL(…);
#define DEFERRED_SET_SIZE …
struct dm_deferred_entry { … };
struct dm_deferred_set { … };
struct dm_deferred_set *dm_deferred_set_create(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void dm_deferred_set_destroy(struct dm_deferred_set *ds)
{ … }
EXPORT_SYMBOL_GPL(…);
struct dm_deferred_entry *dm_deferred_entry_inc(struct dm_deferred_set *ds)
{ … }
EXPORT_SYMBOL_GPL(…);
static unsigned int ds_next(unsigned int index)
{ … }
static void __sweep(struct dm_deferred_set *ds, struct list_head *head)
{ … }
void dm_deferred_entry_dec(struct dm_deferred_entry *entry, struct list_head *head)
{ … }
EXPORT_SYMBOL_GPL(…);
int dm_deferred_set_add_work(struct dm_deferred_set *ds, struct list_head *work)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init dm_bio_prison_init_v1(void)
{ … }
static void dm_bio_prison_exit_v1(void)
{ … }
static int (*_inits[])(void) __initdata = …;
static void (*_exits[])(void) = …;
static int __init dm_bio_prison_init(void)
{ … }
static void __exit dm_bio_prison_exit(void)
{ … }
module_init(…) …;
module_exit(dm_bio_prison_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;