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,
272 struct ocfs2_dinode *alloc = NULL; in ocfs2_load_local_alloc() local
306 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_load_local_alloc()
307 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_load_local_alloc()
309 if (!(le32_to_cpu(alloc->i_flags) & in ocfs2_load_local_alloc()
326 num_used = ocfs2_local_alloc_count_bits(alloc); in ocfs2_load_local_alloc()
331 || alloc->id1.bitmap1.i_used in ocfs2_load_local_alloc()
332 || alloc->id1.bitmap1.i_total in ocfs2_load_local_alloc()
337 num_used, le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_load_local_alloc()
338 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_load_local_alloc()
339 le32_to_cpu(OCFS2_LOCAL_ALLOC(alloc)->la_bm_off)); in ocfs2_load_local_alloc()
376 struct ocfs2_dinode *alloc = NULL; in ocfs2_shutdown_local_alloc() local
425 alloc = (struct ocfs2_dinode *) bh->b_data; in ocfs2_shutdown_local_alloc()
427 alloc_copy = kmemdup(alloc, bh->b_size, GFP_NOFS); in ocfs2_shutdown_local_alloc()
440 ocfs2_clear_local_alloc(alloc); in ocfs2_shutdown_local_alloc()
484 struct ocfs2_dinode *alloc; in ocfs2_begin_local_alloc_recovery() local
515 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; in ocfs2_begin_local_alloc_recovery()
516 ocfs2_clear_local_alloc(alloc); in ocfs2_begin_local_alloc_recovery()
518 ocfs2_compute_meta_ecc(osb->sb, alloc_bh->b_data, &alloc->i_check); in ocfs2_begin_local_alloc_recovery()
548 struct ocfs2_dinode *alloc) in ocfs2_complete_local_alloc_recovery() argument
583 status = ocfs2_sync_local_to_main(osb, handle, alloc, in ocfs2_complete_local_alloc_recovery()
620 struct ocfs2_dinode *alloc; in ocfs2_reserve_local_alloc_bits() local
651 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_reserve_local_alloc_bits()
654 if (le32_to_cpu(alloc->id1.bitmap1.i_used) != in ocfs2_reserve_local_alloc_bits()
655 ocfs2_local_alloc_count_bits(alloc)) { in ocfs2_reserve_local_alloc_bits()
657 (unsigned long long)le64_to_cpu(alloc->i_blkno), in ocfs2_reserve_local_alloc_bits()
658 le32_to_cpu(alloc->id1.bitmap1.i_used), in ocfs2_reserve_local_alloc_bits()
659 ocfs2_local_alloc_count_bits(alloc)); in ocfs2_reserve_local_alloc_bits()
664 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
665 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
686 free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) - in ocfs2_reserve_local_alloc_bits()
687 le32_to_cpu(alloc->id1.bitmap1.i_used); in ocfs2_reserve_local_alloc_bits()
724 struct ocfs2_dinode *alloc; in ocfs2_claim_local_alloc_bits() local
730 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_claim_local_alloc_bits()
731 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_claim_local_alloc_bits()
733 start = ocfs2_local_alloc_find_clear_bits(osb, alloc, &bits_wanted, in ocfs2_claim_local_alloc_bits()
761 le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits); in ocfs2_claim_local_alloc_bits()
780 struct ocfs2_dinode *alloc; in ocfs2_free_local_alloc_bits() local
786 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_free_local_alloc_bits()
787 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_free_local_alloc_bits()
805 le32_add_cpu(&alloc->id1.bitmap1.i_used, -num_bits); in ocfs2_free_local_alloc_bits()
812 static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) in ocfs2_local_alloc_count_bits() argument
815 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_count_bits()
824 struct ocfs2_dinode *alloc, in ocfs2_local_alloc_find_clear_bits() argument
834 if (!alloc->id1.bitmap1.i_total) { in ocfs2_local_alloc_find_clear_bits()
863 bitmap = OCFS2_LOCAL_ALLOC(alloc)->la_bitmap; in ocfs2_local_alloc_find_clear_bits()
866 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_local_alloc_find_clear_bits()
899 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_find_clear_bits()
905 static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc) in ocfs2_clear_local_alloc() argument
907 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_clear_local_alloc()
910 alloc->id1.bitmap1.i_total = 0; in ocfs2_clear_local_alloc()
911 alloc->id1.bitmap1.i_used = 0; in ocfs2_clear_local_alloc()
944 struct ocfs2_dinode *alloc, in ocfs2_sync_local_to_main() argument
953 struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_sync_local_to_main()
956 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_sync_local_to_main()
957 le32_to_cpu(alloc->id1.bitmap1.i_used)); in ocfs2_sync_local_to_main()
959 if (!alloc->id1.bitmap1.i_total) { in ocfs2_sync_local_to_main()
963 if (le32_to_cpu(alloc->id1.bitmap1.i_used) == in ocfs2_sync_local_to_main()
964 le32_to_cpu(alloc->id1.bitmap1.i_total)) { in ocfs2_sync_local_to_main()
972 left = le32_to_cpu(alloc->id1.bitmap1.i_total); in ocfs2_sync_local_to_main()
1165 struct ocfs2_dinode *alloc = NULL; in ocfs2_local_alloc_new_window() local
1168 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_new_window()
1169 la = OCFS2_LOCAL_ALLOC(alloc); in ocfs2_local_alloc_new_window()
1172 le32_to_cpu(alloc->id1.bitmap1.i_total), in ocfs2_local_alloc_new_window()
1223 alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count); in ocfs2_local_alloc_new_window()
1228 alloc->id1.bitmap1.i_used = 0; in ocfs2_local_alloc_new_window()
1229 memset(OCFS2_LOCAL_ALLOC(alloc)->la_bitmap, 0, in ocfs2_local_alloc_new_window()
1233 OCFS2_LOCAL_ALLOC(alloc)->la_bitmap); in ocfs2_local_alloc_new_window()
1236 le32_to_cpu(OCFS2_LOCAL_ALLOC(alloc)->la_bm_off), in ocfs2_local_alloc_new_window()
1237 le32_to_cpu(alloc->id1.bitmap1.i_total)); in ocfs2_local_alloc_new_window()
1254 struct ocfs2_dinode *alloc; in ocfs2_local_alloc_slide_window() local
1279 alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; in ocfs2_local_alloc_slide_window()
1286 alloc_copy = kmemdup(alloc, osb->local_alloc_bh->b_size, GFP_NOFS); in ocfs2_local_alloc_slide_window()
1302 ocfs2_clear_local_alloc(alloc); in ocfs2_local_alloc_slide_window()