Rename pending There are two structures that have "pending" field. This patch renames it to "cc_pending" and "io_pending" to reduce confusion and ease searching the code. Signed-off-by: Mikulas Patocka --- drivers/md/dm-crypt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) Index: linux-3.2-fast/drivers/md/dm-crypt.c =================================================================== --- linux-3.2-fast.orig/drivers/md/dm-crypt.c 2012-01-24 03:28:12.000000000 +0100 +++ linux-3.2-fast/drivers/md/dm-crypt.c 2012-01-25 03:48:13.000000000 +0100 @@ -43,7 +43,7 @@ struct convert_context { unsigned int idx_in; unsigned int idx_out; sector_t sector; - atomic_t pending; + atomic_t cc_pending; }; /* @@ -56,7 +56,7 @@ struct dm_crypt_io { struct convert_context ctx; - atomic_t pending; + atomic_t io_pending; int error; sector_t sector; struct dm_crypt_io *base_io; @@ -770,14 +770,14 @@ static int crypt_convert(struct crypt_co struct crypt_cpu *this_cc = this_crypt_config(cc); int r; - atomic_set(&ctx->pending, 1); + atomic_set(&ctx->cc_pending, 1); while(ctx->idx_in < ctx->bio_in->bi_vcnt && ctx->idx_out < ctx->bio_out->bi_vcnt) { crypt_alloc_req(cc, ctx); - atomic_inc(&ctx->pending); + atomic_inc(&ctx->cc_pending); r = crypt_convert_block(cc, ctx, this_cc->req); @@ -794,14 +794,14 @@ static int crypt_convert(struct crypt_co /* sync */ case 0: - atomic_dec(&ctx->pending); + atomic_dec(&ctx->cc_pending); ctx->sector++; cond_resched(); continue; /* error */ default: - atomic_dec(&ctx->pending); + atomic_dec(&ctx->cc_pending); return r; } } @@ -897,14 +897,14 @@ static struct dm_crypt_io *crypt_io_allo io->sector = sector; io->error = 0; io->base_io = NULL; - atomic_set(&io->pending, 0); + atomic_set(&io->io_pending, 0); return io; } static void crypt_inc_pending(struct dm_crypt_io *io) { - atomic_inc(&io->pending); + atomic_inc(&io->io_pending); } /* @@ -919,7 +919,7 @@ static void crypt_dec_pending(struct dm_ struct dm_crypt_io *base_io = io->base_io; int error = io->error; - if (!atomic_dec_and_test(&io->pending)) + if (!atomic_dec_and_test(&io->io_pending)) return; mempool_free(io, cc->io_pool); @@ -1106,7 +1106,7 @@ static void kcryptd_crypt_write_convert( r = crypt_convert(cc, &io->ctx); if (r < 0) io->error = -EIO; - crypt_finished = atomic_dec_and_test(&io->ctx.pending); + crypt_finished = atomic_dec_and_test(&io->ctx.cc_pending); /* Encryption was already finished, submit io now */ if (crypt_finished) { @@ -1181,7 +1181,7 @@ static void kcryptd_crypt_read_convert(s if (r < 0) io->error = -EIO; - if (atomic_dec_and_test(&io->ctx.pending)) + if (atomic_dec_and_test(&io->ctx.cc_pending)) kcryptd_crypt_read_done(io); crypt_dec_pending(io); @@ -1208,7 +1208,7 @@ static void kcryptd_async_done(struct cr mempool_free(req_of_dmreq(cc, dmreq), cc->req_pool); - if (!atomic_dec_and_test(&ctx->pending)) + if (!atomic_dec_and_test(&ctx->cc_pending)) return; if (bio_data_dir(io->base_bio) == READ)