Lines Matching refs:cl
70 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl);
77 struct ocfs2_chain_list *cl);
148 static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl) in ocfs2_bits_per_group() argument
150 return (u32)le16_to_cpu(cl->cl_cpg) * (u32)le16_to_cpu(cl->cl_bpc); in ocfs2_bits_per_group()
324 struct ocfs2_chain_list *cl, in ocfs2_bg_discontig_add_extent() argument
336 le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
338 le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
340 clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
350 struct ocfs2_chain_list *cl) in ocfs2_block_group_fill() argument
380 bg->bg_next_group = cl->cl_recs[my_chain].c_blkno; in ocfs2_block_group_fill()
383 if (group_clusters == le16_to_cpu(cl->cl_cpg)) in ocfs2_block_group_fill()
384 bg->bg_bits = cpu_to_le16(ocfs2_bits_per_group(cl)); in ocfs2_block_group_fill()
386 ocfs2_bg_discontig_add_extent(osb, bg, cl, group_blkno, in ocfs2_block_group_fill()
406 static inline u16 ocfs2_find_smallest_chain(struct ocfs2_chain_list *cl) in ocfs2_find_smallest_chain() argument
411 while (curr < le16_to_cpu(cl->cl_count)) { in ocfs2_find_smallest_chain()
412 if (le32_to_cpu(cl->cl_recs[best].c_total) > in ocfs2_find_smallest_chain()
413 le32_to_cpu(cl->cl_recs[curr].c_total)) in ocfs2_find_smallest_chain()
424 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_contig() argument
430 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_contig()
433 le16_to_cpu(cl->cl_cpg), &bit_off, in ocfs2_block_group_alloc_contig()
455 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_contig()
489 struct ocfs2_chain_list *cl, in ocfs2_block_group_grow_discontig() argument
496 unsigned int needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
497 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
524 ocfs2_bg_discontig_add_extent(osb, bg, cl, p_blkno, in ocfs2_block_group_grow_discontig()
528 needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
529 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
581 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_discontig() argument
586 unsigned int min_bits = le16_to_cpu(cl->cl_cpg) >> 1; in ocfs2_block_group_alloc_discontig()
588 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_discontig()
635 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_discontig()
642 bg_bh, ac, cl, min_bits); in ocfs2_block_group_alloc_discontig()
664 struct ocfs2_chain_list *cl; in ocfs2_block_group_alloc() local
673 cl = &fe->id2.i_chain; in ocfs2_block_group_alloc()
675 le16_to_cpu(cl->cl_cpg), in ocfs2_block_group_alloc()
684 le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
700 ac, cl); in ocfs2_block_group_alloc()
705 ac, cl); in ocfs2_block_group_alloc()
724 le32_add_cpu(&cl->cl_recs[alloc_rec].c_free, in ocfs2_block_group_alloc()
726 le32_add_cpu(&cl->cl_recs[alloc_rec].c_total, in ocfs2_block_group_alloc()
728 cl->cl_recs[alloc_rec].c_blkno = bg->bg_blkno; in ocfs2_block_group_alloc()
729 if (le16_to_cpu(cl->cl_next_free_rec) < le16_to_cpu(cl->cl_count)) in ocfs2_block_group_alloc()
730 le16_add_cpu(&cl->cl_next_free_rec, 1); in ocfs2_block_group_alloc()
735 le32_add_cpu(&fe->i_clusters, le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
1439 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl) in ocfs2_find_victim_chain() argument
1443 BUG_ON(!cl->cl_next_free_rec); in ocfs2_find_victim_chain()
1446 while (curr < le16_to_cpu(cl->cl_next_free_rec)) { in ocfs2_find_victim_chain()
1447 if (le32_to_cpu(cl->cl_recs[curr].c_free) > in ocfs2_find_victim_chain()
1448 le32_to_cpu(cl->cl_recs[best].c_free)) in ocfs2_find_victim_chain()
1453 BUG_ON(best >= le16_to_cpu(cl->cl_next_free_rec)); in ocfs2_find_victim_chain()
1640 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain; in ocfs2_alloc_dinode_update_counts() local
1651 le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits); in ocfs2_alloc_dinode_update_counts()
1665 struct ocfs2_chain_list *cl; in ocfs2_rollback_alloc_dinode_counts() local
1667 cl = (struct ocfs2_chain_list *)&di->id2.i_chain; in ocfs2_rollback_alloc_dinode_counts()
1670 le32_add_cpu(&cl->cl_recs[chain].c_free, num_bits); in ocfs2_rollback_alloc_dinode_counts()
1675 struct ocfs2_chain_list *cl) in ocfs2_bg_discontig_fix_by_rec() argument
1677 unsigned int bpc = le16_to_cpu(cl->cl_bpc); in ocfs2_bg_discontig_fix_by_rec()
1700 struct ocfs2_chain_list *cl = &di->id2.i_chain; in ocfs2_bg_discontig_fix_result() local
1715 if (ocfs2_bg_discontig_fix_by_rec(res, rec, cl)) { in ocfs2_bg_discontig_fix_result()
1805 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_search_chain() local
1814 le64_to_cpu(cl->cl_recs[chain].c_blkno), in ocfs2_search_chain()
1955 struct ocfs2_chain_list *cl; in ocfs2_claim_suballoc_bits() local
1994 cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_claim_suballoc_bits()
1996 victim = ocfs2_find_victim_chain(cl); in ocfs2_claim_suballoc_bits()
2021 for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) { in ocfs2_claim_suballoc_bits()
2024 if (le32_to_cpu(cl->cl_recs[i].c_free) < bits_wanted) in ocfs2_claim_suballoc_bits()
2043 if (i == le16_to_cpu(cl->cl_next_free_rec) && in ocfs2_claim_suballoc_bits()
2558 struct ocfs2_chain_list *cl = &fe->id2.i_chain; in _ocfs2_free_suballoc_bits() local
2569 BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); in _ocfs2_free_suballoc_bits()
2606 le32_add_cpu(&cl->cl_recs[le16_to_cpu(group->bg_chain)].c_free, in _ocfs2_free_suballoc_bits()