Lines Matching refs:cl
68 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl);
75 struct ocfs2_chain_list *cl);
146 static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl) in ocfs2_bits_per_group() argument
148 return (u32)le16_to_cpu(cl->cl_cpg) * (u32)le16_to_cpu(cl->cl_bpc); in ocfs2_bits_per_group()
322 struct ocfs2_chain_list *cl, in ocfs2_bg_discontig_add_extent() argument
334 le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
336 le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
338 clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
348 struct ocfs2_chain_list *cl) in ocfs2_block_group_fill() argument
378 bg->bg_next_group = cl->cl_recs[my_chain].c_blkno; in ocfs2_block_group_fill()
381 if (group_clusters == le16_to_cpu(cl->cl_cpg)) in ocfs2_block_group_fill()
382 bg->bg_bits = cpu_to_le16(ocfs2_bits_per_group(cl)); in ocfs2_block_group_fill()
384 ocfs2_bg_discontig_add_extent(osb, bg, cl, group_blkno, in ocfs2_block_group_fill()
404 static inline u16 ocfs2_find_smallest_chain(struct ocfs2_chain_list *cl) in ocfs2_find_smallest_chain() argument
409 while (curr < le16_to_cpu(cl->cl_count)) { in ocfs2_find_smallest_chain()
410 if (le32_to_cpu(cl->cl_recs[best].c_total) > in ocfs2_find_smallest_chain()
411 le32_to_cpu(cl->cl_recs[curr].c_total)) in ocfs2_find_smallest_chain()
422 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_contig() argument
428 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_contig()
431 le16_to_cpu(cl->cl_cpg), &bit_off, in ocfs2_block_group_alloc_contig()
453 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_contig()
487 struct ocfs2_chain_list *cl, in ocfs2_block_group_grow_discontig() argument
494 unsigned int needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
495 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
522 ocfs2_bg_discontig_add_extent(osb, bg, cl, p_blkno, in ocfs2_block_group_grow_discontig()
526 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()
579 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_discontig() argument
584 unsigned int min_bits = le16_to_cpu(cl->cl_cpg) >> 1; in ocfs2_block_group_alloc_discontig()
586 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_discontig()
633 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_discontig()
640 bg_bh, ac, cl, min_bits); in ocfs2_block_group_alloc_discontig()
662 struct ocfs2_chain_list *cl; in ocfs2_block_group_alloc() local
671 cl = &fe->id2.i_chain; in ocfs2_block_group_alloc()
673 le16_to_cpu(cl->cl_cpg), in ocfs2_block_group_alloc()
682 le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
698 ac, cl); in ocfs2_block_group_alloc()
702 ac, cl); in ocfs2_block_group_alloc()
720 le32_add_cpu(&cl->cl_recs[alloc_rec].c_free, in ocfs2_block_group_alloc()
722 le32_add_cpu(&cl->cl_recs[alloc_rec].c_total, in ocfs2_block_group_alloc()
724 cl->cl_recs[alloc_rec].c_blkno = bg->bg_blkno; in ocfs2_block_group_alloc()
725 if (le16_to_cpu(cl->cl_next_free_rec) < le16_to_cpu(cl->cl_count)) in ocfs2_block_group_alloc()
726 le16_add_cpu(&cl->cl_next_free_rec, 1); in ocfs2_block_group_alloc()
731 le32_add_cpu(&fe->i_clusters, le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
1382 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl) in ocfs2_find_victim_chain() argument
1386 BUG_ON(!cl->cl_next_free_rec); in ocfs2_find_victim_chain()
1389 while (curr < le16_to_cpu(cl->cl_next_free_rec)) { in ocfs2_find_victim_chain()
1390 if (le32_to_cpu(cl->cl_recs[curr].c_free) > in ocfs2_find_victim_chain()
1391 le32_to_cpu(cl->cl_recs[best].c_free)) in ocfs2_find_victim_chain()
1396 BUG_ON(best >= le16_to_cpu(cl->cl_next_free_rec)); in ocfs2_find_victim_chain()
1585 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain; in ocfs2_alloc_dinode_update_counts() local
1596 le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits); in ocfs2_alloc_dinode_update_counts()
1610 struct ocfs2_chain_list *cl; in ocfs2_rollback_alloc_dinode_counts() local
1612 cl = (struct ocfs2_chain_list *)&di->id2.i_chain; in ocfs2_rollback_alloc_dinode_counts()
1615 le32_add_cpu(&cl->cl_recs[chain].c_free, num_bits); in ocfs2_rollback_alloc_dinode_counts()
1620 struct ocfs2_chain_list *cl) in ocfs2_bg_discontig_fix_by_rec() argument
1622 unsigned int bpc = le16_to_cpu(cl->cl_bpc); in ocfs2_bg_discontig_fix_by_rec()
1645 struct ocfs2_chain_list *cl = &di->id2.i_chain; in ocfs2_bg_discontig_fix_result() local
1660 if (ocfs2_bg_discontig_fix_by_rec(res, rec, cl)) { in ocfs2_bg_discontig_fix_result()
1748 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_search_chain() local
1757 le64_to_cpu(cl->cl_recs[chain].c_blkno), in ocfs2_search_chain()
1885 struct ocfs2_chain_list *cl; in ocfs2_claim_suballoc_bits() local
1924 cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_claim_suballoc_bits()
1926 victim = ocfs2_find_victim_chain(cl); in ocfs2_claim_suballoc_bits()
1950 for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) { in ocfs2_claim_suballoc_bits()
1953 if (!cl->cl_recs[i].c_free) in ocfs2_claim_suballoc_bits()
2457 struct ocfs2_chain_list *cl = &fe->id2.i_chain; in _ocfs2_free_suballoc_bits() local
2467 BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); in _ocfs2_free_suballoc_bits()
2501 le32_add_cpu(&cl->cl_recs[le16_to_cpu(group->bg_chain)].c_free, in _ocfs2_free_suballoc_bits()