Commit 3e1a8bdd05d6b1734a8ccf7af28042d72c447780
Committed by
Alasdair G Kergon
1 parent
fd14acf6fc
Exists in
master
and in
7 other branches
dm crypt: tidy inc pending
Move io pending to one place. No functional change, usefull to simplify debugging. Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Showing 1 changed file with 10 additions and 5 deletions Side-by-side Diff
drivers/md/dm-crypt.c
... | ... | @@ -517,6 +517,11 @@ |
517 | 517 | } |
518 | 518 | } |
519 | 519 | |
520 | +static void crypt_inc_pending(struct dm_crypt_io *io) | |
521 | +{ | |
522 | + atomic_inc(&io->pending); | |
523 | +} | |
524 | + | |
520 | 525 | /* |
521 | 526 | * One of the bios was finished. Check for completion of |
522 | 527 | * the whole request and correctly clean up the buffer. |
... | ... | @@ -591,7 +596,7 @@ |
591 | 596 | struct bio *base_bio = io->base_bio; |
592 | 597 | struct bio *clone; |
593 | 598 | |
594 | - atomic_inc(&io->pending); | |
599 | + crypt_inc_pending(io); | |
595 | 600 | |
596 | 601 | /* |
597 | 602 | * The block layer might modify the bvec array, so always |
... | ... | @@ -665,7 +670,7 @@ |
665 | 670 | if (async) |
666 | 671 | kcryptd_queue_io(io); |
667 | 672 | else { |
668 | - atomic_inc(&io->pending); | |
673 | + crypt_inc_pending(io); | |
669 | 674 | generic_make_request(clone); |
670 | 675 | } |
671 | 676 | } |
... | ... | @@ -701,7 +706,7 @@ |
701 | 706 | if (unlikely(r < 0)) |
702 | 707 | return; |
703 | 708 | } else |
704 | - atomic_inc(&io->pending); | |
709 | + crypt_inc_pending(io); | |
705 | 710 | |
706 | 711 | /* out of memory -> run queues */ |
707 | 712 | if (unlikely(remaining)) { |
... | ... | @@ -720,7 +725,7 @@ |
720 | 725 | /* |
721 | 726 | * Prevent io from disappearing until this function completes. |
722 | 727 | */ |
723 | - atomic_inc(&io->pending); | |
728 | + crypt_inc_pending(io); | |
724 | 729 | |
725 | 730 | crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, io->sector); |
726 | 731 | kcryptd_crypt_write_convert_loop(io); |
... | ... | @@ -741,7 +746,7 @@ |
741 | 746 | struct crypt_config *cc = io->target->private; |
742 | 747 | int r = 0; |
743 | 748 | |
744 | - atomic_inc(&io->pending); | |
749 | + crypt_inc_pending(io); | |
745 | 750 | |
746 | 751 | crypt_convert_init(cc, &io->ctx, io->base_bio, io->base_bio, |
747 | 752 | io->sector); |