From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:37898 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbdHJLaF (ORCPT ); Thu, 10 Aug 2017 07:30:05 -0400 Date: Thu, 10 Aug 2017 04:29:59 -0700 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , Christoph Hellwig , Huang Ying , Andrew Morton , Alexander Viro , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org Subject: Re: [PATCH v3 11/49] btrfs: avoid access to .bi_vcnt directly Message-ID: <20170810112959.GG20308@infradead.org> References: <20170808084548.18963-1-ming.lei@redhat.com> <20170808084548.18963-12-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20170808084548.18963-12-ming.lei@redhat.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: > +static unsigned int get_bio_pages(struct bio *bio) > +{ > + unsigned i; > + struct bio_vec *bv; > + > + bio_for_each_segment_all(bv, bio, i) > + ; > + > + return i; > +} s/get_bio_pages/bio_nr_pages/ ? Also this seems like a useful helper for bio.h