mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
doc: improve the description of __folio_mark_dirty
Patch series "Improve buffer head documentation", v3. Turn buffer head documentation into its own document, and make many general improvements to the docs. Obviously there is much more that could be done. Tested with make htmldocs. This patch (of 8): I've learned why it's safe to call __folio_mark_dirty() from mark_buffer_dirty() without holding the folio lock, so update the description to explain why. Link: https://lkml.kernel.org/r/20240416031754.4076917-1-willy@infradead.org Link: https://lkml.kernel.org/r/20240416031754.4076917-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Pankaj Raghav <p.raghav@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
ba591801a3
commit
3d84d89792
1 changed files with 9 additions and 5 deletions
|
@ -2705,11 +2705,15 @@ void folio_account_cleaned(struct folio *folio, struct bdi_writeback *wb)
|
||||||
* If warn is true, then emit a warning if the folio is not uptodate and has
|
* If warn is true, then emit a warning if the folio is not uptodate and has
|
||||||
* not been truncated.
|
* not been truncated.
|
||||||
*
|
*
|
||||||
* The caller must hold folio_memcg_lock(). Most callers have the folio
|
* The caller must hold folio_memcg_lock(). It is the caller's
|
||||||
* locked. A few have the folio blocked from truncation through other
|
* responsibility to prevent the folio from being truncated while
|
||||||
* means (eg zap_vma_pages() has it mapped and is holding the page table
|
* this function is in progress, although it may have been truncated
|
||||||
* lock). This can also be called from mark_buffer_dirty(), which I
|
* before this function is called. Most callers have the folio locked.
|
||||||
* cannot prove is always protected against truncate.
|
* A few have the folio blocked from truncation through other means (e.g.
|
||||||
|
* zap_vma_pages() has it mapped and is holding the page table lock).
|
||||||
|
* When called from mark_buffer_dirty(), the filesystem should hold a
|
||||||
|
* reference to the buffer_head that is being marked dirty, which causes
|
||||||
|
* try_to_free_buffers() to fail.
|
||||||
*/
|
*/
|
||||||
void __folio_mark_dirty(struct folio *folio, struct address_space *mapping,
|
void __folio_mark_dirty(struct folio *folio, struct address_space *mapping,
|
||||||
int warn)
|
int warn)
|
||||||
|
|
Loading…
Reference in a new issue