Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-18 Thread Ming Lei
Hi Guys, On Thu, Feb 18, 2016 at 2:16 PM, Ming Lei wrote: > Hi Kent, > > Thanks for your review. > > On Thu, Feb 18, 2016 at 12:24 PM, Kent Overstreet > wrote: >> On Mon, Feb 15, 2016 at 05:42:12PM +0800, Ming Lei wrote: >>> Cc Kent and Keith. >>> >>> Follows another version which should be more

Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-17 Thread Ming Lei
Hi Kent, Thanks for your review. On Thu, Feb 18, 2016 at 12:24 PM, Kent Overstreet wrote: > On Mon, Feb 15, 2016 at 05:42:12PM +0800, Ming Lei wrote: >> Cc Kent and Keith. >> >> Follows another version which should be more efficient. >> Kent and Keith, I appreciate much if you may give a review

Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-17 Thread Kent Overstreet
On Mon, Feb 15, 2016 at 05:42:12PM +0800, Ming Lei wrote: > Cc Kent and Keith. > > Follows another version which should be more efficient. > Kent and Keith, I appreciate much if you may give a review on it. > > diff --git a/include/linux/bio.h b/include/linux/bio.h > index 56d2db8..ef45fec 100644

RE: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-16 Thread Elliott, Robert (Persistent Memory)
> -Original Message- > From: linux-block-ow...@vger.kernel.org [mailto:linux-block- > ow...@vger.kernel.org] On Behalf Of Ming Lei > Sent: Monday, February 15, 2016 3:42 AM > Subject: Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and > last bvec ... >

Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-16 Thread Ming Lei
On Tue, Feb 16, 2016 at 4:06 AM, Sagi Grimberg wrote: > >> Cc Kent and Keith. >> >> Follows another version which should be more efficient. >> Kent and Keith, I appreciate much if you may give a review on it. >> >> diff --git a/include/linux/bio.h b/include/linux/bio.h >> index 56d2db8..ef45fec 10

Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-15 Thread Sagi Grimberg
Cc Kent and Keith. Follows another version which should be more efficient. Kent and Keith, I appreciate much if you may give a review on it. diff --git a/include/linux/bio.h b/include/linux/bio.h index 56d2db8..ef45fec 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -278,11 +278,

Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-15 Thread Ming Lei
Hi, On Mon, 15 Feb 2016 10:19:49 +0200 Sagi Grimberg wrote: > > > +/* > > + * bio_get_last_bvec() is introduced to get the last bvec of one > > + * bio for bio_will_gap(). > > + * > > + * TODO: make it more efficient. > > + */ > > +static inline void bio_get_last_bvec(struct bio *bio, struct b

Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-15 Thread Sagi Grimberg
+/* + * bio_get_last_bvec() is introduced to get the last bvec of one + * bio for bio_will_gap(). + * + * TODO: make it more efficient. + */ +static inline void bio_get_last_bvec(struct bio *bio, struct bio_vec *bv) +{ + struct bvec_iter iter; + + bio_for_each_segment(*bv, bio, iter)

[PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec

2016-02-14 Thread Ming Lei
After bio splitting is introduced, the splitted bio can be fast-cloned, which is correct because biovecs has become immutable since v3.13. Unfortunately bio_will_gap() isn't ready for this kind of change, because it figures out the last bvec via 'bi_io_vec[prev->bi_vcnt - 1]'. This patch introduc