Lines Matching defs:pcl

59 	struct z_erofs_pcluster *pcl = ptr;
60 struct z_erofs_collection *cl = z_erofs_primarycollection(pcl);
67 pcl->compressed_pages[i] = NULL;
124 struct z_erofs_pcluster *pcl, *tailpcl;
159 const struct z_erofs_pcluster *pcl = clt->pcl;
160 const unsigned int clusterpages = BIT(pcl->clusterbits);
162 pgoff_t index = pcl->obj.index + (pages - pcl->compressed_pages);
168 for (; pages < pcl->compressed_pages + clusterpages; ++pages) {
204 struct z_erofs_pcluster *const pcl =
207 const unsigned int clusterpages = BIT(pcl->clusterbits);
215 struct page *page = pcl->compressed_pages[i];
228 WRITE_ONCE(pcl->compressed_pages[i], NULL);
241 struct z_erofs_pcluster *const pcl = (void *)page_private(page);
242 const unsigned int clusterpages = BIT(pcl->clusterbits);
245 if (erofs_workgroup_try_to_freeze(&pcl->obj, 1)) {
249 if (pcl->compressed_pages[i] == page) {
250 WRITE_ONCE(pcl->compressed_pages[i], NULL);
255 erofs_workgroup_unfreeze(&pcl->obj, 1);
269 struct z_erofs_pcluster *const pcl = clt->pcl;
270 const unsigned int clusterpages = BIT(pcl->clusterbits);
272 while (clt->compressedpages < pcl->compressed_pages + clusterpages) {
299 try_to_claim_pcluster(struct z_erofs_pcluster *pcl,
304 if (pcl->next == Z_EROFS_PCLUSTER_NIL) {
306 if (cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_NIL,
310 *owned_head = &pcl->next;
313 } else if (pcl->next == Z_EROFS_PCLUSTER_TAIL) {
319 if (cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_TAIL,
332 struct z_erofs_pcluster *pcl = clt->pcl;
337 if (clt->owned_head == &pcl->next || pcl == clt->tailpcl) {
342 cl = z_erofs_primarycollection(pcl);
348 length = READ_ONCE(pcl->length);
361 length != cmpxchg_relaxed(&pcl->length, length, llen)) {
363 length = READ_ONCE(pcl->length);
369 clt->tailpcl = pcl;
370 clt->mode = try_to_claim_pcluster(pcl, &clt->owned_head);
382 struct z_erofs_pcluster *pcl;
388 pcl = kmem_cache_alloc(pcluster_cachep, GFP_NOFS);
389 if (!pcl)
392 atomic_set(&pcl->obj.refcount, 1);
393 pcl->obj.index = map->m_pa >> PAGE_SHIFT;
395 pcl->length = (map->m_llen << Z_EROFS_PCLUSTER_LENGTH_BIT) |
400 pcl->algorithmformat = Z_EROFS_COMPRESSION_LZ4;
402 pcl->algorithmformat = Z_EROFS_COMPRESSION_SHIFTED;
404 pcl->clusterbits = EROFS_I(inode)->z_physical_clusterbits[0];
405 pcl->clusterbits -= PAGE_SHIFT;
408 pcl->next = clt->owned_head;
411 cl = z_erofs_primarycollection(pcl);
425 grp = erofs_insert_workgroup(inode->i_sb, &pcl->obj);
431 if (grp != &pcl->obj) {
432 clt->pcl = container_of(grp, struct z_erofs_pcluster, obj);
438 clt->tailpcl = pcl;
439 clt->owned_head = &pcl->next;
440 clt->pcl = pcl;
446 kmem_cache_free(pcluster_cachep, pcl);
470 clt->pcl = container_of(grp, struct z_erofs_pcluster, obj);
482 erofs_workgroup_put(&clt->pcl->obj);
490 clt->compressedpages = clt->pcl->compressed_pages;
512 struct z_erofs_pcluster *const pcl =
514 struct z_erofs_collection *const cl = z_erofs_primarycollection(pcl);
521 struct z_erofs_pcluster *const pcl =
524 erofs_workgroup_put(&pcl->obj);
742 struct z_erofs_pcluster *pcl,
746 const unsigned int clusterpages = BIT(pcl->clusterbits);
758 cl = z_erofs_primarycollection(pcl);
826 compressed_pages = pcl->compressed_pages;
872 llen = pcl->length >> Z_EROFS_PCLUSTER_LENGTH_BIT;
875 partial = !(pcl->length & Z_EROFS_PCLUSTER_FULL_LENGTH);
888 .alg = pcl->algorithmformat,
933 WRITE_ONCE(pcl->next, Z_EROFS_PCLUSTER_NIL);
948 struct z_erofs_pcluster *pcl;
956 pcl = container_of(owned, struct z_erofs_pcluster, next);
957 owned = READ_ONCE(pcl->next);
959 z_erofs_decompress_pcluster(io->sb, pcl, pagepool);
976 static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
982 const pgoff_t index = pcl->obj.index;
992 page = READ_ONCE(pcl->compressed_pages[nr]);
1029 WRITE_ONCE(pcl->compressed_pages[nr], page);
1041 set_page_private(page, (unsigned long)pcl);
1071 if (oldpage != cmpxchg(&pcl->compressed_pages[nr], oldpage, page)) {
1084 set_page_private(page, (unsigned long)pcl);
1136 static void move_to_bypass_jobqueue(struct z_erofs_pcluster *pcl,
1147 WRITE_ONCE(pcl->next, Z_EROFS_PCLUSTER_TAIL_CLOSED);
1150 WRITE_ONCE(*bypass_qtail, &pcl->next);
1152 qtail[JQ_BYPASS] = &pcl->next;
1179 struct z_erofs_pcluster *pcl;
1188 pcl = container_of(owned_head, struct z_erofs_pcluster, next);
1190 cur = pcl->obj.index;
1191 end = cur + BIT(pcl->clusterbits);
1194 owned_head = cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_TAIL,
1200 page = pickup_page_for_submission(pcl, i++, pagepool,
1234 qtail[JQ_SUBMIT] = &pcl->next;
1236 move_to_bypass_jobqueue(pcl, qtail, owned_head);