Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104299
b: refs/heads/master
c: d41e26b
h: refs/heads/master
i:
  104297: 6005343
  104295: bae8f69
v: v3
  • Loading branch information
Milan Broz authored and Alasdair G Kergon committed Jul 21, 2008
1 parent dea60a7 commit ba7a974
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9980c638a666ecd88acaf0a7ab91043d4a3f44d1
refs/heads/master: d41e26b901111f4e540aa2c27ec7a1681c782be9
18 changes: 17 additions & 1 deletion trunk/drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,9 +1216,24 @@ static int crypt_message(struct dm_target *ti, unsigned argc, char **argv)
return -EINVAL;
}

static int crypt_merge(struct dm_target *ti, struct bvec_merge_data *bvm,
struct bio_vec *biovec, int max_size)
{
struct crypt_config *cc = ti->private;
struct request_queue *q = bdev_get_queue(cc->dev->bdev);

if (!q->merge_bvec_fn)
return max_size;

bvm->bi_bdev = cc->dev->bdev;
bvm->bi_sector = cc->start + bvm->bi_sector - ti->begin;

return min(max_size, q->merge_bvec_fn(q, bvm, biovec));
}

static struct target_type crypt_target = {
.name = "crypt",
.version= {1, 5, 0},
.version= {1, 6, 0},
.module = THIS_MODULE,
.ctr = crypt_ctr,
.dtr = crypt_dtr,
Expand All @@ -1228,6 +1243,7 @@ static struct target_type crypt_target = {
.preresume = crypt_preresume,
.resume = crypt_resume,
.message = crypt_message,
.merge = crypt_merge,
};

static int __init dm_crypt_init(void)
Expand Down

0 comments on commit ba7a974

Please sign in to comment.