Lines Matching refs:pcl

59 	struct z_erofs_pcluster *pcl = ptr;  in z_erofs_pcluster_init_once()  local
60 struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); in z_erofs_pcluster_init_once()
67 pcl->compressed_pages[i] = NULL; in z_erofs_pcluster_init_once()
70 static void z_erofs_pcluster_init_always(struct z_erofs_pcluster *pcl) in z_erofs_pcluster_init_always() argument
72 struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); in z_erofs_pcluster_init_always()
74 atomic_set(&pcl->obj.refcount, 1); in z_erofs_pcluster_init_always()
134 struct z_erofs_pcluster *pcl, *tailpcl; member
169 const struct z_erofs_pcluster *pcl = clt->pcl; in preload_compressed_pages() local
170 const unsigned int clusterpages = BIT(pcl->clusterbits); in preload_compressed_pages()
172 pgoff_t index = pcl->obj.index + (pages - pcl->compressed_pages); in preload_compressed_pages()
178 for (; pages < pcl->compressed_pages + clusterpages; ++pages) { in preload_compressed_pages()
214 struct z_erofs_pcluster *const pcl = in erofs_try_to_free_all_cached_pages() local
217 const unsigned int clusterpages = BIT(pcl->clusterbits); in erofs_try_to_free_all_cached_pages()
225 struct page *page = pcl->compressed_pages[i]; in erofs_try_to_free_all_cached_pages()
238 WRITE_ONCE(pcl->compressed_pages[i], NULL); in erofs_try_to_free_all_cached_pages()
251 struct z_erofs_pcluster *const pcl = (void *)page_private(page); in erofs_try_to_free_cached_page() local
252 const unsigned int clusterpages = BIT(pcl->clusterbits); in erofs_try_to_free_cached_page()
255 if (erofs_workgroup_try_to_freeze(&pcl->obj, 1)) { in erofs_try_to_free_cached_page()
259 if (pcl->compressed_pages[i] == page) { in erofs_try_to_free_cached_page()
260 WRITE_ONCE(pcl->compressed_pages[i], NULL); in erofs_try_to_free_cached_page()
265 erofs_workgroup_unfreeze(&pcl->obj, 1); in erofs_try_to_free_cached_page()
279 struct z_erofs_pcluster *const pcl = clt->pcl; in z_erofs_try_inplace_io() local
280 const unsigned int clusterpages = BIT(pcl->clusterbits); in z_erofs_try_inplace_io()
282 while (clt->compressedpages < pcl->compressed_pages + clusterpages) { in z_erofs_try_inplace_io()
311 try_to_claim_pcluster(struct z_erofs_pcluster *pcl, in try_to_claim_pcluster() argument
316 if (pcl->next == Z_EROFS_PCLUSTER_NIL) { in try_to_claim_pcluster()
318 if (cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_NIL, in try_to_claim_pcluster()
322 *owned_head = &pcl->next; in try_to_claim_pcluster()
325 } else if (pcl->next == Z_EROFS_PCLUSTER_TAIL) { in try_to_claim_pcluster()
331 if (cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_TAIL, in try_to_claim_pcluster()
345 struct z_erofs_pcluster *pcl; in cllookup() local
354 pcl = container_of(grp, struct z_erofs_pcluster, obj); in cllookup()
355 if (clt->owned_head == &pcl->next || pcl == clt->tailpcl) { in cllookup()
361 cl = z_erofs_primarycollection(pcl); in cllookup()
368 length = READ_ONCE(pcl->length); in cllookup()
382 length != cmpxchg_relaxed(&pcl->length, length, llen)) { in cllookup()
384 length = READ_ONCE(pcl->length); in cllookup()
390 clt->tailpcl = pcl; in cllookup()
391 clt->mode = try_to_claim_pcluster(pcl, &clt->owned_head); in cllookup()
395 clt->pcl = pcl; in cllookup()
404 struct z_erofs_pcluster *pcl; in clregister() local
409 pcl = kmem_cache_alloc(pcluster_cachep, GFP_NOFS); in clregister()
410 if (!pcl) in clregister()
413 z_erofs_pcluster_init_always(pcl); in clregister()
414 pcl->obj.index = map->m_pa >> PAGE_SHIFT; in clregister()
416 pcl->length = (map->m_llen << Z_EROFS_PCLUSTER_LENGTH_BIT) | in clregister()
421 pcl->algorithmformat = Z_EROFS_COMPRESSION_LZ4; in clregister()
423 pcl->algorithmformat = Z_EROFS_COMPRESSION_SHIFTED; in clregister()
425 pcl->clusterbits = EROFS_I(inode)->z_physical_clusterbits[0]; in clregister()
426 pcl->clusterbits -= PAGE_SHIFT; in clregister()
429 pcl->next = clt->owned_head; in clregister()
432 cl = z_erofs_primarycollection(pcl); in clregister()
441 err = erofs_register_workgroup(inode->i_sb, &pcl->obj, 0); in clregister()
444 kmem_cache_free(pcluster_cachep, pcl); in clregister()
449 clt->tailpcl = pcl; in clregister()
450 clt->owned_head = &pcl->next; in clregister()
451 clt->pcl = pcl; in clregister()
488 clt->compressedpages = clt->pcl->compressed_pages; in z_erofs_collector_begin()
510 struct z_erofs_pcluster *const pcl = in erofs_workgroup_free_rcu() local
512 struct z_erofs_collection *const cl = z_erofs_primarycollection(pcl); in erofs_workgroup_free_rcu()
519 struct z_erofs_pcluster *const pcl = in z_erofs_collection_put() local
522 erofs_workgroup_put(&pcl->obj); in z_erofs_collection_put()
756 struct z_erofs_pcluster *pcl, in z_erofs_decompress_pcluster() argument
760 const unsigned int clusterpages = BIT(pcl->clusterbits); in z_erofs_decompress_pcluster()
772 cl = z_erofs_primarycollection(pcl); in z_erofs_decompress_pcluster()
840 compressed_pages = pcl->compressed_pages; in z_erofs_decompress_pcluster()
886 llen = pcl->length >> Z_EROFS_PCLUSTER_LENGTH_BIT; in z_erofs_decompress_pcluster()
889 partial = !(pcl->length & Z_EROFS_PCLUSTER_FULL_LENGTH); in z_erofs_decompress_pcluster()
902 .alg = pcl->algorithmformat, in z_erofs_decompress_pcluster()
947 WRITE_ONCE(pcl->next, Z_EROFS_PCLUSTER_NIL); in z_erofs_decompress_pcluster()
963 struct z_erofs_pcluster *pcl; in z_erofs_vle_unzip_all() local
971 pcl = container_of(owned, struct z_erofs_pcluster, next); in z_erofs_vle_unzip_all()
972 owned = READ_ONCE(pcl->next); in z_erofs_vle_unzip_all()
974 z_erofs_decompress_pcluster(sb, pcl, pagepool); in z_erofs_vle_unzip_all()
991 static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl, in pickup_page_for_submission() argument
999 const pgoff_t index = pcl->obj.index; in pickup_page_for_submission()
1009 page = READ_ONCE(pcl->compressed_pages[nr]); in pickup_page_for_submission()
1061 WRITE_ONCE(pcl->compressed_pages[nr], page); in pickup_page_for_submission()
1073 set_page_private(page, (unsigned long)pcl); in pickup_page_for_submission()
1097 if (oldpage != cmpxchg(&pcl->compressed_pages[nr], oldpage, page)) { in pickup_page_for_submission()
1109 set_page_private(page, (unsigned long)pcl); in pickup_page_for_submission()
1168 static void move_to_bypass_jobqueue(struct z_erofs_pcluster *pcl, in move_to_bypass_jobqueue() argument
1179 WRITE_ONCE(pcl->next, Z_EROFS_PCLUSTER_TAIL_CLOSED); in move_to_bypass_jobqueue()
1182 WRITE_ONCE(*bypass_qtail, &pcl->next); in move_to_bypass_jobqueue()
1184 qtail[JQ_BYPASS] = &pcl->next; in move_to_bypass_jobqueue()
1230 struct z_erofs_pcluster *pcl; in z_erofs_vle_submit_all() local
1241 pcl = container_of(owned_head, struct z_erofs_pcluster, next); in z_erofs_vle_submit_all()
1243 clusterpages = BIT(pcl->clusterbits); in z_erofs_vle_submit_all()
1246 owned_head = cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_TAIL, in z_erofs_vle_submit_all()
1249 first_index = pcl->obj.index; in z_erofs_vle_submit_all()
1253 page = pickup_page_for_submission(pcl, i, pagepool, in z_erofs_vle_submit_all()
1292 qtail[JQ_SUBMIT] = &pcl->next; in z_erofs_vle_submit_all()
1294 move_to_bypass_jobqueue(pcl, qtail, owned_head); in z_erofs_vle_submit_all()