Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59278
b: refs/heads/master
c: 028867a
h: refs/heads/master
v: v3
  • Loading branch information
Alasdair G Kergon authored and Linus Torvalds committed Jul 12, 2007
1 parent 1c1f931 commit 2e23265
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 122 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79e15ae424afa0a40b1a0c4478046d6ba0b71e20
refs/heads/master: 028867ac28e51afc834a5931e7545c022557eded
30 changes: 14 additions & 16 deletions trunk/drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/*
* per bio private data
*/
struct crypt_io {
struct dm_crypt_io {
struct dm_target *target;
struct bio *base_bio;
struct work_struct work;
Expand Down Expand Up @@ -106,7 +106,7 @@ struct crypt_config {

static struct kmem_cache *_crypt_io_pool;

static void clone_init(struct crypt_io *, struct bio *);
static void clone_init(struct dm_crypt_io *, struct bio *);

/*
* Different IV generation algorithms:
Expand Down Expand Up @@ -382,7 +382,7 @@ static int crypt_convert(struct crypt_config *cc,

static void dm_crypt_bio_destructor(struct bio *bio)
{
struct crypt_io *io = bio->bi_private;
struct dm_crypt_io *io = bio->bi_private;
struct crypt_config *cc = io->target->private;

bio_free(bio, cc->bs);
Expand All @@ -393,7 +393,7 @@ static int crypt_convert(struct crypt_config *cc,
* This should never violate the device limitations
* May return a smaller bio when running out of pages
*/
static struct bio *crypt_alloc_buffer(struct crypt_io *io, unsigned int size)
static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned size)
{
struct crypt_config *cc = io->target->private;
struct bio *clone;
Expand Down Expand Up @@ -479,7 +479,7 @@ static void crypt_free_buffer_pages(struct crypt_config *cc,
* One of the bios was finished. Check for completion of
* the whole request and correctly clean up the buffer.
*/
static void dec_pending(struct crypt_io *io, int error)
static void dec_pending(struct dm_crypt_io *io, int error)
{
struct crypt_config *cc = (struct crypt_config *) io->target->private;

Expand All @@ -503,15 +503,15 @@ static void dec_pending(struct crypt_io *io, int error)
static struct workqueue_struct *_kcryptd_workqueue;
static void kcryptd_do_work(struct work_struct *work);

static void kcryptd_queue_io(struct crypt_io *io)
static void kcryptd_queue_io(struct dm_crypt_io *io)
{
INIT_WORK(&io->work, kcryptd_do_work);
queue_work(_kcryptd_workqueue, &io->work);
}

static int crypt_endio(struct bio *clone, unsigned int done, int error)
{
struct crypt_io *io = clone->bi_private;
struct dm_crypt_io *io = clone->bi_private;
struct crypt_config *cc = io->target->private;
unsigned read_io = bio_data_dir(clone) == READ;

Expand Down Expand Up @@ -545,7 +545,7 @@ static int crypt_endio(struct bio *clone, unsigned int done, int error)
return error;
}

static void clone_init(struct crypt_io *io, struct bio *clone)
static void clone_init(struct dm_crypt_io *io, struct bio *clone)
{
struct crypt_config *cc = io->target->private;

Expand All @@ -556,7 +556,7 @@ static void clone_init(struct crypt_io *io, struct bio *clone)
clone->bi_destructor = dm_crypt_bio_destructor;
}

static void process_read(struct crypt_io *io)
static void process_read(struct dm_crypt_io *io)
{
struct crypt_config *cc = io->target->private;
struct bio *base_bio = io->base_bio;
Expand Down Expand Up @@ -587,7 +587,7 @@ static void process_read(struct crypt_io *io)
generic_make_request(clone);
}

static void process_write(struct crypt_io *io)
static void process_write(struct dm_crypt_io *io)
{
struct crypt_config *cc = io->target->private;
struct bio *base_bio = io->base_bio;
Expand Down Expand Up @@ -644,7 +644,7 @@ static void process_write(struct crypt_io *io)
}
}

static void process_read_endio(struct crypt_io *io)
static void process_read_endio(struct dm_crypt_io *io)
{
struct crypt_config *cc = io->target->private;
struct convert_context ctx;
Expand All @@ -657,7 +657,7 @@ static void process_read_endio(struct crypt_io *io)

static void kcryptd_do_work(struct work_struct *work)
{
struct crypt_io *io = container_of(work, struct crypt_io, work);
struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work);

if (io->post_process)
process_read_endio(io);
Expand Down Expand Up @@ -939,7 +939,7 @@ static int crypt_map(struct dm_target *ti, struct bio *bio,
union map_info *map_context)
{
struct crypt_config *cc = ti->private;
struct crypt_io *io;
struct dm_crypt_io *io;

if (bio_barrier(bio))
return -EOPNOTSUPP;
Expand Down Expand Up @@ -1062,9 +1062,7 @@ static int __init dm_crypt_init(void)
{
int r;

_crypt_io_pool = kmem_cache_create("dm-crypt_io",
sizeof(struct crypt_io),
0, 0, NULL, NULL);
_crypt_io_pool = KMEM_CACHE(dm_crypt_io, 0);
if (!_crypt_io_pool)
return -ENOMEM;

Expand Down
11 changes: 4 additions & 7 deletions trunk/drivers/md/dm-delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct delay_c {
unsigned writes;
};

struct delay_info {
struct dm_delay_info {
struct delay_c *context;
struct list_head list;
struct bio *bio;
Expand Down Expand Up @@ -80,7 +80,7 @@ static void flush_bios(struct bio *bio)

static struct bio *flush_delayed_bios(struct delay_c *dc, int flush_all)
{
struct delay_info *delayed, *next;
struct dm_delay_info *delayed, *next;
unsigned long next_expires = 0;
int start_timer = 0;
BIO_LIST(flush_bios);
Expand Down Expand Up @@ -227,7 +227,7 @@ static void delay_dtr(struct dm_target *ti)

static int delay_bio(struct delay_c *dc, int delay, struct bio *bio)
{
struct delay_info *delayed;
struct dm_delay_info *delayed;
unsigned long expires = 0;

if (!delay || !atomic_read(&dc->may_delay))
Expand Down Expand Up @@ -338,10 +338,7 @@ static int __init dm_delay_init(void)
goto bad_queue;
}

delayed_cache = kmem_cache_create("dm-delay",
sizeof(struct delay_info),
__alignof__(struct delay_info),
0, NULL, NULL);
delayed_cache = KMEM_CACHE(dm_delay_info, 0);
if (!delayed_cache) {
DMERR("Couldn't create delayed bio cache.");
goto bad_memcache;
Expand Down
17 changes: 9 additions & 8 deletions trunk/drivers/md/dm-exception-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct pstore {
struct dm_io_client *io_client;
};

static inline unsigned int sectors_to_pages(unsigned int sectors)
static unsigned sectors_to_pages(unsigned sectors)
{
return sectors / (PAGE_SIZE >> 9);
}
Expand Down Expand Up @@ -393,7 +393,7 @@ static int read_exceptions(struct pstore *ps)
return 0;
}

static inline struct pstore *get_info(struct exception_store *store)
static struct pstore *get_info(struct exception_store *store)
{
return (struct pstore *) store->context;
}
Expand Down Expand Up @@ -480,7 +480,7 @@ static int persistent_read_metadata(struct exception_store *store)
}

static int persistent_prepare(struct exception_store *store,
struct exception *e)
struct dm_snap_exception *e)
{
struct pstore *ps = get_info(store);
uint32_t stride;
Expand All @@ -505,7 +505,7 @@ static int persistent_prepare(struct exception_store *store,
}

static void persistent_commit(struct exception_store *store,
struct exception *e,
struct dm_snap_exception *e,
void (*callback) (void *, int success),
void *callback_context)
{
Expand Down Expand Up @@ -616,7 +616,8 @@ static int transient_read_metadata(struct exception_store *store)
return 0;
}

static int transient_prepare(struct exception_store *store, struct exception *e)
static int transient_prepare(struct exception_store *store,
struct dm_snap_exception *e)
{
struct transient_c *tc = (struct transient_c *) store->context;
sector_t size = get_dev_size(store->snap->cow->bdev);
Expand All @@ -631,9 +632,9 @@ static int transient_prepare(struct exception_store *store, struct exception *e)
}

static void transient_commit(struct exception_store *store,
struct exception *e,
void (*callback) (void *, int success),
void *callback_context)
struct dm_snap_exception *e,
void (*callback) (void *, int success),
void *callback_context)
{
/* Just succeed */
callback(callback_context, 1);
Expand Down
23 changes: 11 additions & 12 deletions trunk/drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct multipath {
struct work_struct trigger_event;

/*
* We must use a mempool of mpath_io structs so that we
* We must use a mempool of dm_mpath_io structs so that we
* can resubmit bios on error.
*/
mempool_t *mpio_pool;
Expand All @@ -92,7 +92,7 @@ struct multipath {
/*
* Context information attached to each bio we process.
*/
struct mpath_io {
struct dm_mpath_io {
struct pgpath *pgpath;
struct dm_bio_details details;
};
Expand Down Expand Up @@ -122,7 +122,7 @@ static struct pgpath *alloc_pgpath(void)
return pgpath;
}

static inline void free_pgpath(struct pgpath *pgpath)
static void free_pgpath(struct pgpath *pgpath)
{
kfree(pgpath);
}
Expand Down Expand Up @@ -299,8 +299,8 @@ static int __must_push_back(struct multipath *m)
dm_noflush_suspending(m->ti));
}

static int map_io(struct multipath *m, struct bio *bio, struct mpath_io *mpio,
unsigned was_queued)
static int map_io(struct multipath *m, struct bio *bio,
struct dm_mpath_io *mpio, unsigned was_queued)
{
int r = DM_MAPIO_REMAPPED;
unsigned long flags;
Expand Down Expand Up @@ -374,7 +374,7 @@ static void dispatch_queued_ios(struct multipath *m)
int r;
unsigned long flags;
struct bio *bio = NULL, *next;
struct mpath_io *mpio;
struct dm_mpath_io *mpio;
union map_info *info;

spin_lock_irqsave(&m->lock, flags);
Expand Down Expand Up @@ -795,7 +795,7 @@ static int multipath_map(struct dm_target *ti, struct bio *bio,
union map_info *map_context)
{
int r;
struct mpath_io *mpio;
struct dm_mpath_io *mpio;
struct multipath *m = (struct multipath *) ti->private;

if (bio_barrier(bio))
Expand Down Expand Up @@ -1014,7 +1014,7 @@ void dm_pg_init_complete(struct dm_path *path, unsigned err_flags)
* end_io handling
*/
static int do_end_io(struct multipath *m, struct bio *bio,
int error, struct mpath_io *mpio)
int error, struct dm_mpath_io *mpio)
{
struct hw_handler *hwh = &m->hw_handler;
unsigned err_flags = MP_FAIL_PATH; /* Default behavior */
Expand Down Expand Up @@ -1075,8 +1075,8 @@ static int do_end_io(struct multipath *m, struct bio *bio,
static int multipath_end_io(struct dm_target *ti, struct bio *bio,
int error, union map_info *map_context)
{
struct multipath *m = (struct multipath *) ti->private;
struct mpath_io *mpio = (struct mpath_io *) map_context->ptr;
struct multipath *m = ti->private;
struct dm_mpath_io *mpio = map_context->ptr;
struct pgpath *pgpath = mpio->pgpath;
struct path_selector *ps;
int r;
Expand Down Expand Up @@ -1346,8 +1346,7 @@ static int __init dm_multipath_init(void)
int r;

/* allocate a slab for the dm_ios */
_mpio_cache = kmem_cache_create("dm_mpath", sizeof(struct mpath_io),
0, 0, NULL, NULL);
_mpio_cache = KMEM_CACHE(dm_mpath_io, 0);
if (!_mpio_cache)
return -ENOMEM;

Expand Down
Loading

0 comments on commit 2e23265

Please sign in to comment.