Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110633
b: refs/heads/master
c: fc5a5e9
h: refs/heads/master
i:
  110631: 22d8c0c
v: v3
  • Loading branch information
Milan Broz authored and Alasdair G Kergon committed Oct 10, 2008
1 parent b2eef46 commit dec0327
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 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: dc440d1e56c481f80d5350daadc7d078a04ca729
refs/heads/master: fc5a5e9aa878f86642c962b309f793fb2db0727e
25 changes: 9 additions & 16 deletions trunk/drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,19 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io,
}
}

static void kcryptd_crypt_write_convert_loop(struct dm_crypt_io *io)
static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
{
struct crypt_config *cc = io->target->private;
struct bio *clone;
unsigned remaining = io->base_bio->bi_size;
int r;

/*
* Prevent io from disappearing until this function completes.
*/
crypt_inc_pending(io);
crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, io->sector);

/*
* The allocated buffers can be smaller than the whole bio,
* so repeat the whole process until all the data can be handled.
Expand All @@ -706,7 +712,7 @@ static void kcryptd_crypt_write_convert_loop(struct dm_crypt_io *io)
clone = crypt_alloc_buffer(io, remaining);
if (unlikely(!clone)) {
io->error = -ENOMEM;
return;
break;
}

io->ctx.bio_out = clone;
Expand All @@ -720,7 +726,7 @@ static void kcryptd_crypt_write_convert_loop(struct dm_crypt_io *io)
/* processed, no running async crypto */
kcryptd_crypt_write_io_submit(io, r, 0);
if (unlikely(r < 0))
return;
break;
} else
crypt_inc_pending(io);

Expand All @@ -732,19 +738,6 @@ static void kcryptd_crypt_write_convert_loop(struct dm_crypt_io *io)
congestion_wait(WRITE, HZ/100);
}
}
}

static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
{
struct crypt_config *cc = io->target->private;

/*
* Prevent io from disappearing until this function completes.
*/
crypt_inc_pending(io);

crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, io->sector);
kcryptd_crypt_write_convert_loop(io);

crypt_dec_pending(io);
}
Expand Down

0 comments on commit dec0327

Please sign in to comment.