aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2012-07-27 10:08:05 -0400
committerAlasdair G Kergon <agk@redhat.com>2012-07-27 10:08:05 -0400
commitc66029f4d4226452e9a7f468650aa1d553525b81 (patch)
tree6a84fca27904c2a41a6d61f9784bb78739608b8a /drivers/md
parent49a8a9204bb17296725058bbc7f31092d256be6e (diff)
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 <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-crypt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 8298eaee2c5a..330f1eaedc42 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -42,7 +42,7 @@ struct convert_context {
42 unsigned int offset_out; 42 unsigned int offset_out;
43 unsigned int idx_in; 43 unsigned int idx_in;
44 unsigned int idx_out; 44 unsigned int idx_out;
45 sector_t sector; 45 sector_t cc_sector;
46 atomic_t cc_pending; 46 atomic_t cc_pending;
47}; 47};
48 48
@@ -654,7 +654,7 @@ static void crypt_convert_init(struct crypt_config *cc,
654 ctx->offset_out = 0; 654 ctx->offset_out = 0;
655 ctx->idx_in = bio_in ? bio_in->bi_idx : 0; 655 ctx->idx_in = bio_in ? bio_in->bi_idx : 0;
656 ctx->idx_out = bio_out ? bio_out->bi_idx : 0; 656 ctx->idx_out = bio_out ? bio_out->bi_idx : 0;
657 ctx->sector = sector + cc->iv_offset; 657 ctx->cc_sector = sector + cc->iv_offset;
658 init_completion(&ctx->restart); 658 init_completion(&ctx->restart);
659} 659}
660 660
@@ -690,7 +690,7 @@ static int crypt_convert_block(struct crypt_config *cc,
690 dmreq = dmreq_of_req(cc, req); 690 dmreq = dmreq_of_req(cc, req);
691 iv = iv_of_dmreq(cc, dmreq); 691 iv = iv_of_dmreq(cc, dmreq);
692 692
693 dmreq->iv_sector = ctx->sector; 693 dmreq->iv_sector = ctx->cc_sector;
694 dmreq->ctx = ctx; 694 dmreq->ctx = ctx;
695 sg_init_table(&dmreq->sg_in, 1); 695 sg_init_table(&dmreq->sg_in, 1);
696 sg_set_page(&dmreq->sg_in, bv_in->bv_page, 1 << SECTOR_SHIFT, 696 sg_set_page(&dmreq->sg_in, bv_in->bv_page, 1 << SECTOR_SHIFT,
@@ -739,7 +739,7 @@ static void crypt_alloc_req(struct crypt_config *cc,
739 struct convert_context *ctx) 739 struct convert_context *ctx)
740{ 740{
741 struct crypt_cpu *this_cc = this_crypt_config(cc); 741 struct crypt_cpu *this_cc = this_crypt_config(cc);
742 unsigned key_index = ctx->sector & (cc->tfms_count - 1); 742 unsigned key_index = ctx->cc_sector & (cc->tfms_count - 1);
743 743
744 if (!this_cc->req) 744 if (!this_cc->req)
745 this_cc->req = mempool_alloc(cc->req_pool, GFP_NOIO); 745 this_cc->req = mempool_alloc(cc->req_pool, GFP_NOIO);
@@ -778,13 +778,13 @@ static int crypt_convert(struct crypt_config *cc,
778 /* fall through*/ 778 /* fall through*/
779 case -EINPROGRESS: 779 case -EINPROGRESS:
780 this_cc->req = NULL; 780 this_cc->req = NULL;
781 ctx->sector++; 781 ctx->cc_sector++;
782 continue; 782 continue;
783 783
784 /* sync */ 784 /* sync */
785 case 0: 785 case 0:
786 atomic_dec(&ctx->cc_pending); 786 atomic_dec(&ctx->cc_pending);
787 ctx->sector++; 787 ctx->cc_sector++;
788 cond_resched(); 788 cond_resched();
789 continue; 789 continue;
790 790