summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-05-04 18:32:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-05-05 11:27:19 -0700
commit7f0e07fb0289519af7e726e4f7b7118f7ecc979b (patch)
tree9d7a7a9b90996f8fde414ef87b8a0ccf03b17bc8 /fs
parent46be67b424efab933562a29ea8f1df0c20aa9959 (diff)
downloadlinux-stable-7f0e07fb0289519af7e726e4f7b7118f7ecc979b.tar.gz
linux-stable-7f0e07fb0289519af7e726e4f7b7118f7ecc979b.tar.bz2
linux-stable-7f0e07fb0289519af7e726e4f7b7118f7ecc979b.zip
dax: account DAX entries as nrpages
Simplify mapping_needs_writeback() by accounting DAX entries as pages instead of exceptional entries. Link: https://lkml.kernel.org/r/20201026151849.24232-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Tested-by: Vishal Verma <vishal.l.verma@intel.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/dax.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 999f3f22aea3..69216241392f 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -525,7 +525,7 @@ retry:
dax_disassociate_entry(entry, mapping, false);
xas_store(xas, NULL); /* undo the PMD join */
dax_wake_entry(xas, entry, true);
- mapping->nrexceptional--;
+ mapping->nrpages -= PG_PMD_NR;
entry = NULL;
xas_set(xas, index);
}
@@ -541,7 +541,7 @@ retry:
dax_lock_entry(xas, entry);
if (xas_error(xas))
goto out_unlock;
- mapping->nrexceptional++;
+ mapping->nrpages += 1UL << order;
}
out_unlock:
@@ -661,7 +661,7 @@ static int __dax_invalidate_entry(struct address_space *mapping,
goto out;
dax_disassociate_entry(entry, mapping, trunc);
xas_store(&xas, NULL);
- mapping->nrexceptional--;
+ mapping->nrpages -= 1UL << dax_entry_order(entry);
ret = 1;
out:
put_unlocked_entry(&xas, entry);