Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp381056pxb; Wed, 3 Nov 2021 05:53:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxODBN/sSzPv68mlV+l4MnrW9mU1+SZC618QlQhN6KmGiZrCAsWIWkC3QUprUiclBDjpE0f X-Received: by 2002:a17:907:d8f:: with SMTP id go15mr21035124ejc.495.1635943989761; Wed, 03 Nov 2021 05:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635943989; cv=none; d=google.com; s=arc-20160816; b=Ck9rK/573fRJzluTsDlZSKLZIsEWP/8GiMNW1Q7aNuJ0StMs7g2Mwp4C6bwxCaW82p QfmJ1NNTdoBs7D69OZdmy8I63BYjIGuI/svI4HwOGB6U3K7PoETFjPCF162bNW9h87Gt mvz2iSaLvi+xH+63jZtEXW74ioIYBC3JIbgm8xRdba99NeCp47/Ma9P1Dkrx7qxBYT/p FEDLa5CAdmSdHmnUaUPHn+jK+o2ti1n1kMsitecCFVq/2v1B2zBvqoweU6A43XUxNq1O Yo+wK9wsvK9qbG5ruUVTG5oB7jNvejTIz37t1fMYN3rcQ1CMNJWKyaR79huKgz2Qfznk K3Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AWxSgl03y6hj3Uclf1xozKOXfzyGEIJRVjgfKOuJfpg=; b=cL+U/ds/0lqKBp6PHbbF645iMqfCB9YuWCnyV4LS7EhU68jx76MLaM0qiJyBBV0ABx 8/q6CV85KQutlbQMk7AKv6Pn1UWIzwMdp02ArnvXrgBpZkCPWPcKnEeb7/ceXNPsvB+R vsISfDy9mm4SDid7TskLd2wVjSs8cKrWMDL6EnopVPDZ9ObPBmnFXU4eAlt+zTCAG7nM 40J+V3UY1To6DXJIk3y5P1yxG/vYwNlgksNywhkW/bAuDhNjdF/n1UNyO5nwBmBsIxLW DxAwCRLtx6sc4SzNtbi6jmfA1XUUBy6v/MYwsYkV+FdL8F5QkEdKaPO6fXls9nbzQHoL c3tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YuVMiK6A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z68si2799446ede.105.2021.11.03.05.52.45; Wed, 03 Nov 2021 05:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YuVMiK6A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231910AbhKCMwr (ORCPT + 99 others); Wed, 3 Nov 2021 08:52:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbhKCMwq (ORCPT ); Wed, 3 Nov 2021 08:52:46 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78026C061714; Wed, 3 Nov 2021 05:50:10 -0700 (PDT) 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=AWxSgl03y6hj3Uclf1xozKOXfzyGEIJRVjgfKOuJfpg=; b=YuVMiK6AS8CrpAonDsTY6eSJVb OugD9VsmoHFM7boGrHLu1QNyCytMHEg5N91zyXYRxpdssp5JyGumIRtnDLczTlyGZjvjxZbOfVUSu u7Voc9B6hX01wrjNWQ52S3RodehRg4jMLvQ7dSctJVKuaig11MUJMUNnKJGQ5WGkcgnzrRHpn9oh5 x/pOcow5cBk8Muleo21zE8sYrnuJLCICJrc7wSzHPq5g/+Wq5jS8KofnVayU2t4XMSZRBm5+nWZ3M x3Iz+x5zsxxIyb8HG/mzwYgDPnbD82Aniau6Qs8ra5Wo6Cw+aWZbw0HF5+o76aMPh3S6teWu+26zG uYXZsPyw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1miFgM-005Cll-UN; Wed, 03 Nov 2021 12:48:29 +0000 Date: Wed, 3 Nov 2021 12:47:58 +0000 From: Matthew Wilcox To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig Subject: Re: [PATCH 15/21] iomap: Convert iomap_write_begin and iomap_write_end to folios Message-ID: References: <20211101203929.954622-1-willy@infradead.org> <20211101203929.954622-16-willy@infradead.org> <20211102232215.GG2237511@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 03, 2021 at 03:15:13AM +0000, Matthew Wilcox wrote: > On Tue, Nov 02, 2021 at 04:22:15PM -0700, Darrick J. Wong wrote: > > > + page = folio_file_page(folio, pos >> PAGE_SHIFT); > > > > Isn't this only needed in the BUFFER_HEAD case? > > Good catch. Want me to fold this in? > > @@ -632,12 +631,12 @@ static int iomap_write_begin(const struct iomap_iter *iter, loff_t pos, > goto out_no_page; > } > > - page = folio_file_page(folio, pos >> PAGE_SHIFT); > if (srcmap->type == IOMAP_INLINE) > status = iomap_write_begin_inline(iter, folio); > - else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) > + else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) { > + struct page *page = folio_file_page(folio, pos >> PAGE_SHIFT); > status = __block_write_begin_int(page, pos, len, NULL, srcmap); On second thoughts, this is silly. __block_write_begin_int() doesn't want the precise page (because it constructs buffer_heads and attaches them to the passed-in page). I should just pass &folio->page here. And __block_write_begin_int() should be converted to take a folio at some point.