Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4979602pxb; Tue, 2 Nov 2021 20:18:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFlEzIoK5VpR32CK8yifQSr453zebUBPrZiR8T1thZ8vdNj2ABTadv8EoHbp6ppbBnE68X X-Received: by 2002:a05:6e02:1c0e:: with SMTP id l14mr8947089ilh.8.1635909495826; Tue, 02 Nov 2021 20:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635909495; cv=none; d=google.com; s=arc-20160816; b=CmgjpnHnc8NbDHPncGVRoHna+9mvSLCowUu/K0YKzl0DWEP1L1I6M+xZA9wfdoRlYJ 0Kh5B1NSWwMQQDagmLjaSwT3VqWkjqe/dBJlRdFp4JIFDHg5WchmI2ZZTbkC2/BQi0om snjHgTVALLdzW6+/4dTFRCaBBgLXd4IV9e2WL0ilVQcCUL95SroIr38jbxGDx6YYN92d gh4KZD75PcxuhL2+c3Rx702k28owfaAgKOQOdxCqxaQF1JC0IfTrfdjwcVOhktMddS44 n9szPK/Je41J0B1TkMcbf6gtQNXead3+8rd/+KYVESmF/CJYK84u+4HUShaJ6lsh54Fh Lt/g== 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=gBWPgBNoCYscxKU/Ytp7yevOCr+ydQgdoa0YQn6Vxlc=; b=gnvROfp38yzQaFWhB4QIhBphxl7BaaZqi6y+3+3fFs5YsyRTEayov9qJrzRQ1UMxSb EW+JBF+cosm62vXlD5gpVz+xBCikzW0SC+ASStK1IAv20oTttSPHiXlpDO2n0gzhaq1Z 5naKOnsaw6ctvqOxhFqnWH5MJ0jGbHy2lCw5B0wtOeUMfdKcluwH72byTucjESI6VQsv bBR2gvb9sVpdHhi5SFl3OZQEeCXrSHGC2JC0gMABiLxQY9zmqBUekCYWygi/Xx1BR2vM qG/+OHS26FfQLwMngVwz3Gvj5lJxDNY7hZzhi1IQIrPAq5KIP2GZArvvD88ZrFM1sLIo OUFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lYjsDBPC; 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 e15si1685349ilu.146.2021.11.02.20.18.02; Tue, 02 Nov 2021 20:18:15 -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=lYjsDBPC; 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 S229899AbhKCDTJ (ORCPT + 99 others); Tue, 2 Nov 2021 23:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhKCDTI (ORCPT ); Tue, 2 Nov 2021 23:19:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78FA3C061714; Tue, 2 Nov 2021 20:16:32 -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=gBWPgBNoCYscxKU/Ytp7yevOCr+ydQgdoa0YQn6Vxlc=; b=lYjsDBPCQMP7Rs3nVKlsFzzc8z 4zHaHb5gq+1VlXHTmv9cl7Qiu5BMrHavNSowxe5nTooYbGs9tfXhs9nY2PKxOH2dEnFcHllB/YtG0 m/Uxxo1WNDHTkciPbaknfQuA3XRWXMzahfu7LhUtPmM/YzcWtYis4ZDsuhHzD1u/tgNXGh3+NSXiZ fs4vfFwotF1TD03miQCafolJrxNEnRxX2K7WKW0DCnI5EzhZH1DMWQfd34AbjVTajOZOA7MVCBcTq 42xhbGIAzZzt9Yej+wC7Lequ36lJmhLrstOQgQjfGxnea2tNrcskY8DJhDFNrA8lpmm24zr0VGuJX yiJNJAaQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mi6k5-004vkI-Go; Wed, 03 Nov 2021 03:15:31 +0000 Date: Wed, 3 Nov 2021 03:15:13 +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: <20211102232215.GG2237511@magnolia> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? +++ b/fs/iomap/buffered-io.c @@ -608,7 +608,6 @@ static int iomap_write_begin(const struct iomap_iter *iter, loff_t pos, const struct iomap_page_ops *page_ops = iter->iomap.page_ops; const struct iomap *srcmap = iomap_iter_srcmap(iter); struct folio *folio; - struct page *page; unsigned fgp = FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE | FGP_NOFS; int status = 0; @@ -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); - else + } else status = __iomap_write_begin(iter, pos, len, folio); if (unlikely(status))