Lines Matching refs:cl

84 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl);
91 struct ocfs2_chain_list *cl);
162 static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl) in ocfs2_bits_per_group() argument
164 return (u32)le16_to_cpu(cl->cl_cpg) * (u32)le16_to_cpu(cl->cl_bpc); in ocfs2_bits_per_group()
338 struct ocfs2_chain_list *cl, in ocfs2_bg_discontig_add_extent() argument
350 le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
352 le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
354 clusters * le16_to_cpu(cl->cl_bpc)); in ocfs2_bg_discontig_add_extent()
364 struct ocfs2_chain_list *cl) in ocfs2_block_group_fill() argument
394 bg->bg_next_group = cl->cl_recs[my_chain].c_blkno; in ocfs2_block_group_fill()
397 if (group_clusters == le16_to_cpu(cl->cl_cpg)) in ocfs2_block_group_fill()
398 bg->bg_bits = cpu_to_le16(ocfs2_bits_per_group(cl)); in ocfs2_block_group_fill()
400 ocfs2_bg_discontig_add_extent(osb, bg, cl, group_blkno, in ocfs2_block_group_fill()
420 static inline u16 ocfs2_find_smallest_chain(struct ocfs2_chain_list *cl) in ocfs2_find_smallest_chain() argument
425 while (curr < le16_to_cpu(cl->cl_count)) { in ocfs2_find_smallest_chain()
426 if (le32_to_cpu(cl->cl_recs[best].c_total) > in ocfs2_find_smallest_chain()
427 le32_to_cpu(cl->cl_recs[curr].c_total)) in ocfs2_find_smallest_chain()
438 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_contig() argument
444 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_contig()
447 le16_to_cpu(cl->cl_cpg), &bit_off, in ocfs2_block_group_alloc_contig()
469 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_contig()
503 struct ocfs2_chain_list *cl, in ocfs2_block_group_grow_discontig() argument
510 unsigned int needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
511 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
538 ocfs2_bg_discontig_add_extent(osb, bg, cl, p_blkno, in ocfs2_block_group_grow_discontig()
542 needed = le16_to_cpu(cl->cl_cpg) - in ocfs2_block_group_grow_discontig()
543 le16_to_cpu(bg->bg_bits) / le16_to_cpu(cl->cl_bpc); in ocfs2_block_group_grow_discontig()
595 struct ocfs2_chain_list *cl) in ocfs2_block_group_alloc_discontig() argument
600 unsigned int min_bits = le16_to_cpu(cl->cl_cpg) >> 1; in ocfs2_block_group_alloc_discontig()
602 unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); in ocfs2_block_group_alloc_discontig()
649 bg_blkno, num_bits, alloc_rec, cl); in ocfs2_block_group_alloc_discontig()
656 bg_bh, ac, cl, min_bits); in ocfs2_block_group_alloc_discontig()
678 struct ocfs2_chain_list *cl; in ocfs2_block_group_alloc() local
687 cl = &fe->id2.i_chain; in ocfs2_block_group_alloc()
689 le16_to_cpu(cl->cl_cpg), in ocfs2_block_group_alloc()
698 le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
714 ac, cl); in ocfs2_block_group_alloc()
718 ac, cl); in ocfs2_block_group_alloc()
736 le32_add_cpu(&cl->cl_recs[alloc_rec].c_free, in ocfs2_block_group_alloc()
738 le32_add_cpu(&cl->cl_recs[alloc_rec].c_total, in ocfs2_block_group_alloc()
740 cl->cl_recs[alloc_rec].c_blkno = bg->bg_blkno; in ocfs2_block_group_alloc()
741 if (le16_to_cpu(cl->cl_next_free_rec) < le16_to_cpu(cl->cl_count)) in ocfs2_block_group_alloc()
742 le16_add_cpu(&cl->cl_next_free_rec, 1); in ocfs2_block_group_alloc()
747 le32_add_cpu(&fe->i_clusters, le16_to_cpu(cl->cl_cpg)); in ocfs2_block_group_alloc()
1373 static inline u16 ocfs2_find_victim_chain(struct ocfs2_chain_list *cl) in ocfs2_find_victim_chain() argument
1377 BUG_ON(!cl->cl_next_free_rec); in ocfs2_find_victim_chain()
1380 while (curr < le16_to_cpu(cl->cl_next_free_rec)) { in ocfs2_find_victim_chain()
1381 if (le32_to_cpu(cl->cl_recs[curr].c_free) > in ocfs2_find_victim_chain()
1382 le32_to_cpu(cl->cl_recs[best].c_free)) in ocfs2_find_victim_chain()
1387 BUG_ON(best >= le16_to_cpu(cl->cl_next_free_rec)); in ocfs2_find_victim_chain()
1576 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain; in ocfs2_alloc_dinode_update_counts() local
1587 le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits); in ocfs2_alloc_dinode_update_counts()
1601 struct ocfs2_chain_list *cl; in ocfs2_rollback_alloc_dinode_counts() local
1603 cl = (struct ocfs2_chain_list *)&di->id2.i_chain; in ocfs2_rollback_alloc_dinode_counts()
1606 le32_add_cpu(&cl->cl_recs[chain].c_free, num_bits); in ocfs2_rollback_alloc_dinode_counts()
1611 struct ocfs2_chain_list *cl) in ocfs2_bg_discontig_fix_by_rec() argument
1613 unsigned int bpc = le16_to_cpu(cl->cl_bpc); in ocfs2_bg_discontig_fix_by_rec()
1636 struct ocfs2_chain_list *cl = &di->id2.i_chain; in ocfs2_bg_discontig_fix_result() local
1651 if (ocfs2_bg_discontig_fix_by_rec(res, rec, cl)) { in ocfs2_bg_discontig_fix_result()
1739 struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_search_chain() local
1748 le64_to_cpu(cl->cl_recs[chain].c_blkno), in ocfs2_search_chain()
1876 struct ocfs2_chain_list *cl; in ocfs2_claim_suballoc_bits() local
1915 cl = (struct ocfs2_chain_list *) &fe->id2.i_chain; in ocfs2_claim_suballoc_bits()
1917 victim = ocfs2_find_victim_chain(cl); in ocfs2_claim_suballoc_bits()
1941 for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) { in ocfs2_claim_suballoc_bits()
1944 if (!cl->cl_recs[i].c_free) in ocfs2_claim_suballoc_bits()
2446 struct ocfs2_chain_list *cl = &fe->id2.i_chain; in _ocfs2_free_suballoc_bits() local
2456 BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); in _ocfs2_free_suballoc_bits()
2490 le32_add_cpu(&cl->cl_recs[le16_to_cpu(group->bg_chain)].c_free, in _ocfs2_free_suballoc_bits()