erofs: drop z_erofs_page_mark_eio()
It can be folded into z_erofs_onlinepage_endio() to simplify the code. Reviewed-by: Yue Hu <huyue2@coolpad.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20230817082813.81180-5-hsiangkao@linux.alibaba.com
This commit is contained in:
parent
e4c1cf523d
commit
9a05c6a8bc
@ -143,22 +143,17 @@ static inline void z_erofs_onlinepage_split(struct page *page)
|
||||
atomic_inc((atomic_t *)&page->private);
|
||||
}
|
||||
|
||||
static inline void z_erofs_page_mark_eio(struct page *page)
|
||||
static void z_erofs_onlinepage_endio(struct page *page, int err)
|
||||
{
|
||||
int orig;
|
||||
int orig, v;
|
||||
|
||||
DBG_BUGON(!PagePrivate(page));
|
||||
|
||||
do {
|
||||
orig = atomic_read((atomic_t *)&page->private);
|
||||
} while (atomic_cmpxchg((atomic_t *)&page->private, orig,
|
||||
orig | Z_EROFS_PAGE_EIO) != orig);
|
||||
}
|
||||
v = (orig - 1) | (err ? Z_EROFS_PAGE_EIO : 0);
|
||||
} while (atomic_cmpxchg((atomic_t *)&page->private, orig, v) != orig);
|
||||
|
||||
static inline void z_erofs_onlinepage_endio(struct page *page)
|
||||
{
|
||||
unsigned int v;
|
||||
|
||||
DBG_BUGON(!PagePrivate(page));
|
||||
v = atomic_dec_return((atomic_t *)&page->private);
|
||||
if (!(v & ~Z_EROFS_PAGE_EIO)) {
|
||||
set_page_private(page, 0);
|
||||
ClearPagePrivate(page);
|
||||
@ -1067,9 +1062,7 @@ next_part:
|
||||
goto repeat;
|
||||
|
||||
out:
|
||||
if (err)
|
||||
z_erofs_page_mark_eio(page);
|
||||
z_erofs_onlinepage_endio(page);
|
||||
z_erofs_onlinepage_endio(page, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1172,9 +1165,7 @@ static void z_erofs_fill_other_copies(struct z_erofs_decompress_backend *be,
|
||||
cur += len;
|
||||
}
|
||||
kunmap_local(dst);
|
||||
if (err)
|
||||
z_erofs_page_mark_eio(bvi->bvec.page);
|
||||
z_erofs_onlinepage_endio(bvi->bvec.page);
|
||||
z_erofs_onlinepage_endio(bvi->bvec.page, err);
|
||||
list_del(p);
|
||||
kfree(bvi);
|
||||
}
|
||||
@ -1345,9 +1336,7 @@ out:
|
||||
/* recycle all individual short-lived pages */
|
||||
if (z_erofs_put_shortlivedpage(be->pagepool, page))
|
||||
continue;
|
||||
if (err)
|
||||
z_erofs_page_mark_eio(page);
|
||||
z_erofs_onlinepage_endio(page);
|
||||
z_erofs_onlinepage_endio(page, err);
|
||||
}
|
||||
|
||||
if (be->decompressed_pages != be->onstack_pages)
|
||||
|
Loading…
x
Reference in New Issue
Block a user