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()
387 struct ocfs2_dinode *alloc = NULL; in ocfs2_shutdown_local_alloc() local
435 alloc = (struct ocfs2_dinode *) bh->b_data; in ocfs2_shutdown_local_alloc()
442 memcpy(alloc_copy, alloc, bh->b_size); in ocfs2_shutdown_local_alloc()
451 ocfs2_clear_local_alloc(alloc); in ocfs2_shutdown_local_alloc()
496 struct ocfs2_dinode *alloc; in ocfs2_begin_local_alloc_recovery() local
527 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_begin_local_alloc_recovery()
528 ocfs2_clear_local_alloc(alloc); in ocfs2_begin_local_alloc_recovery()
530 ocfs2_compute_meta_ecc(osb->sb, alloc_bh->b_data, &alloc->i_check); in ocfs2_begin_local_alloc_recovery()
560 struct ocfs2_dinode *alloc) in ocfs2_complete_local_alloc_recovery() argument
595 status = ocfs2_sync_local_to_main(osb, handle, alloc, in ocfs2_complete_local_alloc_recovery()
632 struct ocfs2_dinode *alloc; in ocfs2_reserve_local_alloc_bits() local
663 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_reserve_local_alloc_bits()
666 if (le32_to_cpu(alloc->id1.bitmap1.i_used) != in ocfs2_reserve_local_alloc_bits()
667 ocfs2_local_alloc_count_bits(alloc)) { in ocfs2_reserve_local_alloc_bits()
670 (unsigned long long)le64_to_cpu(alloc->i_blkno), in ocfs2_reserve_local_alloc_bits()
671 le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_reserve_local_alloc_bits()
672 ocfs2_local_alloc_count_bits(alloc)); in ocfs2_reserve_local_alloc_bits()
678 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
679 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
700 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
701 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
738 struct ocfs2_dinode *alloc; in ocfs2_claim_local_alloc_bits() local
744 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_claim_local_alloc_bits()
745 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_claim_local_alloc_bits()
747 start = ocfs2_local_alloc_find_clear_bits(osb, alloc, &bits_wanted, in ocfs2_claim_local_alloc_bits()
775 le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits); in ocfs2_claim_local_alloc_bits()
794 struct ocfs2_dinode *alloc; in ocfs2_free_local_alloc_bits() local
800 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_free_local_alloc_bits()
801 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_free_local_alloc_bits()
819 le32_add_cpu(&alloc->id1.bitmap1.i_used, -num_bits); in ocfs2_free_local_alloc_bits()
826 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) in ocfs2_local_alloc_count_bits() argument
829 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_count_bits()
838 struct ocfs2_dinode *alloc, in ocfs2_local_alloc_find_clear_bits() argument
848 if (!alloc->id1.bitmap1.i_total) { in ocfs2_local_alloc_find_clear_bits()
877 bitmap = OCFS2_LOCAL_ALLOC(alloc)->la_bitmap; in ocfs2_local_alloc_find_clear_bits()
881 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_local_alloc_find_clear_bits()
920 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_find_clear_bits()
926 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc) in ocfs2_clear_local_alloc() argument
928 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_clear_local_alloc()
931 alloc->id1.bitmap1.i_total = 0; in ocfs2_clear_local_alloc()
932 alloc->id1.bitmap1.i_used = 0; in ocfs2_clear_local_alloc()
965 struct ocfs2_dinode *alloc, in ocfs2_sync_local_to_main() argument
974 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_sync_local_to_main()
977 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_sync_local_to_main()
978 le32_to_cpu(alloc->id1.bitmap1.i_used)); in ocfs2_sync_local_to_main()
980 if (!alloc->id1.bitmap1.i_total) { in ocfs2_sync_local_to_main()
984 if (le32_to_cpu(alloc->id1.bitmap1.i_used) == in ocfs2_sync_local_to_main()
985 le32_to_cpu(alloc->id1.bitmap1.i_total)) { in ocfs2_sync_local_to_main()
993 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_sync_local_to_main()
1168 struct ocfs2_dinode *alloc = NULL; in ocfs2_local_alloc_new_window() local
1171 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_new_window()
1172 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_new_window()
1175 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_new_window()
1226 alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count); in ocfs2_local_alloc_new_window()
1231 alloc->id1.bitmap1.i_used = 0; in ocfs2_local_alloc_new_window()
1232 memset(OCFS2_LOCAL_ALLOC(alloc)->la_bitmap, 0, in ocfs2_local_alloc_new_window()
1236 OCFS2_LOCAL_ALLOC(alloc)->la_bitmap); in ocfs2_local_alloc_new_window()
1239 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off, in ocfs2_local_alloc_new_window()
1240 le32_to_cpu(alloc->id1.bitmap1.i_total)); in ocfs2_local_alloc_new_window()
1257 struct ocfs2_dinode *alloc; in ocfs2_local_alloc_slide_window() local
1282 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_slide_window()
1295 memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size); in ocfs2_local_alloc_slide_window()
1306 ocfs2_clear_local_alloc(alloc); in ocfs2_local_alloc_slide_window()