Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1336026

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

From "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>
Newsgroups linux.kernel
Subject RE: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec
Date 2016-02-17 04:10 +0100
Message-ID <r30F4-d2-5@gated-at.bofh.it> (permalink)
References <r2lse-64X-5@gated-at.bofh.it> <r2lse-64X-3@gated-at.bofh.it> <r2mHF-6N6-21@gated-at.bofh.it> <r2nX5-7yQ-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> -----Original Message-----
> From: linux-block-owner@vger.kernel.org [mailto:linux-block-
> owner@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
...
> diff --git a/include/linux/bio.h b/include/linux/bio.h
...
>  static inline void bio_get_last_bvec(struct bio *bio, struct bio_vec *bv)
>  {
> -	struct bvec_iter iter;
> +	struct bvec_iter iter = bio->bi_iter;
> +	int idx;
> +
> +	bio_advance_iter(bio, &iter, iter.bi_size);
> +
> +	WARN_ON(!iter.bi_idx && !iter.bi_bvec_done);

If this ever did trigger, I don't think you'd want it for every bio
with a problem.  WARN_ONCE would be safer.

---
Robert Elliott, HPE Persistent Memory

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec Ming Lei <ming.lei@canonical.com> - 2016-02-15 08:10 +0100
  Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last  bvec Sagi Grimberg <sagig@dev.mellanox.co.il> - 2016-02-15 09:30 +0100
    Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and  last bvec Ming Lei <ming.lei@canonical.com> - 2016-02-15 10:50 +0100
      Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last  bvec Sagi Grimberg <sagig@dev.mellanox.co.il> - 2016-02-15 21:10 +0100
        Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec Ming Lei <ming.lei@canonical.com> - 2016-02-16 14:10 +0100
      RE: [PATCH 1/4] block: bio: introduce helpers to get the 1st and  last bvec "Elliott, Robert (Persistent Memory)" <elliott@hpe.com> - 2016-02-17 04:10 +0100
      Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and  last bvec Kent Overstreet <kent.overstreet@gmail.com> - 2016-02-18 05:30 +0100
        Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec Ming Lei <ming.lei@canonical.com> - 2016-02-18 07:20 +0100
          Re: [PATCH 1/4] block: bio: introduce helpers to get the 1st and last bvec Ming Lei <ming.lei@canonical.com> - 2016-02-19 02:50 +0100

csiph-web