inode->idata_size = 0;
inode->fragment_size = 0;
- if (z_erofs_mt_enabled) {
- ictx = malloc(sizeof(*ictx));
- if (!ictx)
- return ERR_PTR(-ENOMEM);
- ictx->fd = dup(fd);
- } else {
+ if (!z_erofs_mt_enabled ||
+ (cfg.c_all_fragments && !erofs_is_packed_inode(inode))) {
#ifdef EROFS_MT_ENABLED
pthread_mutex_lock(&g_ictx.mutex);
if (g_ictx.seg_num)
#endif
ictx = &g_ictx;
ictx->fd = fd;
+ } else {
+ ictx = malloc(sizeof(*ictx));
+ if (!ictx)
+ return ERR_PTR(-ENOMEM);
+ ictx->fd = dup(fd);
}
ictx->ccfg = &erofs_ccfg[inode->z_algorithmtype[0]];