Lines Matching refs:alloc
35 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc);
38 struct ocfs2_dinode *alloc,
42 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc);
46 struct ocfs2_dinode *alloc,
271 struct ocfs2_dinode *alloc = NULL; in ocfs2_load_local_alloc() local
305 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_load_local_alloc()
306 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_load_local_alloc()
308 if (!(le32_to_cpu(alloc->i_flags) & in ocfs2_load_local_alloc()
325 num_used = ocfs2_local_alloc_count_bits(alloc); in ocfs2_load_local_alloc()
330 || alloc->id1.bitmap1.i_used in ocfs2_load_local_alloc()
331 || alloc->id1.bitmap1.i_total in ocfs2_load_local_alloc()
336 num_used, le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_load_local_alloc()
337 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_load_local_alloc()
338 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off); in ocfs2_load_local_alloc()
375 struct ocfs2_dinode *alloc = NULL; in ocfs2_shutdown_local_alloc() local
424 alloc = (struct ocfs2_dinode *) bh->b_data; in ocfs2_shutdown_local_alloc()
426 alloc_copy = kmemdup(alloc, bh->b_size, GFP_NOFS); in ocfs2_shutdown_local_alloc()
439 ocfs2_clear_local_alloc(alloc); in ocfs2_shutdown_local_alloc()
483 struct ocfs2_dinode *alloc; in ocfs2_begin_local_alloc_recovery() local
514 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_begin_local_alloc_recovery()
515 ocfs2_clear_local_alloc(alloc); in ocfs2_begin_local_alloc_recovery()
517 ocfs2_compute_meta_ecc(osb->sb, alloc_bh->b_data, &alloc->i_check); in ocfs2_begin_local_alloc_recovery()
547 struct ocfs2_dinode *alloc) in ocfs2_complete_local_alloc_recovery() argument
582 status = ocfs2_sync_local_to_main(osb, handle, alloc, in ocfs2_complete_local_alloc_recovery()
619 struct ocfs2_dinode *alloc; in ocfs2_reserve_local_alloc_bits() local
650 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_reserve_local_alloc_bits()
653 if (le32_to_cpu(alloc->id1.bitmap1.i_used) != in ocfs2_reserve_local_alloc_bits()
654 ocfs2_local_alloc_count_bits(alloc)) { in ocfs2_reserve_local_alloc_bits()
656 (unsigned long long)le64_to_cpu(alloc->i_blkno), in ocfs2_reserve_local_alloc_bits()
657 le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_reserve_local_alloc_bits()
658 ocfs2_local_alloc_count_bits(alloc)); in ocfs2_reserve_local_alloc_bits()
663 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
664 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
685 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
686 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
723 struct ocfs2_dinode *alloc; in ocfs2_claim_local_alloc_bits() local
729 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_claim_local_alloc_bits()
730 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_claim_local_alloc_bits()
732 start = ocfs2_local_alloc_find_clear_bits(osb, alloc, &bits_wanted, in ocfs2_claim_local_alloc_bits()
760 le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits); in ocfs2_claim_local_alloc_bits()
779 struct ocfs2_dinode *alloc; in ocfs2_free_local_alloc_bits() local
785 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_free_local_alloc_bits()
786 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_free_local_alloc_bits()
804 le32_add_cpu(&alloc->id1.bitmap1.i_used, -num_bits); in ocfs2_free_local_alloc_bits()
811 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) in ocfs2_local_alloc_count_bits() argument
814 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_count_bits()
823 struct ocfs2_dinode *alloc, in ocfs2_local_alloc_find_clear_bits() argument
833 if (!alloc->id1.bitmap1.i_total) { in ocfs2_local_alloc_find_clear_bits()
862 bitmap = OCFS2_LOCAL_ALLOC(alloc)->la_bitmap; in ocfs2_local_alloc_find_clear_bits()
865 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_local_alloc_find_clear_bits()
904 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_find_clear_bits()
910 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc) in ocfs2_clear_local_alloc() argument
912 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_clear_local_alloc()
915 alloc->id1.bitmap1.i_total = 0; in ocfs2_clear_local_alloc()
916 alloc->id1.bitmap1.i_used = 0; in ocfs2_clear_local_alloc()
949 struct ocfs2_dinode *alloc, in ocfs2_sync_local_to_main() argument
958 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_sync_local_to_main()
961 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_sync_local_to_main()
962 le32_to_cpu(alloc->id1.bitmap1.i_used)); in ocfs2_sync_local_to_main()
964 if (!alloc->id1.bitmap1.i_total) { in ocfs2_sync_local_to_main()
968 if (le32_to_cpu(alloc->id1.bitmap1.i_used) == in ocfs2_sync_local_to_main()
969 le32_to_cpu(alloc->id1.bitmap1.i_total)) { in ocfs2_sync_local_to_main()
977 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_sync_local_to_main()
1152 struct ocfs2_dinode *alloc = NULL; in ocfs2_local_alloc_new_window() local
1155 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_new_window()
1156 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_new_window()
1159 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_new_window()
1210 alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count); in ocfs2_local_alloc_new_window()
1215 alloc->id1.bitmap1.i_used = 0; in ocfs2_local_alloc_new_window()
1216 memset(OCFS2_LOCAL_ALLOC(alloc)->la_bitmap, 0, in ocfs2_local_alloc_new_window()
1220 OCFS2_LOCAL_ALLOC(alloc)->la_bitmap); in ocfs2_local_alloc_new_window()
1223 OCFS2_LOCAL_ALLOC(alloc)->la_bm_off, in ocfs2_local_alloc_new_window()
1224 le32_to_cpu(alloc->id1.bitmap1.i_total)); in ocfs2_local_alloc_new_window()
1241 struct ocfs2_dinode *alloc; in ocfs2_local_alloc_slide_window() local
1266 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_slide_window()
1273 alloc_copy = kmemdup(alloc, osb->local_alloc_bh->b_size, GFP_NOFS); in ocfs2_local_alloc_slide_window()
1289 ocfs2_clear_local_alloc(alloc); in ocfs2_local_alloc_slide_window()