Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1482516rwl; Fri, 24 Mar 2023 11:04:19 -0700 (PDT) X-Google-Smtp-Source: AKy350ZS2qfZGZGEsUaJwHY5meQdpZZ5wR3C68j+nJCMAai5q7g1nCDEgPfq4n6kHzfz2DBsMmtx X-Received: by 2002:aa7:c1d7:0:b0:4fa:ba31:6c66 with SMTP id d23-20020aa7c1d7000000b004faba316c66mr3912280edp.42.1679681059106; Fri, 24 Mar 2023 11:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679681059; cv=none; d=google.com; s=arc-20160816; b=SE9RG5l61pNPREUG1fqMP3SZiyUAhBT0jBp91Kl69utRtab4YkRTdhILikGSfaTKsN A6gb+K8YHBfx6Z+dkeQHmyk0+U52PWGUq6OzWgUT48gHNmBDAMzcu9D3m7kqIssFGSdc HPJUMqVrRySgPkeO8k50Vdquuc17/HBfN7vbx3hmC3dd9fwsAx2uxtqYUCBHfNfzJeOy WaytjvcqlwNlW+WasK/Y+GDMNsG/NmqTs78jOIueoPH97alWPMFMUfPVSWa8GZrIlzK1 KHi1QA4pYO+1+reIHk64qUGZenoMUQRS4WQkBeiuT7EYrRiyrQy8sy0A9eYG5Xk+/arG 4H9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xw2QcaDbs9FD/LXdlXsrVQbL81H3GOPupeRYBB+hCYI=; b=BjkxMS7ZBgTS81vznSzQOt8p+34cqV1EVkFkJ0Z3k/hGAQV7IC4MpXqID/mnL3EdU8 w35/ICC8Fp/3lYsN3tS/mHpI1aejb2xx8QJ6UwA8doRhQqa4qMaQEPP8Jl+ByQpYRMoL oN3GUDAtLXmp9YES7GPY5d6TfVpc2P2PQSfdI+NH34q91pYccUFE+E9Yovhzs5WqtAIT dWtjaTvplaqqK7yHUfSLuENEzPdH0pdJ9dK0YMUbQzZNqYgcC03T95effxI+OitptohC oPYiDWvH+4tDlyQQ/+aSyu6CAMFCfTEfemhV+g+O6QjmU8PvfOFL8XdMW3/nyrPZnbzK nc4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JU327FMY; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h27-20020a1709062ddb00b009333d91e361si17212721eji.592.2023.03.24.11.03.46; Fri, 24 Mar 2023 11:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JU327FMY; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232413AbjCXSD3 (ORCPT + 99 others); Fri, 24 Mar 2023 14:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231795AbjCXSCV (ORCPT ); Fri, 24 Mar 2023 14:02:21 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B48D41CBF6; Fri, 24 Mar 2023 11:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Xw2QcaDbs9FD/LXdlXsrVQbL81H3GOPupeRYBB+hCYI=; b=JU327FMY5i+zpq1XrUT8OwRFLi Z6JJGjHdaD4tlGBwyFgZHdA1rP7i4xBIpgz5bECuMiDoxe9csuEhUTdROd2Kr1/dAbgWy0CtLLB4i ok3LPqXKblSaFWP1sQ/0q8L6cE2wzFxkN9yhRCRt14ly1IRM2oA383Pyg7Rl8xDoNQnMtPNJ6nfPS WQuSRwCXdZNm/VxNJ0llFAdO80zRAUihia9VqdB5p1kEihDDQG5cAua7MtBnxnSbA8DO0tgE1ma/q dr62HTLBZ6pbSNSnV6AObteSo7b5TCdEvvk9ysxr+DDwT2M07OoKp0HwNOZ5v2FGi/w/bXDM0Y1mV K1SZck0A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pfljN-0057aQ-Bz; Fri, 24 Mar 2023 18:01:37 +0000 From: "Matthew Wilcox (Oracle)" To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: "Matthew Wilcox (Oracle)" , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v2 19/29] ext4: Convert ext4_journalled_zero_new_buffers() to use a folio Date: Fri, 24 Mar 2023 18:01:19 +0000 Message-Id: <20230324180129.1220691-20-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230324180129.1220691-1-willy@infradead.org> References: <20230324180129.1220691-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Remove a call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/inode.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 172b4ca43981..92418efe1afe 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1359,24 +1359,24 @@ static int ext4_write_end(struct file *file, */ static void ext4_journalled_zero_new_buffers(handle_t *handle, struct inode *inode, - struct page *page, + struct folio *folio, unsigned from, unsigned to) { unsigned int block_start = 0, block_end; struct buffer_head *head, *bh; - bh = head = page_buffers(page); + bh = head = folio_buffers(folio); do { block_end = block_start + bh->b_size; if (buffer_new(bh)) { if (block_end > from && block_start < to) { - if (!PageUptodate(page)) { + if (!folio_test_uptodate(folio)) { unsigned start, size; start = max(from, block_start); size = min(to, block_end) - start; - zero_user(page, start, size); + folio_zero_range(folio, start, size); write_end_fn(handle, inode, bh); } clear_buffer_new(bh); @@ -1413,10 +1413,11 @@ static int ext4_journalled_write_end(struct file *file, if (unlikely(copied < len) && !folio_test_uptodate(folio)) { copied = 0; - ext4_journalled_zero_new_buffers(handle, inode, page, from, to); + ext4_journalled_zero_new_buffers(handle, inode, folio, + from, to); } else { if (unlikely(copied < len)) - ext4_journalled_zero_new_buffers(handle, inode, page, + ext4_journalled_zero_new_buffers(handle, inode, folio, from + copied, to); ret = ext4_walk_page_buffers(handle, inode, folio_buffers(folio), -- 2.39.2