[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180219194556.6575-55-willy@infradead.org>
Date: Mon, 19 Feb 2018 11:45:49 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Matthew Wilcox <mawilcox@...rosoft.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH v7 54/61] btrfs: Convert page cache to XArray
From: Matthew Wilcox <mawilcox@...rosoft.com>
Signed-off-by: Matthew Wilcox <mawilcox@...rosoft.com>
---
fs/btrfs/compression.c | 4 +---
fs/btrfs/extent_io.c | 6 ++----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 9fa8617c7344..23867981d016 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -457,9 +457,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
if (pg_index > end_index)
break;
- rcu_read_lock();
- page = radix_tree_lookup(&mapping->pages, pg_index);
- rcu_read_unlock();
+ page = xa_load(&mapping->pages, pg_index);
if (page && !xa_is_value(page)) {
misses++;
if (misses > 4)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 54cef60dd79b..02e15093ed57 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5170,11 +5170,9 @@ void clear_extent_buffer_dirty(struct extent_buffer *eb)
clear_page_dirty_for_io(page);
xa_lock_irq(&page->mapping->pages);
- if (!PageDirty(page)) {
- radix_tree_tag_clear(&page->mapping->pages,
- page_index(page),
+ if (!PageDirty(page))
+ __xa_clear_tag(&page->mapping->pages, page_index(page),
PAGECACHE_TAG_DIRTY);
- }
xa_unlock_irq(&page->mapping->pages);
ClearPageError(page);
unlock_page(page);
--
2.16.1
Powered by blists - more mailing lists