Lines Matching refs:cl

66 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl);
73 struct ocfs2_chain_list *cl);
144 static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl) in ocfs2_bits_per_group() argument
146 return (u32)le16_to_cpu(cl->cl_cpg) * (u32)le16_to_cpu(cl->cl_bpc); in ocfs2_bits_per_group()
320 struct ocfs2_chain_list *cl, in ocfs2_bg_discontig_add_extent() argument
332 le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
334 le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
336 clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
346 struct ocfs2_chain_list *cl) in ocfs2_block_group_fill() argument
376 bg->bg_next_group = cl->cl_recs[my_chain].c_blkno; in ocfs2_block_group_fill()
379 if (group_clusters == le16_to_cpu(cl->cl_cpg)) in ocfs2_block_group_fill()
380 bg->bg_bits = cpu_to_le16(ocfs2_bits_per_group(cl)); in ocfs2_block_group_fill()
382 ocfs2_bg_discontig_add_extent(osb, bg, cl, group_blkno, in ocfs2_block_group_fill()
402 static inline u16 ocfs2_find_smallest_chain(struct ocfs2_chain_list *cl) in ocfs2_find_smallest_chain() argument
407 while (curr < le16_to_cpu(cl->cl_count)) { in ocfs2_find_smallest_chain()
408 if (le32_to_cpu(cl->cl_recs[best].c_total) > in ocfs2_find_smallest_chain()
409 le32_to_cpu(cl->cl_recs[curr].c_total)) in ocfs2_find_smallest_chain()
420 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_contig() argument
426 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_contig()
429 le16_to_cpu(cl->cl_cpg), &bit_off, in ocfs2_block_group_alloc_contig()
451 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_contig()
485 struct ocfs2_chain_list *cl, in ocfs2_block_group_grow_discontig() argument
492 unsigned int needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
493 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
520 ocfs2_bg_discontig_add_extent(osb, bg, cl, p_blkno, in ocfs2_block_group_grow_discontig()
524 needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
525 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
577 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_discontig() argument
582 unsigned int min_bits = le16_to_cpu(cl->cl_cpg) >> 1; in ocfs2_block_group_alloc_discontig()
584 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_discontig()
631 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_discontig()
638 bg_bh, ac, cl, min_bits); in ocfs2_block_group_alloc_discontig()
660 struct ocfs2_chain_list *cl; in ocfs2_block_group_alloc() local
669 cl = &fe->id2.i_chain; in ocfs2_block_group_alloc()
671 le16_to_cpu(cl->cl_cpg), in ocfs2_block_group_alloc()
680 le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
696 ac, cl); in ocfs2_block_group_alloc()
700 ac, cl); in ocfs2_block_group_alloc()
718 le32_add_cpu(&cl->cl_recs[alloc_rec].c_free, in ocfs2_block_group_alloc()
720 le32_add_cpu(&cl->cl_recs[alloc_rec].c_total, in ocfs2_block_group_alloc()
722 cl->cl_recs[alloc_rec].c_blkno = bg->bg_blkno; in ocfs2_block_group_alloc()
723 if (le16_to_cpu(cl->cl_next_free_rec) < le16_to_cpu(cl->cl_count)) in ocfs2_block_group_alloc()
724 le16_add_cpu(&cl->cl_next_free_rec, 1); in ocfs2_block_group_alloc()
729 le32_add_cpu(&fe->i_clusters, le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
1383 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl) in ocfs2_find_victim_chain() argument
1387 BUG_ON(!cl->cl_next_free_rec); in ocfs2_find_victim_chain()
1390 while (curr < le16_to_cpu(cl->cl_next_free_rec)) { in ocfs2_find_victim_chain()
1391 if (le32_to_cpu(cl->cl_recs[curr].c_free) > in ocfs2_find_victim_chain()
1392 le32_to_cpu(cl->cl_recs[best].c_free)) in ocfs2_find_victim_chain()
1397 BUG_ON(best >= le16_to_cpu(cl->cl_next_free_rec)); in ocfs2_find_victim_chain()
1586 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain; in ocfs2_alloc_dinode_update_counts() local
1597 le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits); in ocfs2_alloc_dinode_update_counts()
1611 struct ocfs2_chain_list *cl; in ocfs2_rollback_alloc_dinode_counts() local
1613 cl = (struct ocfs2_chain_list *)&di->id2.i_chain; in ocfs2_rollback_alloc_dinode_counts()
1616 le32_add_cpu(&cl->cl_recs[chain].c_free, num_bits); in ocfs2_rollback_alloc_dinode_counts()
1621 struct ocfs2_chain_list *cl) in ocfs2_bg_discontig_fix_by_rec() argument
1623 unsigned int bpc = le16_to_cpu(cl->cl_bpc); in ocfs2_bg_discontig_fix_by_rec()
1646 struct ocfs2_chain_list *cl = &di->id2.i_chain; in ocfs2_bg_discontig_fix_result() local
1661 if (ocfs2_bg_discontig_fix_by_rec(res, rec, cl)) { in ocfs2_bg_discontig_fix_result()
1749 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_search_chain() local
1758 le64_to_cpu(cl->cl_recs[chain].c_blkno), in ocfs2_search_chain()
1886 struct ocfs2_chain_list *cl; in ocfs2_claim_suballoc_bits() local
1925 cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_claim_suballoc_bits()
1927 victim = ocfs2_find_victim_chain(cl); in ocfs2_claim_suballoc_bits()
1951 for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) { in ocfs2_claim_suballoc_bits()
1954 if (!cl->cl_recs[i].c_free) in ocfs2_claim_suballoc_bits()
2459 struct ocfs2_chain_list *cl = &fe->id2.i_chain; in _ocfs2_free_suballoc_bits() local
2469 BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); in _ocfs2_free_suballoc_bits()
2503 le32_add_cpu(&cl->cl_recs[le16_to_cpu(group->bg_chain)].c_free, in _ocfs2_free_suballoc_bits()