Lines Matching refs:alloc
51 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc);
54 struct ocfs2_dinode *alloc,
58 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc);
62 struct ocfs2_dinode *alloc,
287 struct ocfs2_dinode *alloc = NULL; in ocfs2_load_local_alloc() local
321 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_load_local_alloc()
322 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_load_local_alloc()
324 if (!(le32_to_cpu(alloc->i_flags) & in ocfs2_load_local_alloc()
341 num_used = ocfs2_local_alloc_count_bits(alloc); in ocfs2_load_local_alloc()
346 || alloc->id1.bitmap1.i_used in ocfs2_load_local_alloc()
347 || alloc->id1.bitmap1.i_total in ocfs2_load_local_alloc()
351 num_used, le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_load_local_alloc()
352 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_load_local_alloc()
353 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off); in ocfs2_load_local_alloc()
386 struct ocfs2_dinode *alloc = NULL; in ocfs2_shutdown_local_alloc() local
434 alloc = (struct ocfs2_dinode *) bh->b_data; in ocfs2_shutdown_local_alloc()
441 memcpy(alloc_copy, alloc, bh->b_size); in ocfs2_shutdown_local_alloc()
450 ocfs2_clear_local_alloc(alloc); in ocfs2_shutdown_local_alloc()
494 struct ocfs2_dinode *alloc; in ocfs2_begin_local_alloc_recovery() local
525 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_begin_local_alloc_recovery()
526 ocfs2_clear_local_alloc(alloc); in ocfs2_begin_local_alloc_recovery()
528 ocfs2_compute_meta_ecc(osb->sb, alloc_bh->b_data, &alloc->i_check); in ocfs2_begin_local_alloc_recovery()
558 struct ocfs2_dinode *alloc) in ocfs2_complete_local_alloc_recovery() argument
593 status = ocfs2_sync_local_to_main(osb, handle, alloc, in ocfs2_complete_local_alloc_recovery()
630 struct ocfs2_dinode *alloc; in ocfs2_reserve_local_alloc_bits() local
661 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_reserve_local_alloc_bits()
664 if (le32_to_cpu(alloc->id1.bitmap1.i_used) != in ocfs2_reserve_local_alloc_bits()
665 ocfs2_local_alloc_count_bits(alloc)) { in ocfs2_reserve_local_alloc_bits()
667 (unsigned long long)le64_to_cpu(alloc->i_blkno), in ocfs2_reserve_local_alloc_bits()
668 le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_reserve_local_alloc_bits()
669 ocfs2_local_alloc_count_bits(alloc)); in ocfs2_reserve_local_alloc_bits()
674 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
675 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
696 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
697 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
734 struct ocfs2_dinode *alloc; in ocfs2_claim_local_alloc_bits() local
740 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_claim_local_alloc_bits()
741 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_claim_local_alloc_bits()
743 start = ocfs2_local_alloc_find_clear_bits(osb, alloc, &bits_wanted, in ocfs2_claim_local_alloc_bits()
771 le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits); in ocfs2_claim_local_alloc_bits()
790 struct ocfs2_dinode *alloc; in ocfs2_free_local_alloc_bits() local
796 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_free_local_alloc_bits()
797 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_free_local_alloc_bits()
815 le32_add_cpu(&alloc->id1.bitmap1.i_used, -num_bits); in ocfs2_free_local_alloc_bits()
822 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) in ocfs2_local_alloc_count_bits() argument
825 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_count_bits()
834 struct ocfs2_dinode *alloc, in ocfs2_local_alloc_find_clear_bits() argument
844 if (!alloc->id1.bitmap1.i_total) { in ocfs2_local_alloc_find_clear_bits()
873 bitmap = OCFS2_LOCAL_ALLOC(alloc)->la_bitmap; in ocfs2_local_alloc_find_clear_bits()
877 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_local_alloc_find_clear_bits()
916 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_find_clear_bits()
922 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc) in ocfs2_clear_local_alloc() argument
924 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_clear_local_alloc()
927 alloc->id1.bitmap1.i_total = 0; in ocfs2_clear_local_alloc()
928 alloc->id1.bitmap1.i_used = 0; in ocfs2_clear_local_alloc()
961 struct ocfs2_dinode *alloc, in ocfs2_sync_local_to_main() argument
970 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_sync_local_to_main()
973 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_sync_local_to_main()
974 le32_to_cpu(alloc->id1.bitmap1.i_used)); in ocfs2_sync_local_to_main()
976 if (!alloc->id1.bitmap1.i_total) { in ocfs2_sync_local_to_main()
980 if (le32_to_cpu(alloc->id1.bitmap1.i_used) == in ocfs2_sync_local_to_main()
981 le32_to_cpu(alloc->id1.bitmap1.i_total)) { in ocfs2_sync_local_to_main()
989 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_sync_local_to_main()
1164 struct ocfs2_dinode *alloc = NULL; in ocfs2_local_alloc_new_window() local
1167 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_new_window()
1168 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_new_window()
1171 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_new_window()
1222 alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count); in ocfs2_local_alloc_new_window()
1227 alloc->id1.bitmap1.i_used = 0; in ocfs2_local_alloc_new_window()
1228 memset(OCFS2_LOCAL_ALLOC(alloc)->la_bitmap, 0, in ocfs2_local_alloc_new_window()
1232 OCFS2_LOCAL_ALLOC(alloc)->la_bitmap); in ocfs2_local_alloc_new_window()
1235 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off, in ocfs2_local_alloc_new_window()
1236 le32_to_cpu(alloc->id1.bitmap1.i_total)); in ocfs2_local_alloc_new_window()
1253 struct ocfs2_dinode *alloc; in ocfs2_local_alloc_slide_window() local
1278 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_slide_window()
1291 memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size); in ocfs2_local_alloc_slide_window()
1302 ocfs2_clear_local_alloc(alloc); in ocfs2_local_alloc_slide_window()