Commit 2ca456c2 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

filemap: Update the folio_mark_dirty documentation



The previous comment was not terribly helpful.  Be a bit more explicit
about the necessary locking environment.

Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent cd125eea
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2602,10 +2602,12 @@ EXPORT_SYMBOL(folio_redirty_for_writepage);
 * folio_mark_dirty - Mark a folio as being modified.
 * @folio: The folio.
 *
 * For folios with a mapping this should be done with the folio lock held
 * for the benefit of asynchronous memory errors who prefer a consistent
 * dirty state. This rule can be broken in some special cases,
 * but should be better not to.
 * The folio may not be truncated while this function is running.
 * Holding the folio lock is sufficient to prevent truncation, but some
 * callers cannot acquire a sleeping lock.  These callers instead hold
 * the page table lock for a page table which contains at least one page
 * in this folio.  Truncation will block on the page table lock as it
 * unmaps pages before removing the folio from its mapping.
 *
 * Return: True if the folio was newly dirtied, false if it was already dirty.
 */