summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-07-27 16:19:08 +0100
committerMark Brown <broonie@kernel.org>2026-07-27 16:19:08 +0100
commitc39acad5e5d182cf7724595f67a53c68202b9b57 (patch)
treef7cba38e854a3163a71319deb85f1d0a54032df6 /fs
parent29ffe189e44cc802814bf702c91ca6a0f90aef2d (diff)
parent6191eeb6c70b41f7bc71967055adab5ef93274dc (diff)
downloadlinux-next-c39acad5e5d182cf7724595f67a53c68202b9b57.tar.gz
linux-next-c39acad5e5d182cf7724595f67a53c68202b9b57.zip
Merge branch 'libnvdimm-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
Diffstat (limited to 'fs')
-rw-r--r--fs/dax.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 4ea3384ecefd..6ba50142eeb2 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -392,12 +392,12 @@ int dax_folio_reset_order(struct folio *folio)
int order = folio_order(folio);
/*
- * DAX maintains the invariant that folio->share != 0 only when
- * folio->mapping == NULL (enforced by dax_folio_make_shared()).
- * Equivalently: folio->mapping != NULL implies folio->share == 0.
- * Callers ensure share has been decremented to zero before
- * calling here, so unconditionally clearing both fields is
- * correct.
+ * Clear the mapping and the index/share union word. folio->share
+ * and folio->index occupy the same union in struct folio. For
+ * non-shared folios (mapping != NULL), the union holds folio->index
+ * (file page offset); for shared folios (mapping == NULL), it holds
+ * folio->share (reference count). Either way, we are releasing the
+ * folio and both fields should be zeroed.
*/
folio->mapping = NULL;
folio->share = 0;