lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Aug 2017 05:16:12 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Ming Lei <ming.lei@...hat.com>
Cc:     Jens Axboe <axboe@...com>, Christoph Hellwig <hch@...radead.org>,
        Huang Ying <ying.huang@...el.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3 37/49] fs/mpage: convert to
 bio_for_each_segment_all_sp()

>  	struct bio_vec *bv;
> +	struct bvec_iter_all bia;
>  	int i;
>  
> -	bio_for_each_segment_all(bv, bio, i) {
> +	bio_for_each_segment_all_sp(bv, bio, i, bia) {
>  		struct page *page = bv->bv_page;
>  		page_endio(page, op_is_write(bio_op(bio)),
>  				blk_status_to_errno(bio->bi_status));

Hmm.  Going back to my previous comment about implementing the single
page variants on top of multipage - I wonder if we should simply
do that in the callers, e.g. something like:

	bio_for_each_segment_all(bv, bio, i) {
		bvec_for_each_page(page, bv, j) {
			page_endio(page, op_is_write(bio_op(bio)),
				blk_status_to_errno(bio->bi_status));
		}
	}

with additional helpers to get the length and offset for the page, e.g.

bvec_page_offset(bv, idx)
bvev_page_len(bv, idx)

While this is a little more code in the callers it's a lot easier to
understand.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ