From 24c4213148593d003d7ddde2d3a3877f9494a190 Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Fri, 9 May 2014 17:03:16 -0400 Subject: [RHEL6.6 PATCH 10/11] dm crypt: rename struct convert_context sector field BZ: 1076147 Upstream commit 2dc5327d ("dm crypt: add post iv call to iv generator") wasn't ported to RHEL6 so additional changes were needed to rename all 'sector' to 'cc_sector' Upstream commit c66029f4d4226452e9a7f468650aa1d553525b81 Author: Mikulas Patocka Date: Fri Jul 27 15:08:05 2012 +0100 dm crypt: rename struct convert_context sector field Rename sector to cc_sector in dm-crypt's convert_context struct. This is preparation for a future patch that merges dm_io and convert_context which both have a "sector" field. Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- drivers/md/dm-crypt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Index: rhel6-compile/drivers/md/dm-crypt.c =================================================================== --- rhel6-compile.orig/drivers/md/dm-crypt.c 2014-05-10 16:55:15.000000000 +0200 +++ rhel6-compile/drivers/md/dm-crypt.c 2014-05-10 16:55:17.000000000 +0200 @@ -39,7 +39,7 @@ struct convert_context { unsigned int offset_out; unsigned int idx_in; unsigned int idx_out; - sector_t sector; + sector_t cc_sector; atomic_t cc_pending; }; @@ -471,7 +471,7 @@ static void crypt_convert_init(struct cr ctx->offset_out = 0; ctx->idx_in = bio_in ? bio_in->bi_idx : 0; ctx->idx_out = bio_out ? bio_out->bi_idx : 0; - ctx->sector = sector + cc->iv_offset; + ctx->cc_sector = sector + cc->iv_offset; init_completion(&ctx->restart); } @@ -507,7 +507,7 @@ static int crypt_convert_block(struct cr dmreq = dmreq_of_req(cc, req); iv = iv_of_dmreq(cc, dmreq); - dmreq->iv_sector = ctx->sector; + dmreq->iv_sector = ctx->cc_sector; dmreq->ctx = ctx; sg_init_table(&dmreq->sg_in, 1); sg_set_page(&dmreq->sg_in, bv_in->bv_page, 1 << SECTOR_SHIFT, @@ -556,7 +556,7 @@ static void crypt_alloc_req(struct crypt struct convert_context *ctx) { struct crypt_cpu *this_cc = this_crypt_config(cc); - unsigned key_index = ctx->sector & (cc->tfms_count - 1); + unsigned key_index = ctx->cc_sector & (cc->tfms_count - 1); if (!this_cc->req) this_cc->req = mempool_alloc(cc->req_pool, GFP_NOIO); @@ -595,13 +595,13 @@ static int crypt_convert(struct crypt_co /* fall through*/ case -EINPROGRESS: this_cc->req = NULL; - ctx->sector++; + ctx->cc_sector++; continue; /* sync */ case 0: atomic_dec(&ctx->cc_pending); - ctx->sector++; + ctx->cc_sector++; cond_resched(); continue;