From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EFD1C07E9B for ; Tue, 20 Jul 2021 06:50:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3F2E0610F7 for ; Tue, 20 Jul 2021 06:50:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F2E0610F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6EC406B00DA; Tue, 20 Jul 2021 02:50:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69EA46B00DC; Tue, 20 Jul 2021 02:50:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53B606B00DD; Tue, 20 Jul 2021 02:50:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 3407B6B00DA for ; Tue, 20 Jul 2021 02:50:33 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C2B95180C2E5C for ; Tue, 20 Jul 2021 06:50:31 +0000 (UTC) X-FDA: 78382042662.09.EBA9735 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 393B49005FC5 for ; Tue, 20 Jul 2021 06:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/4u42N+bgLyjyYnCcK7X5ppsglLctvCl+CPJXfYei58=; b=T6p9WRpsT2sceU6/eswXmmiyrW CHRIkEriIUZ1vJcy2tCpb3xiJmLamDhh2gY74DbDCGGuenm+kN8onjQDsvaVtU9PbqL0LWnIMBe54 eLDxHtinW6Q09BbFD4H8+xfG0K9cm/IAPLOI1yUfLMzM7p3q7BfH9bPEO3/9PDvLefn4knMSwDMbp Afn77CHYoEUkCBv9DyLG8Ml/V7Q5JOFgVpJQ+A4Z9BBWzU5a3SMA1AMzttltGgXIBK3t5qxi3DzV3 M6c+3UbHLbtHZtWkg7riZkwYTPwpoFljxFBKhWh9MsI+burOFIlKPJWy/iRtdugeglmKeLCu5+U26 2nj3Ht4A==; Received: from [2001:4bb8:193:7660:5612:5e3c:ba3d:2b3c] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5jY0-007q6H-Nl; Tue, 20 Jul 2021 06:48:15 +0000 Date: Tue, 20 Jul 2021 08:48:07 +0200 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org Subject: Re: [PATCH v15 02/17] block: Add bio_for_each_folio_all() Message-ID: References: <20210719184001.1750630-1-willy@infradead.org> <20210719184001.1750630-3-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210719184001.1750630-3-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 393B49005FC5 X-Stat-Signature: w9q67ggdskzx8rbairxt8bn1zizs9cb8 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=T6p9WRps; spf=none (imf29.hostedemail.com: domain of BATV@casper.srs.infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=BATV@casper.srs.infradead.org; dmarc=none X-HE-Tag: 1626763730-457884 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jul 19, 2021 at 07:39:46PM +0100, Matthew Wilcox (Oracle) wrote: > #define bio_for_each_bvec_all(bvl, bio, i) \ > for (i = 0, bvl = bio_first_bvec_all(bio); \ > - i < (bio)->bi_vcnt; i++, bvl++) \ > + i < (bio)->bi_vcnt; i++, bvl++) Pleae split out this unrelated fixup. > +static inline > +void bio_first_folio(struct folio_iter *fi, struct bio *bio, int i) Please fix the strange formatting. > +{ > + struct bio_vec *bvec = bio_first_bvec_all(bio) + i; > + > + fi->folio = page_folio(bvec->bv_page); > + fi->offset = bvec->bv_offset + > + PAGE_SIZE * (bvec->bv_page - &fi->folio->page); Can we have a little helper for the offset in folio calculation, like: static inline size_t offset_of_page_in_folio(struct page *page) { return (bvec->bv_page - &page_folio(page)->page) * PAGE; } as that makes the callers a lot easier to read.