Skip to content

Commit 6304b53

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
memory-failure: use a folio in me_pagecache_dirty()
Replaces three hidden calls to compound_head() with one visible one. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 3d47e31 commit 6304b53

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mm/memory-failure.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,15 +1138,16 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p)
11381138
*/
11391139
static int me_swapcache_dirty(struct page_state *ps, struct page *p)
11401140
{
1141+
struct folio *folio = page_folio(p);
11411142
int ret;
11421143
bool extra_pins = false;
11431144

1144-
ClearPageDirty(p);
1145+
folio_clear_dirty(folio);
11451146
/* Trigger EIO in shmem: */
1146-
ClearPageUptodate(p);
1147+
folio_clear_uptodate(folio);
11471148

11481149
ret = delete_from_lru_cache(p) ? MF_FAILED : MF_DELAYED;
1149-
unlock_page(p);
1150+
folio_unlock(folio);
11501151

11511152
if (ret == MF_DELAYED)
11521153
extra_pins = true;

0 commit comments

Comments
 (0)