memory-failure: convert truncate_error_page() to use folio
[ Upstream commit ac5efa7820
]
Replace try_to_release_page() with filemap_release_folio(). This change
is in preparation for the removal of the try_to_release_page() wrapper.
Link: https://lkml.kernel.org/r/20221118073055.55694-4-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 1898efcdbed3 ("block: update the stable_writes flag in bdev_add")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a6f440f3b9
commit
8b6b3ecf0c
|
@ -827,12 +827,13 @@ static int truncate_error_page(struct page *p, unsigned long pfn,
|
||||||
int ret = MF_FAILED;
|
int ret = MF_FAILED;
|
||||||
|
|
||||||
if (mapping->a_ops->error_remove_page) {
|
if (mapping->a_ops->error_remove_page) {
|
||||||
|
struct folio *folio = page_folio(p);
|
||||||
int err = mapping->a_ops->error_remove_page(mapping, p);
|
int err = mapping->a_ops->error_remove_page(mapping, p);
|
||||||
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
pr_info("%#lx: Failed to punch page: %d\n", pfn, err);
|
pr_info("%#lx: Failed to punch page: %d\n", pfn, err);
|
||||||
} else if (page_has_private(p) &&
|
} else if (folio_has_private(folio) &&
|
||||||
!try_to_release_page(p, GFP_NOIO)) {
|
!filemap_release_folio(folio, GFP_NOIO)) {
|
||||||
pr_info("%#lx: failed to release buffers\n", pfn);
|
pr_info("%#lx: failed to release buffers\n", pfn);
|
||||||
} else {
|
} else {
|
||||||
ret = MF_RECOVERED;
|
ret = MF_RECOVERED;
|
||||||
|
|
Loading…
Reference in New Issue