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

2017-05-16 Thread Liu Bo
On Tue, May 16, 2017 at 07:37:37AM -0700, Christoph Hellwig wrote: > > } > > > > +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) {

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

2017-05-16 Thread Christoph Hellwig
> } > > +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

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

2017-05-11 Thread David Sterba
On Mon, Apr 17, 2017 at 06:16:23PM -0700, Liu Bo wrote: > Currently when mapping bio to limit bio to a single stripe length, we > split bio by adding page to bio one by one, but later we don't modify > the vector of bio at all, thus we can use bio_clone_fast to use the > original bio vector

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

2017-04-17 Thread Liu Bo
Currently when mapping bio to limit bio to a single stripe length, we split bio by adding page to bio one by one, but later we don't modify the vector of bio at all, thus we can use bio_clone_fast to use the original bio vector directly. Signed-off-by: Liu Bo ---