Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208353
b: refs/heads/master
c: 18edc8e
h: refs/heads/master
i:
  208351: 847c1bf
v: v3
  • Loading branch information
Dmitry Monakhov authored and Jens Axboe committed Aug 8, 2010
1 parent 0e4c5f1 commit 657dc19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: 3383977fadc4027f20907f6208a9033cd043adab
refs/heads/master: 18edc8eaa68070771bdb2098260e44efe74de722
8 changes: 6 additions & 2 deletions trunk/block/blk-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static void bio_batch_end_io(struct bio *bio, int err)
int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask, unsigned long flags)
{
int ret = 0;
int ret;
struct bio *bio;
struct bio_batch bb;
unsigned int sz, issued = 0;
Expand All @@ -163,11 +163,14 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
return ret;
}
submit:
ret = 0;
while (nr_sects != 0) {
bio = bio_alloc(gfp_mask,
min(nr_sects, (sector_t)BIO_MAX_PAGES));
if (!bio)
if (!bio) {
ret = -ENOMEM;
break;
}

bio->bi_sector = sector;
bio->bi_bdev = bdev;
Expand All @@ -186,6 +189,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
if (ret < (sz << 9))
break;
}
ret = 0;
issued++;
submit_bio(WRITE, bio);
}
Expand Down

0 comments on commit 657dc19

Please sign in to comment.