Lines Matching refs:cl
84 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl);
91 struct ocfs2_chain_list *cl);
164 static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl) in ocfs2_bits_per_group() argument
166 return (u32)le16_to_cpu(cl->cl_cpg) * (u32)le16_to_cpu(cl->cl_bpc); in ocfs2_bits_per_group()
353 struct ocfs2_chain_list *cl, in ocfs2_bg_discontig_add_extent() argument
365 le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
367 le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
369 clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
379 struct ocfs2_chain_list *cl) in ocfs2_block_group_fill() argument
410 bg->bg_next_group = cl->cl_recs[my_chain].c_blkno; in ocfs2_block_group_fill()
413 if (group_clusters == le16_to_cpu(cl->cl_cpg)) in ocfs2_block_group_fill()
414 bg->bg_bits = cpu_to_le16(ocfs2_bits_per_group(cl)); in ocfs2_block_group_fill()
416 ocfs2_bg_discontig_add_extent(osb, bg, cl, group_blkno, in ocfs2_block_group_fill()
436 static inline u16 ocfs2_find_smallest_chain(struct ocfs2_chain_list *cl) in ocfs2_find_smallest_chain() argument
441 while (curr < le16_to_cpu(cl->cl_count)) { in ocfs2_find_smallest_chain()
442 if (le32_to_cpu(cl->cl_recs[best].c_total) > in ocfs2_find_smallest_chain()
443 le32_to_cpu(cl->cl_recs[curr].c_total)) in ocfs2_find_smallest_chain()
454 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_contig() argument
460 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_contig()
463 le16_to_cpu(cl->cl_cpg), &bit_off, in ocfs2_block_group_alloc_contig()
485 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_contig()
519 struct ocfs2_chain_list *cl, in ocfs2_block_group_grow_discontig() argument
526 unsigned int needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
527 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
554 ocfs2_bg_discontig_add_extent(osb, bg, cl, p_blkno, in ocfs2_block_group_grow_discontig()
558 needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
559 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
611 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_discontig() argument
616 unsigned int min_bits = le16_to_cpu(cl->cl_cpg) >> 1; in ocfs2_block_group_alloc_discontig()
618 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_discontig()
665 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_discontig()
672 bg_bh, ac, cl, min_bits); in ocfs2_block_group_alloc_discontig()
694 struct ocfs2_chain_list *cl; in ocfs2_block_group_alloc() local
703 cl = &fe->id2.i_chain; in ocfs2_block_group_alloc()
705 le16_to_cpu(cl->cl_cpg), in ocfs2_block_group_alloc()
714 le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
730 ac, cl); in ocfs2_block_group_alloc()
734 ac, cl); in ocfs2_block_group_alloc()
752 le32_add_cpu(&cl->cl_recs[alloc_rec].c_free, in ocfs2_block_group_alloc()
754 le32_add_cpu(&cl->cl_recs[alloc_rec].c_total, in ocfs2_block_group_alloc()
756 cl->cl_recs[alloc_rec].c_blkno = bg->bg_blkno; in ocfs2_block_group_alloc()
757 if (le16_to_cpu(cl->cl_next_free_rec) < le16_to_cpu(cl->cl_count)) in ocfs2_block_group_alloc()
758 le16_add_cpu(&cl->cl_next_free_rec, 1); in ocfs2_block_group_alloc()
763 le32_add_cpu(&fe->i_clusters, le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
1390 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl) in ocfs2_find_victim_chain() argument
1394 BUG_ON(!cl->cl_next_free_rec); in ocfs2_find_victim_chain()
1397 while (curr < le16_to_cpu(cl->cl_next_free_rec)) { in ocfs2_find_victim_chain()
1398 if (le32_to_cpu(cl->cl_recs[curr].c_free) > in ocfs2_find_victim_chain()
1399 le32_to_cpu(cl->cl_recs[best].c_free)) in ocfs2_find_victim_chain()
1404 BUG_ON(best >= le16_to_cpu(cl->cl_next_free_rec)); in ocfs2_find_victim_chain()
1593 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain; in ocfs2_alloc_dinode_update_counts() local
1604 le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits); in ocfs2_alloc_dinode_update_counts()
1618 struct ocfs2_chain_list *cl; in ocfs2_rollback_alloc_dinode_counts() local
1620 cl = (struct ocfs2_chain_list *)&di->id2.i_chain; in ocfs2_rollback_alloc_dinode_counts()
1623 le32_add_cpu(&cl->cl_recs[chain].c_free, num_bits); in ocfs2_rollback_alloc_dinode_counts()
1628 struct ocfs2_chain_list *cl) in ocfs2_bg_discontig_fix_by_rec() argument
1630 unsigned int bpc = le16_to_cpu(cl->cl_bpc); in ocfs2_bg_discontig_fix_by_rec()
1653 struct ocfs2_chain_list *cl = &di->id2.i_chain; in ocfs2_bg_discontig_fix_result() local
1668 if (ocfs2_bg_discontig_fix_by_rec(res, rec, cl)) { in ocfs2_bg_discontig_fix_result()
1756 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_search_chain() local
1765 le64_to_cpu(cl->cl_recs[chain].c_blkno), in ocfs2_search_chain()
1893 struct ocfs2_chain_list *cl; in ocfs2_claim_suballoc_bits() local
1934 cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_claim_suballoc_bits()
1936 victim = ocfs2_find_victim_chain(cl); in ocfs2_claim_suballoc_bits()
1957 for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) { in ocfs2_claim_suballoc_bits()
1960 if (!cl->cl_recs[i].c_free) in ocfs2_claim_suballoc_bits()
2463 struct ocfs2_chain_list *cl = &fe->id2.i_chain; in _ocfs2_free_suballoc_bits() local
2473 BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); in _ocfs2_free_suballoc_bits()
2507 le32_add_cpu(&cl->cl_recs[le16_to_cpu(group->bg_chain)].c_free, in _ocfs2_free_suballoc_bits()