Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110631
b: refs/heads/master
c: 3e1a8bd
h: refs/heads/master
i:
  110629: 60a5597
  110627: 643842a
  110623: 564e61b
v: v3
  • Loading branch information
Milan Broz authored and Alasdair G Kergon committed Oct 10, 2008
1 parent bc2fde9 commit 22d8c0c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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: fd14acf6fc9f4635be201960004d847b14236a20
refs/heads/master: 3e1a8bdd05d6b1734a8ccf7af28042d72c447780
15 changes: 10 additions & 5 deletions trunk/drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@ static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone)
}
}

static void crypt_inc_pending(struct dm_crypt_io *io)
{
atomic_inc(&io->pending);
}

/*
* One of the bios was finished. Check for completion of
* the whole request and correctly clean up the buffer.
Expand Down Expand Up @@ -591,7 +596,7 @@ static void kcryptd_io_read(struct dm_crypt_io *io)
struct bio *base_bio = io->base_bio;
struct bio *clone;

atomic_inc(&io->pending);
crypt_inc_pending(io);

/*
* The block layer might modify the bvec array, so always
Expand Down Expand Up @@ -665,7 +670,7 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io,
if (async)
kcryptd_queue_io(io);
else {
atomic_inc(&io->pending);
crypt_inc_pending(io);
generic_make_request(clone);
}
}
Expand Down Expand Up @@ -701,7 +706,7 @@ static void kcryptd_crypt_write_convert_loop(struct dm_crypt_io *io)
if (unlikely(r < 0))
return;
} else
atomic_inc(&io->pending);
crypt_inc_pending(io);

/* out of memory -> run queues */
if (unlikely(remaining)) {
Expand All @@ -720,7 +725,7 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
/*
* Prevent io from disappearing until this function completes.
*/
atomic_inc(&io->pending);
crypt_inc_pending(io);

crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, io->sector);
kcryptd_crypt_write_convert_loop(io);
Expand All @@ -741,7 +746,7 @@ static void kcryptd_crypt_read_convert(struct dm_crypt_io *io)
struct crypt_config *cc = io->target->private;
int r = 0;

atomic_inc(&io->pending);
crypt_inc_pending(io);

crypt_convert_init(cc, &io->ctx, io->base_bio, io->base_bio,
io->sector);
Expand Down

0 comments on commit 22d8c0c

Please sign in to comment.