Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110632
b: refs/heads/master
c: dc440d1
h: refs/heads/master
v: v3
  • Loading branch information
Milan Broz authored and Alasdair G Kergon committed Oct 10, 2008
1 parent 22d8c0c commit b2eef46
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 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: 3e1a8bdd05d6b1734a8ccf7af28042d72c447780
refs/heads/master: dc440d1e56c481f80d5350daadc7d078a04ca729
24 changes: 17 additions & 7 deletions trunk/drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,22 @@ static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone)
}
}

static struct dm_crypt_io *crypt_io_alloc(struct dm_target *ti,
struct bio *bio, sector_t sector)
{
struct crypt_config *cc = ti->private;
struct dm_crypt_io *io;

io = mempool_alloc(cc->io_pool, GFP_NOIO);
io->target = ti;
io->base_bio = bio;
io->sector = sector;
io->error = 0;
atomic_set(&io->pending, 0);

return io;
}

static void crypt_inc_pending(struct dm_crypt_io *io)
{
atomic_inc(&io->pending);
Expand Down Expand Up @@ -1113,15 +1129,9 @@ static void crypt_dtr(struct dm_target *ti)
static int crypt_map(struct dm_target *ti, struct bio *bio,
union map_info *map_context)
{
struct crypt_config *cc = ti->private;
struct dm_crypt_io *io;

io = mempool_alloc(cc->io_pool, GFP_NOIO);
io->target = ti;
io->base_bio = bio;
io->sector = bio->bi_sector - ti->begin;
io->error = 0;
atomic_set(&io->pending, 0);
io = crypt_io_alloc(ti, bio, bio->bi_sector - ti->begin);

if (bio_data_dir(io->base_bio) == READ)
kcryptd_queue_io(io);
Expand Down

0 comments on commit b2eef46

Please sign in to comment.