Re: [PATCH v3 37/49] fs/mpage: convert to bio_for_each_segment_all_sp()

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

 



On Thu, Aug 10, 2017 at 05:16:12AM -0700, Christoph Hellwig wrote:
> >  	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.

Actually this patch is only a rename and the helper's sematics isn't
changed, so it doesn't affect the readability or understandablity,
and it clarifies that the helper fetches one page each time.

Also, once multipage bvec is done, we can rename bio_for_each_segment_all_sp()
into bio_for_each_page_all(), and rename bio_for_each_segment_all_mp() into
bio_for_each_segment_all(), which should be much easier to understand.

-- 
Ming



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux