*owned_head) != Z_EROFS_VLE_WORKGRP_NIL)
goto retry;
- *owned_head = grp;
+ *owned_head = &grp->next;
*hosted = true;
} else if (grp->next == Z_EROFS_VLE_WORKGRP_TAIL) {
/*
}
}
- *f->owned_head = *f->grp_ret = grp;
+ *f->owned_head = &grp->next;
+ *f->grp_ret = grp;
return work;
}
/* no possible that 'owned' equals NULL */
DBG_BUGON(owned == Z_EROFS_VLE_WORKGRP_NIL);
- grp = owned;
+ grp = container_of(owned, struct z_erofs_vle_workgroup, next);
owned = READ_ONCE(grp->next);
z_erofs_vle_unzip(sb, grp, page_pool);
DBG_BUGON(owned_head == Z_EROFS_VLE_WORKGRP_TAIL_CLOSED);
DBG_BUGON(owned_head == Z_EROFS_VLE_WORKGRP_NIL);
- grp = owned_head;
+ grp = container_of(owned_head,
+ struct z_erofs_vle_workgroup, next);
/* close the main owned chain at first */
owned_head = cmpxchg(&grp->next, Z_EROFS_VLE_WORKGRP_TAIL,
WRITE_ONCE(lstgrp_io->next, iogrp_next);
if (!lstgrp_noio)
- ios[0]->head = grp;
+ ios[0]->head = &grp->next;
else
WRITE_ONCE(lstgrp_noio->next, grp);
#define Z_EROFS_VLE_WORKGRP_FMT_LZ4 1
#define Z_EROFS_VLE_WORKGRP_FMT_MASK 1
-typedef struct z_erofs_vle_workgroup *z_erofs_vle_owned_workgrp_t;
+typedef void *z_erofs_vle_owned_workgrp_t;
struct z_erofs_vle_workgroup {
struct erofs_workgroup obj;
struct z_erofs_vle_work work;
- /* next owned workgroup */
+ /* point to next owned_workgrp_t */
z_erofs_vle_owned_workgrp_t next;
/* compressed pages (including multi-usage pages) */