Skip to content

Commit

Permalink
dm crypt: remove inc_pending from write_io_submit
Browse files Browse the repository at this point in the history
Make the caller reponsible for incrementing the pending count before calling
kcryptd_crypt_write_io_submit() in the non-async case to bring it into line
with the async case.

Signed-off-by: Alasdair G Kergon <[email protected]>
  • Loading branch information
kergon committed Oct 10, 2008
1 parent fc5a5e9 commit 1e37bb8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,8 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io,

if (async)
kcryptd_queue_io(io);
else {
crypt_inc_pending(io);
else
generic_make_request(clone);
}
}

static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
Expand Down Expand Up @@ -724,9 +722,12 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)

if (atomic_dec_and_test(&io->ctx.pending)) {
/* processed, no running async crypto */
crypt_inc_pending(io);
kcryptd_crypt_write_io_submit(io, r, 0);
if (unlikely(r < 0))
if (unlikely(r < 0)) {
crypt_dec_pending(io);
break;
}
} else
crypt_inc_pending(io);

Expand Down

0 comments on commit 1e37bb8

Please sign in to comment.