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()
669 (unsigned long long)le64_to_cpu(alloc->i_blkno), in ocfs2_reserve_local_alloc_bits()
670 le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_reserve_local_alloc_bits()
671 ocfs2_local_alloc_count_bits(alloc)); in ocfs2_reserve_local_alloc_bits()
677 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
678 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
699 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
700 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
737 struct ocfs2_dinode *alloc; in ocfs2_claim_local_alloc_bits() local
743 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_claim_local_alloc_bits()
744 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_claim_local_alloc_bits()
746 start = ocfs2_local_alloc_find_clear_bits(osb, alloc, &bits_wanted, in ocfs2_claim_local_alloc_bits()
774 le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits); in ocfs2_claim_local_alloc_bits()
793 struct ocfs2_dinode *alloc; in ocfs2_free_local_alloc_bits() local
799 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_free_local_alloc_bits()
800 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_free_local_alloc_bits()
818 le32_add_cpu(&alloc->id1.bitmap1.i_used, -num_bits); in ocfs2_free_local_alloc_bits()
825 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) in ocfs2_local_alloc_count_bits() argument
828 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_count_bits()
837 struct ocfs2_dinode *alloc, in ocfs2_local_alloc_find_clear_bits() argument
847 if (!alloc->id1.bitmap1.i_total) { in ocfs2_local_alloc_find_clear_bits()
876 bitmap = OCFS2_LOCAL_ALLOC(alloc)->la_bitmap; in ocfs2_local_alloc_find_clear_bits()
880 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_local_alloc_find_clear_bits()
919 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_find_clear_bits()
925 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc) in ocfs2_clear_local_alloc() argument
927 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_clear_local_alloc()
930 alloc->id1.bitmap1.i_total = 0; in ocfs2_clear_local_alloc()
931 alloc->id1.bitmap1.i_used = 0; in ocfs2_clear_local_alloc()
964 struct ocfs2_dinode *alloc, in ocfs2_sync_local_to_main() argument
973 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_sync_local_to_main()
976 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_sync_local_to_main()
977 le32_to_cpu(alloc->id1.bitmap1.i_used)); in ocfs2_sync_local_to_main()
979 if (!alloc->id1.bitmap1.i_total) { in ocfs2_sync_local_to_main()
983 if (le32_to_cpu(alloc->id1.bitmap1.i_used) == in ocfs2_sync_local_to_main()
984 le32_to_cpu(alloc->id1.bitmap1.i_total)) { in ocfs2_sync_local_to_main()
992 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_sync_local_to_main()
1167 struct ocfs2_dinode *alloc = NULL; in ocfs2_local_alloc_new_window() local
1170 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_new_window()
1171 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_new_window()
1174 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_new_window()
1225 alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count); in ocfs2_local_alloc_new_window()
1230 alloc->id1.bitmap1.i_used = 0; in ocfs2_local_alloc_new_window()
1231 memset(OCFS2_LOCAL_ALLOC(alloc)->la_bitmap, 0, in ocfs2_local_alloc_new_window()
1235 OCFS2_LOCAL_ALLOC(alloc)->la_bitmap); in ocfs2_local_alloc_new_window()
1238 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off, in ocfs2_local_alloc_new_window()
1239 le32_to_cpu(alloc->id1.bitmap1.i_total)); in ocfs2_local_alloc_new_window()
1256 struct ocfs2_dinode *alloc; in ocfs2_local_alloc_slide_window() local
1281 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_slide_window()
1294 memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size); in ocfs2_local_alloc_slide_window()
1305 ocfs2_clear_local_alloc(alloc); in ocfs2_local_alloc_slide_window()