Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp734911rdb; Tue, 19 Sep 2023 08:40:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE41/957BdYnwtaOS4p8pKRnwLnXOC0WDb7rqRjJZ0T0cpOf9thh0PULB1nKyNcTc4PFNt7 X-Received: by 2002:a17:902:b409:b0:1c5:b622:6fcd with SMTP id x9-20020a170902b40900b001c5b6226fcdmr268652plr.22.1695138007534; Tue, 19 Sep 2023 08:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695138007; cv=none; d=google.com; s=arc-20160816; b=OHsFKUzkedJ5bs3BRW4bwrTwQAFEswY/wT2EnyQ1+Bex2JAQ02qx1XGDos/ySIfRhQ k5kCCy8gdadFXp5OQU0oCFAh0auxCCRutE2OjafPhz2+HdFIXYB/nwp7q4uwziGQijys PN3j/bR5uy5Yw2P7MKk1R5jgKevzx13J8oQIaenoIPtoRuRbZwWDo2crYsx57VNAKXZi qQzhh5dPSLAa6j+LgjdiCjHk6G9J/bZUY4vZ2LRiB/R+Qe45ovksZzXPU95a9kI1pY3R o0S5PjF5v/gJbqWrk1y0L2n+ooz+kc7Qzqw69/tzYx74QTd9Ev550JsQmeueFu3TEqzh Y7jw== 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=eD9qeqLIAE6j0vOOrRLuvTWmaHXtpk57wthTjNsTMno=; fh=Ex900LeWemyNv8v7eVaT25lhS5hAbxvedq4sD5vnIX8=; b=zoZoHSrGWjLuubLStBER06zKSRev0I+XmqfgmXT3TDd/gAXL5Osg53LO97L1Eau908 PPDlw3fr8J5kYv6ln9RrsdC+hIO1KFnXK2Rue8lHqvTMeS5rKAl+ZybzHWE499li0c87 4GX/YGxkXftdZ6v1h//fL087OkwIncFiUTjBJEpZVNMpaz4qHCqhuh/KRvV/ygJDHRAG t/eKjnTLrrt4TFn4VVVYWSToXEa16m8YMw9ZBte/Oo9fDJo5k+ZZIeaC2KB/sfTGZB4k zPNwWX3F5YVovOJ3AM0z4jiU2sWhFpwBrNQSsuojaDMbrIfQ8ADjTh/q1VP2oupDRrNm AdrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="peOzT/gX"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b2-20020a170902d40200b001b86671b3f1si9946785ple.190.2023.09.19.08.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 08:40:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="peOzT/gX"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E5FF18113401; Mon, 18 Sep 2023 21:52:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231571AbjISEwf (ORCPT + 99 others); Tue, 19 Sep 2023 00:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231539AbjISEvv (ORCPT ); Tue, 19 Sep 2023 00:51:51 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB47B123; Mon, 18 Sep 2023 21:51:42 -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=eD9qeqLIAE6j0vOOrRLuvTWmaHXtpk57wthTjNsTMno=; b=peOzT/gXR0NZxtHy2NkqTZ6cwi hGA3cJ8jI4qvkbcPnElLxuoeNequmIu2zB71bwHg/qaef83CY7m8fXsuDyn+oQLiRVgDxn4217aRW CIrDiW30qHHbVOi6M4kEbNFvqsRqcoYdKEMD6VBI39VtCVzyXYtiz72xA5AKoYY+vV+6w85WHt4ud u8h1C/+GwMPuQSed+I+Oh6uqLL/OO/Y4AAgFEtH8kH8zRdegjle7H+nodil+0STSKwqWjvXVzG7+P WLUViJHG4uIiGDRfvqPS/AVCsnrxW5Px77OfJvxBDw+7kgZLMpWVBsXOkmVgL7ZleAtSbPm36zPJ5 DQ4VZt5w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qiSi5-00FFmO-7E; Tue, 19 Sep 2023 04:51:41 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, reiserfs-devel@vger.kernel.org, linux-ext4@vger.kernel.org, Pankaj Raghav Subject: [PATCH 23/26] ufs: Use ufs_get_locked_folio() in ufs_alloc_lastblock() Date: Tue, 19 Sep 2023 05:51:32 +0100 Message-Id: <20230919045135.3635437-24-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230919045135.3635437-1-willy@infradead.org> References: <20230919045135.3635437-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 18 Sep 2023 21:52:53 -0700 (PDT) Switch to the folio APIs, saving one folio->page->folio conversion. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ufs/inode.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 21a4779a2de5..5b289374d4fd 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -1057,7 +1057,7 @@ static int ufs_alloc_lastblock(struct inode *inode, loff_t size) struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi; unsigned i, end; sector_t lastfrag; - struct page *lastpage; + struct folio *folio; struct buffer_head *bh; u64 phys64; @@ -1068,18 +1068,17 @@ static int ufs_alloc_lastblock(struct inode *inode, loff_t size) lastfrag--; - lastpage = ufs_get_locked_page(mapping, lastfrag >> + folio = ufs_get_locked_folio(mapping, lastfrag >> (PAGE_SHIFT - inode->i_blkbits)); - if (IS_ERR(lastpage)) { - err = -EIO; - goto out; - } - - end = lastfrag & ((1 << (PAGE_SHIFT - inode->i_blkbits)) - 1); - bh = page_buffers(lastpage); - for (i = 0; i < end; ++i) - bh = bh->b_this_page; + if (IS_ERR(folio)) { + err = -EIO; + goto out; + } + end = lastfrag & ((1 << (PAGE_SHIFT - inode->i_blkbits)) - 1); + bh = folio_buffers(folio); + for (i = 0; i < end; ++i) + bh = bh->b_this_page; err = ufs_getfrag_block(inode, lastfrag, bh, 1); @@ -1095,7 +1094,7 @@ static int ufs_alloc_lastblock(struct inode *inode, loff_t size) */ set_buffer_uptodate(bh); mark_buffer_dirty(bh); - set_page_dirty(lastpage); + folio_mark_dirty(folio); } if (lastfrag >= UFS_IND_FRAGMENT) { @@ -1113,7 +1112,7 @@ static int ufs_alloc_lastblock(struct inode *inode, loff_t size) } } out_unlock: - ufs_put_locked_page(lastpage); + ufs_put_locked_folio(folio); out: return err; } -- 2.40.1