Skip to content

Commit

Permalink
memory-failure: use a folio in me_pagecache_dirty()
Browse files Browse the repository at this point in the history
Replaces three hidden calls to compound_head() with one visible one.

Link: https://lkml.kernel.org/r/20231117161447.2461643-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Dec 11, 2023
1 parent 3d47e31 commit 6304b53
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,15 +1138,16 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p)
*/
static int me_swapcache_dirty(struct page_state *ps, struct page *p)
{
struct folio *folio = page_folio(p);
int ret;
bool extra_pins = false;

ClearPageDirty(p);
folio_clear_dirty(folio);
/* Trigger EIO in shmem: */
ClearPageUptodate(p);
folio_clear_uptodate(folio);

ret = delete_from_lru_cache(p) ? MF_FAILED : MF_DELAYED;
unlock_page(p);
folio_unlock(folio);

if (ret == MF_DELAYED)
extra_pins = true;
Expand Down

0 comments on commit 6304b53

Please sign in to comment.