提交 84131db6 编写于 作者: M Milan Broz 提交者: Alasdair G Kergon

dm crypt: introduce crypt_write_io_loop

Introduce crypt_write_io_loop().
Signed-off-by: NMilan Broz <mbroz@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 dec1cedf
...@@ -595,17 +595,13 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io, int error) ...@@ -595,17 +595,13 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io, int error)
io->sector += bio_sectors(clone); io->sector += bio_sectors(clone);
} }
static void kcryptd_crypt_write_convert(struct dm_crypt_io *io) static void kcryptd_crypt_write_convert_loop(struct dm_crypt_io *io)
{ {
struct crypt_config *cc = io->target->private; struct crypt_config *cc = io->target->private;
struct bio *clone; struct bio *clone;
unsigned remaining = io->base_bio->bi_size; unsigned remaining = io->base_bio->bi_size;
int r; int r;
atomic_inc(&io->pending);
crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, io->sector);
/* /*
* The allocated buffers can be smaller than the whole bio, * The allocated buffers can be smaller than the whole bio,
* so repeat the whole process until all the data can be handled. * so repeat the whole process until all the data can be handled.
...@@ -645,6 +641,16 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io) ...@@ -645,6 +641,16 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
} }
} }
static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
{
struct crypt_config *cc = io->target->private;
atomic_inc(&io->pending);
crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, io->sector);
kcryptd_crypt_write_convert_loop(io);
}
static void kcryptd_crypt_read_done(struct dm_crypt_io *io, int error) static void kcryptd_crypt_read_done(struct dm_crypt_io *io, int error)
{ {
if (unlikely(error < 0)) if (unlikely(error < 0))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册