summaryrefslogtreecommitdiff
path: root/fs/dax.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-14 13:41:11 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-14 13:41:11 +0200
commitd396b05e7e39b0ed6f6d5553fbaf174228e18bdf (patch)
tree23c11525e2514ec13b5ce9abd8e9a57b27ca7e54 /fs/dax.c
parentffb45b46184f54bf84d95e82df46932294b2031a (diff)
parent500df175a7f9e6bc1a9c328590ca5150f84f9ff0 (diff)
downloadlinux-rolling-stable.tar.gz
linux-rolling-stable.zip
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/dax.c')
-rw-r--r--fs/dax.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 6d175cd47a99..df19c9317d10 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;