Skip to content

Commit

Permalink
erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
Browse files Browse the repository at this point in the history
No any behavior to variable occupied in z_erofs_attach_page() which
is only caller to z_erofs_pagevec_enqueue().

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Yue Hu <[email protected]>
Reviewed-by: Gao Xiang <[email protected]>
Signed-off-by: Gao Xiang <[email protected]>
  • Loading branch information
Yue Hu authored and hsiangkao committed Jun 7, 2021
1 parent 0508c1a commit 7dea3de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions fs/erofs/zdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,14 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt,
enum z_erofs_page_type type)
{
int ret;
bool occupied;

/* give priority for inplaceio */
if (clt->mode >= COLLECT_PRIMARY &&
type == Z_EROFS_PAGE_TYPE_EXCLUSIVE &&
z_erofs_try_inplace_io(clt, page))
return 0;

ret = z_erofs_pagevec_enqueue(&clt->vector,
page, type, &occupied);
ret = z_erofs_pagevec_enqueue(&clt->vector, page, type);
clt->cl->vcnt += (unsigned int)ret;

return ret ? 0 : -EAGAIN;
Expand Down
5 changes: 1 addition & 4 deletions fs/erofs/zpvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ static inline void z_erofs_pagevec_ctor_init(struct z_erofs_pagevec_ctor *ctor,

static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
struct page *page,
enum z_erofs_page_type type,
bool *occupied)
enum z_erofs_page_type type)
{
*occupied = false;
if (!ctor->next && type)
if (ctor->index + 1 == ctor->nr)
return false;
Expand All @@ -125,7 +123,6 @@ static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
/* should remind that collector->next never equal to 1, 2 */
if (type == (uintptr_t)ctor->next) {
ctor->next = page;
*occupied = true;
}
ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, page, type);
return true;
Expand Down

0 comments on commit 7dea3de

Please sign in to comment.