Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5e4c3d7 authored by David Sterba's avatar David Sterba
Browse files

btrfs: sink gfp parameter to btrfs_io_bio_alloc



We can hardcode GFP_NOFS to btrfs_io_bio_alloc, although it means we
change it back from GFP_KERNEL in scrub. I'd rather save a few stack
bytes from not passing the gfp flags in the remaining, more imporatant,
contexts and the bio allocating API now looks more consistent.

Reviewed-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 184f999e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1638,7 +1638,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
		struct bio *bio;
		unsigned int j;

		bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i);
		bio = btrfs_io_bio_alloc(num_pages - i);
		bio->bi_bdev = block_ctx->dev->bdev;
		bio->bi_iter.bi_sector = dev_bytenr >> 9;
		bio_set_op_attrs(bio, REQ_OP_READ, 0);
+1 −1
Original line number Diff line number Diff line
@@ -3532,7 +3532,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait)
	 * caller
	 */
	device->flush_bio = NULL;
	bio = btrfs_io_bio_alloc(GFP_NOFS, 0);
	bio = btrfs_io_bio_alloc(0);
	bio->bi_end_io = btrfs_end_empty_barrier;
	bio->bi_bdev = device->bdev;
	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
+4 −4
Original line number Diff line number Diff line
@@ -1987,7 +1987,7 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start,
	ASSERT(!(fs_info->sb->s_flags & MS_RDONLY));
	BUG_ON(!mirror_num);

	bio = btrfs_io_bio_alloc(GFP_NOFS, 1);
	bio = btrfs_io_bio_alloc(1);
	bio->bi_iter.bi_size = 0;
	map_length = length;

@@ -2331,7 +2331,7 @@ struct bio *btrfs_create_repair_bio(struct inode *inode, struct bio *failed_bio,
	struct btrfs_io_bio *btrfs_failed_bio;
	struct btrfs_io_bio *btrfs_bio;

	bio = btrfs_io_bio_alloc(GFP_NOFS, 1);
	bio = btrfs_io_bio_alloc(1);
	bio->bi_end_io = endio_func;
	bio->bi_iter.bi_sector = failrec->logical >> 9;
	bio->bi_bdev = fs_info->fs_devices->latest_bdev;
@@ -2692,12 +2692,12 @@ struct bio *btrfs_bio_clone(struct bio *bio)
	return new;
}

struct bio *btrfs_io_bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs)
struct bio *btrfs_io_bio_alloc(unsigned int nr_iovecs)
{
	struct bio *bio;

	/* Bio allocation backed by a bioset does not fail */
	bio = bio_alloc_bioset(gfp_mask, nr_iovecs, btrfs_bioset);
	bio = bio_alloc_bioset(GFP_NOFS, nr_iovecs, btrfs_bioset);
	btrfs_io_bio_init(btrfs_io_bio(bio));
	return bio;
}
+1 −1
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ void extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
				 unsigned bits_to_clear,
				 unsigned long page_ops);
struct bio *btrfs_bio_alloc(struct block_device *bdev, u64 first_byte);
struct bio *btrfs_io_bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs);
struct bio *btrfs_io_bio_alloc(unsigned int nr_iovecs);
struct bio *btrfs_bio_clone(struct bio *bio);
struct bio *btrfs_bio_clone_partial(struct bio *orig, int offset, int size);

+1 −1
Original line number Diff line number Diff line
@@ -1098,7 +1098,7 @@ 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);
	bio = btrfs_io_bio_alloc(bio_max_len >> PAGE_SHIFT ?: 1);
	bio->bi_iter.bi_size = 0;
	bio->bi_bdev = stripe->dev->bdev;
	bio->bi_iter.bi_sector = disk_start >> 9;
Loading