All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kairui Song <ryncsn@gmail.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	Hugh Dickins <hughd@google.com>, Chris Li <chrisl@kernel.org>,
	David Hildenbrand <david@redhat.com>,
	Yosry Ahmed <yosryahmed@google.com>,
	"Huang, Ying" <ying.huang@linux.alibaba.com>,
	Nhat Pham <nphamcs@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-kernel@vger.kernel.org, Kairui Song <kasong@tencent.com>,
	Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, Qu Wenruo <wqu@suse.com>
Subject: [PATCH v3 2/6] btrfs: drop usage of folio_index
Date: Thu,  1 May 2025 02:10:48 +0800	[thread overview]
Message-ID: <20250430181052.55698-3-ryncsn@gmail.com> (raw)
In-Reply-To: <20250430181052.55698-1-ryncsn@gmail.com>

From: Kairui Song <kasong@tencent.com>

folio_index is only needed for mixed usage of page cache and swap
cache, for pure page cache usage, the caller can just use
folio->index instead.

It can't be a swap cache folio here.  Swap mapping may only call into fs
through `swap_rw` but btrfs does not use that method for swap.

Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
Cc: linux-btrfs@vger.kernel.org (open list:BTRFS FILE SYSTEM)
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/extent_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 197f5e51c474..e08b50504d13 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3509,7 +3509,7 @@ static void btree_clear_folio_dirty_tag(struct folio *folio)
 	xa_lock_irq(&folio->mapping->i_pages);
 	if (!folio_test_dirty(folio))
 		__xa_clear_mark(&folio->mapping->i_pages,
-				folio_index(folio), PAGECACHE_TAG_DIRTY);
+				folio->index, PAGECACHE_TAG_DIRTY);
 	xa_unlock_irq(&folio->mapping->i_pages);
 }
 
-- 
2.49.0


  parent reply	other threads:[~2025-04-30 18:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 18:10 [PATCH v3 0/6] mm, swap: clean up swap cache mapping helper Kairui Song
2025-04-30 18:10 ` [PATCH v3 1/6] fuse: drop usage of folio_index Kairui Song
2025-04-30 21:08   ` David Hildenbrand
2025-04-30 18:10 ` Kairui Song [this message]
2025-04-30 21:06   ` [PATCH v3 2/6] btrfs: " Andrew Morton
2025-04-30 21:07     ` David Hildenbrand
2025-05-01 10:13       ` Kairui Song
2025-04-30 21:08   ` David Hildenbrand
2025-05-01  8:50   ` David Sterba
2025-05-02 11:10   ` David Sterba
2025-04-30 18:10 ` [f2fs-dev] [PATCH v3 3/6] f2fs: " Kairui Song
2025-04-30 18:10   ` Kairui Song
2025-04-30 21:08   ` [f2fs-dev] " David Hildenbrand via Linux-f2fs-devel
2025-04-30 21:08     ` David Hildenbrand
2025-05-06  8:49   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-05-06  8:49     ` Chao Yu
2025-06-09 20:56   ` [f2fs-dev] " patchwork-bot+f2fs--- via Linux-f2fs-devel
2025-06-09 20:56     ` patchwork-bot+f2fs
2025-04-30 18:10 ` [PATCH v3 4/6] filemap: do not use folio_contains for swap cache folios Kairui Song
2025-04-30 18:15   ` Kairui Song
2025-04-30 18:10 ` [PATCH v3 5/6] mm: move folio_index to mm/swap.h and remove no longer needed helper Kairui Song
2025-04-30 21:11   ` David Hildenbrand
2025-05-01 10:08     ` Kairui Song
2025-04-30 18:10 ` [PATCH v3 6/6] mm, swap: remove no longer used swap mapping helper Kairui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250430181052.55698-3-ryncsn@gmail.com \
    --to=ryncsn@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=clm@fb.com \
    --cc=david@redhat.com \
    --cc=dsterba@suse.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=josef@toxicpanda.com \
    --cc=kasong@tencent.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=willy@infradead.org \
    --cc=wqu@suse.com \
    --cc=ying.huang@linux.alibaba.com \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.