From patchwork Wed Oct 2 04:01:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47794CF3195 for ; Wed, 2 Oct 2024 04:01:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4D92440179; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE83D440175; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEAF2440179; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 75BEA440175 for ; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 123D641865 for ; Wed, 2 Oct 2024 04:01:23 +0000 (UTC) X-FDA: 82627312446.16.D1827F7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf01.hostedemail.com (Postfix) with ESMTP id 5E24440012 for ; Wed, 2 Oct 2024 04:01:21 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=u39QsFMw; spf=none (imf01.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841554; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Qu1H+yLukYt9YwYC/7ESpsAw9sOZjKm/rhqgTzGdqoU=; b=HO4qFEYwJSccqUolvmoGrKD+/ao9o5J+eC/y1/tExy3NhhoYbvfAsOOUjMLEu5HqVTFFtH IfgkaZt5BW9l++eh58RwFQEded80vCHGwqf+Dgyp/F1zOca6S3EOKn9ziXegz5oVbLYrIv 1dThJO88JT1a7753xnRJ37pkF/wVNcg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841554; a=rsa-sha256; cv=none; b=Up+dKcf9nzci+reU8qWNKNUjUlfByvGY2FIuTbNPkbD4mXNGaFcW3PP1kwvSAxy5mvjHDr UD8qb+gXnVy4tujddVXdXmTvwMYXttLM9R/eHNnIzvdEyUaHy5sW2Hu9ed/irNNwEuvBW4 OLxbrDKd6S4tluyCsKw8yWZVPanKSWw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=u39QsFMw; spf=none (imf01.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=Qu1H+yLukYt9YwYC/7ESpsAw9sOZjKm/rhqgTzGdqoU=; b=u39QsFMwQ6tIwNI7i/W1K+/pl+ GvSGrpVMvi9IWupEj7d7hKdghJKrM8TW/XKgZb3bkO1NguUXTBhUJB4Adxa6WXd0ajYBIGzZWnxhW H6BXWSuGXsM65J4L5JDKfv0k8YLxibiMMitHwY03iC2W9MLIjhWBnRauq01lxHeU4qd9vVJI0B1z2 asy96gxHMxcFadkiQTWxzRThGNp0i2aIXcGqBT3UxcxELkkZdMroPgTKm4jlnqW1VhLmrZIv1VoQL n+44yDwp5sIhB3WaWM6c4Rg1vTpmuHvSuUmpVzYMZR7W8Jw/e9xFD9YUU3PZANOA6b2Uj9TjSqD3B 2GXU3Phg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY5-00000004I8Z-3vof; Wed, 02 Oct 2024 04:01:13 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/6] btrfs: Switch from using the private_2 flag to owner_2 Date: Wed, 2 Oct 2024 05:01:06 +0100 Message-ID: <20241002040111.1023018-5-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 5E24440012 X-Stat-Signature: xd8sfxyt3pnyjghywkfzrr8i9g4fbps5 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1727841681-108078 X-HE-Meta: U2FsdGVkX1/vuJIpUbieTCtGPdYBG0LinHIw6QbhrQTvAQSJJbSH74JwC+m9r/lZWM1gwBfRKghxCbWtQHXiCpww4x15aHjYVVf6D/Ijox14dlkGWAIK41HNKJMKG8C+75FwTYhW0wk705FSPSnl/bRjkkACqpE9i7qCeH2sD9EVIFmgqig1A1KPmsrPp5N9dbEqRah2ZRGmERsc3Hm0S1NH7gqPC6pCNnr+8oW9wokYLI+UxiHktv/n/5gC0P1H19jT15zfvscq7rDjA5IlbTfHsMQN6ra6RWAhfZL7eQttsWz1lcoCAr1nj+mm7+hA+N73Rr+rv0ZnQ3f45kabbFEYEYB4dOyWHiK9CJTgit2uFhbMCBmxt8IE3ArerqqowV6hL07b0l6z0hPD3/GPPOLvqTrss0eLETQZML4sE2eYzcsaQzuN9A5VEwhN6hjhikxobEgtgvryuKevBdjTfKg2G9t966YsI0QFQhIt8eSaNbdI+NuK5J/ZFSo+85zpz7mLnJoIvv847Jval8VA8yE29RH14KA3c8UOHo315We8fuwRlWuIKqVWOu65QMDZOrJXWFSdBfGAk3gN764asKikg20e/tLsSHVWvJ54N9kyFKqPFW+sMsRjuQxptbt6AFBCj7dZdiXXCiFh6ZZyS7P+/RJq7CTuJhgoJWW7Z+i55weyeRyM1Rzs4sneigWNkY9VVit+MBHi5SEzqszYGwH3Ie64Qdr9fg53l6kvrwhNA3n+h8fMP4XYDnExhqbsREppT1tWCE8MCDljS60KNiVtcQyuFVRcJGEh4ZQf/LN28Rkd1+qVcjfE2GffIsgXkV61eFifmZH3+Utd0s9GtZ5G2xiLCy2SGgfV/2mPK2vPe8io8Oc5q0SB1i4Y4pdmQblF7/fXFk8DfIosSLeNvFlLGViC/FdjyV550ZgthYQoFbx3nHRAPHyEIgLrKhhQKgHUhMXU3a9FeOLMRIv rUgkJiDe 9c4ErHkNj8A+FkVMATYQTmMA6KQvc5iBdX5l+H3X5cKDPV84Mmb+Au6VnkawO7aN39e83W9lwlhlCl1yTcqCe4wl9taKuiBaGTROop1p2h1Ap56ww+R2ZUnsIB4p1Y6dhyk4oaDF/tN4Y5Z9c/oX+WtrEEEMYLPkwWQUZxmpY4wdHEm7Bl6CUsgWySEtL9mUYrJFwMk3JQX715DgNM7MwNitVGtkH8wGTclu54wHLDx1M7oF/ByCE36Mpfl+EaftiUhuhyncBem9ATTYjkl7dv3PTy6pnOACxwHq89cfWOjEGBIQ9uiPA2b2CG03MgvX0N/1a 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: List-Subscribe: List-Unsubscribe: We are close to removing the private_2 flag, so switch btrfs to using owner_2 for its ordered flag. This is mostly used by buffer head filesystems, so btrfs can use it because it doesn't use buffer heads. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Josef Bacik --- fs/btrfs/ctree.h | 13 ++++--------- fs/btrfs/inode.c | 8 ++++---- fs/btrfs/ordered-data.c | 4 ++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 317a3712270f..307dedf95c70 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -744,16 +744,11 @@ const char *btrfs_super_csum_driver(u16 csum_type); size_t __attribute_const__ btrfs_get_num_csums(void); /* - * We use page status Private2 to indicate there is an ordered extent with + * We use folio flag owner_2 to indicate there is an ordered extent with * unfinished IO. - * - * Rename the Private2 accessors to Ordered, to improve readability. */ -#define PageOrdered(page) PagePrivate2(page) -#define SetPageOrdered(page) SetPagePrivate2(page) -#define ClearPageOrdered(page) ClearPagePrivate2(page) -#define folio_test_ordered(folio) folio_test_private_2(folio) -#define folio_set_ordered(folio) folio_set_private_2(folio) -#define folio_clear_ordered(folio) folio_clear_private_2(folio) +#define folio_test_ordered(folio) folio_test_owner_2(folio) +#define folio_set_ordered(folio) folio_set_owner_2(folio) +#define folio_clear_ordered(folio) folio_clear_owner_2(folio) #endif diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index edac499fd83d..a4055896261d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1513,7 +1513,7 @@ static noinline int cow_file_range(struct btrfs_inode *inode, * (which the caller expects to stay locked), don't clear any * dirty bits and don't set any writeback bits * - * Do set the Ordered (Private2) bit so we know this page was + * Do set the Ordered flag so we know this page was * properly setup for writepage. */ page_ops = (keep_locked ? 0 : PAGE_UNLOCK); @@ -7292,7 +7292,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset, * * But already submitted bio can still be finished on this folio. * Furthermore, endio function won't skip folio which has Ordered - * (Private2) already cleared, so it's possible for endio and + * already cleared, so it's possible for endio and * invalidate_folio to do the same ordered extent accounting twice * on one folio. * @@ -7358,7 +7358,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset, range_len = range_end + 1 - cur; if (!btrfs_folio_test_ordered(fs_info, folio, cur, range_len)) { /* - * If Ordered (Private2) is cleared, it means endio has + * If Ordered is cleared, it means endio has * already been executed for the range. * We can't delete the extent states as * btrfs_finish_ordered_io() may still use some of them. @@ -7431,7 +7431,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset, } /* * We have iterated through all ordered extents of the page, the page - * should not have Ordered (Private2) anymore, or the above iteration + * should not have Ordered anymore, or the above iteration * did something wrong. */ ASSERT(!folio_test_ordered(folio)); diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 2104d60c2161..95c8499a159a 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -346,10 +346,10 @@ static bool can_finish_ordered_extent(struct btrfs_ordered_extent *ordered, ASSERT(file_offset + len <= folio_pos(folio) + folio_size(folio)); /* - * Ordered (Private2) bit indicates whether we still have + * Ordered flag indicates whether we still have * pending io unfinished for the ordered extent. * - * If there's no such bit, we need to skip to next range. + * If it's not set, we need to skip to next range. */ if (!btrfs_folio_test_ordered(fs_info, folio, file_offset, len)) return false;