diff options
author | David Sterba <dsterba@suse.com> | 2017-06-02 17:38:30 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 18:26:02 +0200 |
commit | e4f56903863c793bc1d181f7f0b6244ea5753338 (patch) | |
tree | 2285ab71b116b5b987df487e191b9fa969ad7ee5 /fs | |
parent | 3aa8e074ab2ec507b7380dd5d460fea83d92b66b (diff) | |
download | linux-stable-e4f56903863c793bc1d181f7f0b6244ea5753338.tar.gz linux-stable-e4f56903863c793bc1d181f7f0b6244ea5753338.tar.bz2 linux-stable-e4f56903863c793bc1d181f7f0b6244ea5753338.zip |
btrfs: btrfs_io_bio_alloc never fails, skip error handling
Update direct callers of btrfs_io_bio_alloc that do error handling, that
we can now remove.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/check-integrity.c | 5 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 3 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 5 | ||||
-rw-r--r-- | fs/btrfs/raid56.c | 3 | ||||
-rw-r--r-- | fs/btrfs/scrub.c | 25 |
5 files changed, 0 insertions, 41 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 5f8006e4de9d..160879c802d0 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -1639,11 +1639,6 @@ static int btrfsic_read_block(struct btrfsic_state *state, unsigned int j; bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i); - if (!bio) { - pr_info("btrfsic: bio_alloc() for %u pages failed!\n", - num_pages - i); - return -1; - } bio->bi_bdev = block_ctx->dev->bdev; bio->bi_iter.bi_sector = dev_bytenr >> 9; bio_set_op_attrs(bio, REQ_OP_READ, 0); diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index cb79bce3a972..9f2ffe2c6afb 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3533,9 +3533,6 @@ static int write_dev_flush(struct btrfs_device *device, int wait) */ device->flush_bio = NULL; bio = btrfs_io_bio_alloc(GFP_NOFS, 0); - if (!bio) - return -ENOMEM; - bio->bi_end_io = btrfs_end_empty_barrier; bio->bi_bdev = device->bdev; bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH; diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e15bd02e534f..bfcbe8f2818b 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1988,8 +1988,6 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start, BUG_ON(!mirror_num); bio = btrfs_io_bio_alloc(GFP_NOFS, 1); - if (!bio) - return -EIO; bio->bi_iter.bi_size = 0; map_length = length; @@ -2334,9 +2332,6 @@ struct bio *btrfs_create_repair_bio(struct inode *inode, struct bio *failed_bio, struct btrfs_io_bio *btrfs_bio; bio = btrfs_io_bio_alloc(GFP_NOFS, 1); - if (!bio) - return NULL; - bio->bi_end_io = endio_func; bio->bi_iter.bi_sector = failrec->logical >> 9; bio->bi_bdev = fs_info->fs_devices->latest_bdev; diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index d68af3c61b49..7dd55448ac68 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1099,9 +1099,6 @@ static int rbio_add_io_page(struct btrfs_raid_bio *rbio, /* put a new bio on the list */ bio = btrfs_io_bio_alloc(GFP_NOFS, bio_max_len >> PAGE_SHIFT?:1); - if (!bio) - return -ENOMEM; - bio->bi_iter.bi_size = 0; bio->bi_bdev = stripe->dev->bdev; bio->bi_iter.bi_sector = disk_start >> 9; diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 096e503e3ddc..1e2dfea00b2f 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1738,11 +1738,6 @@ static void scrub_recheck_block(struct btrfs_fs_info *fs_info, WARN_ON(!page->page); bio = btrfs_io_bio_alloc(GFP_NOFS, 1); - if (!bio) { - page->io_error = 1; - sblock->no_io_error_seen = 0; - continue; - } bio->bi_bdev = page->dev->bdev; bio_add_page(bio, page->page, PAGE_SIZE, 0); @@ -1831,8 +1826,6 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, } bio = btrfs_io_bio_alloc(GFP_NOFS, 1); - if (!bio) - return -EIO; bio->bi_bdev = page_bad->dev->bdev; bio->bi_iter.bi_sector = page_bad->physical >> 9; bio_set_op_attrs(bio, REQ_OP_WRITE, 0); @@ -1924,10 +1917,6 @@ again: if (!bio) { bio = btrfs_io_bio_alloc(GFP_KERNEL, sctx->pages_per_wr_bio); - if (!bio) { - mutex_unlock(&sctx->wr_lock); - return -ENOMEM; - } sbio->bio = bio; } @@ -2329,8 +2318,6 @@ again: if (!bio) { bio = btrfs_io_bio_alloc(GFP_KERNEL, sctx->pages_per_rd_bio); - if (!bio) - return -ENOMEM; sbio->bio = bio; } @@ -2457,9 +2444,6 @@ static void scrub_missing_raid56_pages(struct scrub_block *sblock) } bio = btrfs_io_bio_alloc(GFP_NOFS, 0); - if (!bio) - goto bbio_out; - bio->bi_iter.bi_sector = logical >> 9; bio->bi_private = sblock; bio->bi_end_io = scrub_missing_raid56_end_io; @@ -3036,9 +3020,6 @@ static void scrub_parity_check_and_repair(struct scrub_parity *sparity) goto bbio_out; bio = btrfs_io_bio_alloc(GFP_NOFS, 0); - if (!bio) - goto bbio_out; - bio->bi_iter.bi_sector = sparity->logic_start >> 9; bio->bi_private = sparity; bio->bi_end_io = scrub_parity_bio_endio; @@ -4646,12 +4627,6 @@ static int write_page_nocow(struct scrub_ctx *sctx, return -EIO; } bio = btrfs_io_bio_alloc(GFP_NOFS, 1); - if (!bio) { - spin_lock(&sctx->stat_lock); - sctx->stat.malloc_errors++; - spin_unlock(&sctx->stat_lock); - return -ENOMEM; - } bio->bi_iter.bi_size = 0; bio->bi_iter.bi_sector = physical_for_dev_replace >> 9; bio->bi_bdev = dev->bdev; |