Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3197588imu; Fri, 23 Nov 2018 23:54:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/UaTGRV4J+g5hgh4z/uJQuL1bA8STw1TtbEihwgl6fb30/PmI0SZ4nGh6GR4/A5tYUu1SKc X-Received: by 2002:a17:902:44a:: with SMTP id 68-v6mr10714139ple.73.1543046041779; Fri, 23 Nov 2018 23:54:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543046041; cv=none; d=google.com; s=arc-20160816; b=L1S4Ie+F2rB2ePiYInQ7XZOOP1Wudx3mB6UfFoCoHyaBmxxqz78pn+Z5EOTTx++aEY EC+VnYHOgq30GHhZwn/bvI7D8zj9zePcxq5p7wgx31WSB73fiNCdWUYF/682kJiFYdwv q9KNtkxRBSJSKcqPvk8BrVhgH+8hLZmHhsSTm9Rx70UkPB0KpD4jD05AKt77RmRh8DkW oSFzjrcFj7cOw4EsVBSYKrebO4lXl1XmmcHoO6KMwrIoLIpGK9Komi+XuC4oqzbIs7VG DutCB1H5xAyy1X1+GBQQBXtGQ6SJuw6SKMfitLNRiu+es1fKgwh2++e/vylsdKZeXR1M 7NJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ungLJSJd9kVr0lyFctvd4iWNOggw6LZcKEtAGAcdCAY=; b=1FZbG70FcEs9JE41aEyA0AHwtrG32jkWjjRCDE4Ls0a4RmB1a4fXqUhzHPoK13ujQ2 CXQPD/Lpa9tKJujBW9GxYlHo8+4YjOzGpZEtKj6uJaIAj4z4XVrprSrHyj0H4St2u44N QlufrXeS6sNqgL77mI/m47b2D8di1nN3YmC4k+1k2qDm8mCwoTEwyozPhoLBbq+/0eZu gNWAxREfo4KvFt7pIQRe66ZotSrokwKudxxHsuuvrPmj14OJEsQGEf2lp4vzMo3Ztuf6 9JSXArYCQ9TdSlDD/OeMeW7kaqImfMGhbHTElcexp7mueq8R9WA6fVr2SYDYJ3dz3aOy Dpmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17-v6si14453149pfa.227.2018.11.23.23.53.47; Fri, 23 Nov 2018 23:54:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439433AbeKWNCO (ORCPT + 99 others); Fri, 23 Nov 2018 08:02:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46834 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbeKWNCN (ORCPT ); Fri, 23 Nov 2018 08:02:13 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1ABC19B308; Fri, 23 Nov 2018 02:20:00 +0000 (UTC) Received: from ming.t460p (ovpn-8-31.pek2.redhat.com [10.72.8.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D723560923; Fri, 23 Nov 2018 02:19:38 +0000 (UTC) Date: Fri, 23 Nov 2018 10:19:34 +0800 From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , Omar Sandoval , Sagi Grimberg , Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com Subject: Re: [PATCH V11 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec Message-ID: <20181123021933.GB20110@ming.t460p> References: <20181121032327.8434-1-ming.lei@redhat.com> <20181121032327.8434-13-ming.lei@redhat.com> <20181122110315.GA30369@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181122110315.GA30369@lst.de> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 23 Nov 2018 02:20:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 22, 2018 at 12:03:15PM +0100, Christoph Hellwig wrote: > > +/* used for chunk_for_each_segment */ > > +static inline void bvec_next_segment(const struct bio_vec *bvec, > > + struct bvec_iter_all *iter_all) > > FYI, chunk_for_each_segment doesn't exist anymore, this is > bvec_for_each_segment now. Not sure the comment helps much, though. OK, will remove the comment. > > > +{ > > + struct bio_vec *bv = &iter_all->bv; > > + > > + if (bv->bv_page) { > > + bv->bv_page += 1; > > I think this needs to use nth_page() given that with discontigmem > page structures might not be allocated contigously. Good catch! Thanks, Ming