Re: [PATCH 2/6] Btrfs: use bio_clone_bioset_partial to simplify DIO submit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  }
>  
> +struct bio *btrfs_bio_clone_partial(struct bio *orig, gfp_t gfp_mask, int offset, int size)
> +{
> +	struct bio *bio;
> +
> +	bio = bio_clone_fast(orig, gfp_mask, btrfs_bioset);
> +	if (bio) {

bio_clone_fast will never fail when backed by a bioset, which this
one always is.  Also you always pass GFP_NPFS as the gfp_mask argument,
it might make sense to hardcode that here.

> +		struct btrfs_io_bio *btrfs_bio = btrfs_io_bio(bio);
> +		btrfs_bio->csum = NULL;
> +		btrfs_bio->csum_allocated = NULL;
> +		btrfs_bio->end_io = NULL;
> +
> +		bio_trim(bio, (offset >> 9), (size >> 9));

No need for the inner braces here.

Last but not least do you even need this as a separate helper?

> +struct bio *btrfs_bio_clone_partial(struct bio *orig, gfp_t gfp_mask, int offset, int size);

Over long line, please trim to 80 characters
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux