Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345675
b: refs/heads/master
c: 0cfbcaf
h: refs/heads/master
i:
  345673: cca6b78
  345671: 2547e21
v: v3
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Dec 14, 2012
1 parent 0b3d3aa commit 384953f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8dd2cb7e880d2f77fba53b523c99133ad5054cfd
refs/heads/master: 0cfbcafcae8b7364b5fa96c2b26ccde7a3a296a9
3 changes: 3 additions & 0 deletions trunk/block/blk-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
struct bio_batch bb;
struct bio *bio;
int ret = 0;
struct blk_plug plug;

if (!q)
return -ENXIO;
Expand Down Expand Up @@ -82,6 +83,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
bb.flags = 1 << BIO_UPTODATE;
bb.wait = &wait;

blk_start_plug(&plug);
while (nr_sects) {
unsigned int req_sects;
sector_t end_sect, tmp;
Expand Down Expand Up @@ -120,6 +122,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
atomic_inc(&bb.done);
submit_bio(type, bio);
}
blk_finish_plug(&plug);

/* Wait for bios in-flight */
if (!atomic_dec_and_test(&bb.done))
Expand Down

0 comments on commit 384953f

Please sign in to comment.