Lines Matching refs:ucpi
42 struct ufs_cg_private_info * ucpi; in ufs_free_fragments() local
66 ucpi = ufs_load_cylinder (sb, cgno); in ufs_free_fragments()
67 if (!ucpi) in ufs_free_fragments()
69 ucg = ubh_get_ucg (UCPI_UBH(ucpi)); in ufs_free_fragments()
77 blkmap = ubh_blkmap (UCPI_UBH(ucpi), ucpi->c_freeoff, bbase); in ufs_free_fragments()
80 if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_freeoff, i)) in ufs_free_fragments()
81 ubh_setbit (UCPI_UBH(ucpi), ucpi->c_freeoff, i); in ufs_free_fragments()
90 blkmap = ubh_blkmap (UCPI_UBH(ucpi), ucpi->c_freeoff, bbase); in ufs_free_fragments()
97 if (ubh_isblockset(UCPI_UBH(ucpi), ucpi->c_freeoff, blkno)) { in ufs_free_fragments()
102 ufs_clusteracct (sb, ucpi, blkno, 1); in ufs_free_fragments()
109 fs16_add(sb, &ubh_cg_blks(ucpi, cylno, in ufs_free_fragments()
111 fs32_add(sb, &ubh_cg_blktot(ucpi, cylno), 1); in ufs_free_fragments()
116 ubh_mark_buffer_dirty (UCPI_UBH(ucpi)); in ufs_free_fragments()
118 ubh_sync_block(UCPI_UBH(ucpi)); in ufs_free_fragments()
139 struct ufs_cg_private_info * ucpi; in ufs_free_blocks() local
175 ucpi = ufs_load_cylinder (sb, cgno); in ufs_free_blocks()
176 if (!ucpi) in ufs_free_blocks()
178 ucg = ubh_get_ucg (UCPI_UBH(ucpi)); in ufs_free_blocks()
186 if (ubh_isblockset(UCPI_UBH(ucpi), ucpi->c_freeoff, blkno)) { in ufs_free_blocks()
189 ubh_setblock(UCPI_UBH(ucpi), ucpi->c_freeoff, blkno); in ufs_free_blocks()
191 ufs_clusteracct (sb, ucpi, blkno, 1); in ufs_free_blocks()
200 fs16_add(sb, &ubh_cg_blks(ucpi, cylno, in ufs_free_blocks()
202 fs32_add(sb, &ubh_cg_blktot(ucpi, cylno), 1); in ufs_free_blocks()
207 ubh_mark_buffer_dirty (UCPI_UBH(ucpi)); in ufs_free_blocks()
209 ubh_sync_block(UCPI_UBH(ucpi)); in ufs_free_blocks()
502 struct ufs_cg_private_info * ucpi; in ufs_add_fragments() local
519 ucpi = ufs_load_cylinder (sb, cgno); in ufs_add_fragments()
520 if (!ucpi) in ufs_add_fragments()
522 ucg = ubh_get_ucg (UCPI_UBH(ucpi)); in ufs_add_fragments()
532 if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i)) in ufs_add_fragments()
539 if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i)) in ufs_add_fragments()
549 ubh_clrbit (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i); in ufs_add_fragments()
556 ubh_mark_buffer_dirty (UCPI_UBH(ucpi)); in ufs_add_fragments()
558 ubh_sync_block(UCPI_UBH(ucpi)); in ufs_add_fragments()
580 struct ufs_cg_private_info * ucpi; in ufs_alloc_fragments() local
624 ucpi = ufs_load_cylinder (sb, cgno); in ufs_alloc_fragments()
625 if (!ucpi) in ufs_alloc_fragments()
627 ucg = ubh_get_ucg (UCPI_UBH(ucpi)); in ufs_alloc_fragments()
634 result = ufs_alloccg_block (inode, ucpi, goal, err); in ufs_alloc_fragments()
645 result = ufs_alloccg_block (inode, ucpi, goal, err); in ufs_alloc_fragments()
650 ubh_setbit (UCPI_UBH(ucpi), ucpi->c_freeoff, goal + i); in ufs_alloc_fragments()
660 result = ufs_bitmap_search (sb, ucpi, goal, allocsize); in ufs_alloc_fragments()
664 ubh_clrbit (UCPI_UBH(ucpi), ucpi->c_freeoff, result + i); in ufs_alloc_fragments()
676 ubh_mark_buffer_dirty (UCPI_UBH(ucpi)); in ufs_alloc_fragments()
678 ubh_sync_block(UCPI_UBH(ucpi)); in ufs_alloc_fragments()
687 struct ufs_cg_private_info *ucpi, in ufs_alloccg_block() argument
701 ucg = ubh_get_ucg(UCPI_UBH(ucpi)); in ufs_alloccg_block()
704 goal = ucpi->c_rotor; in ufs_alloccg_block()
713 if (ubh_isblockset(UCPI_UBH(ucpi), ucpi->c_freeoff, ufs_fragstoblks(goal))) { in ufs_alloccg_block()
719 result = ufs_bitmap_search (sb, ucpi, goal, uspi->s_fpb); in ufs_alloccg_block()
722 ucpi->c_rotor = result; in ufs_alloccg_block()
725 ubh_clrblock (UCPI_UBH(ucpi), ucpi->c_freeoff, blkno); in ufs_alloccg_block()
727 ufs_clusteracct (sb, ucpi, blkno, -1); in ufs_alloccg_block()
731 fs32_sub(sb, &UFS_SB(sb)->fs_cs(ucpi->c_cgx).cs_nbfree, 1); in ufs_alloccg_block()
736 fs16_sub(sb, &ubh_cg_blks(ucpi, cylno, in ufs_alloccg_block()
738 fs32_sub(sb, &ubh_cg_blktot(ucpi, cylno), 1); in ufs_alloccg_block()
782 struct ufs_cg_private_info *ucpi, in ufs_bitmap_search() argument
802 UFSD("ENTER, cg %u, goal %llu, count %u\n", ucpi->c_cgx, in ufs_bitmap_search()
806 ucg = ubh_get_ucg(UCPI_UBH(ucpi)); in ufs_bitmap_search()
811 start = ucpi->c_frotor >> 3; in ufs_bitmap_search()
814 loc = ubh_scanc(uspi, UCPI_UBH(ucpi), ucpi->c_freeoff + start, length, in ufs_bitmap_search()
819 loc = ubh_scanc(uspi, UCPI_UBH(ucpi), ucpi->c_freeoff, length, in ufs_bitmap_search()
827 ucpi->c_cgx, start, length, count, in ufs_bitmap_search()
828 ucpi->c_freeoff); in ufs_bitmap_search()
834 ucpi->c_frotor = result; in ufs_bitmap_search()
841 blockmap = ubh_blkmap(UCPI_UBH(ucpi), ucpi->c_freeoff, result); in ufs_bitmap_search()
857 ucpi->c_cgx); in ufs_bitmap_search()
863 struct ufs_cg_private_info * ucpi, unsigned blkno, int cnt) in ufs_clusteracct() argument
873 ubh_setbit(UCPI_UBH(ucpi), ucpi->c_clusteroff, blkno); in ufs_clusteracct()
875 ubh_clrbit(UCPI_UBH(ucpi), ucpi->c_clusteroff, blkno); in ufs_clusteracct()
882 if ( end >= ucpi->c_nclusterblks) in ufs_clusteracct()
883 end = ucpi->c_nclusterblks; in ufs_clusteracct()
884 i = ubh_find_next_zero_bit (UCPI_UBH(ucpi), ucpi->c_clusteroff, end, start); in ufs_clusteracct()
896 i = ubh_find_last_zero_bit (UCPI_UBH(ucpi), ucpi->c_clusteroff, start, end); in ufs_clusteracct()
908 fs32_add(sb, (__fs32*)ubh_get_addr(UCPI_UBH(ucpi), ucpi->c_clustersumoff + (i << 2)), cnt); in ufs_clusteracct()
910 fs32_sub(sb, (__fs32*)ubh_get_addr(UCPI_UBH(ucpi), ucpi->c_clustersumoff + (back << 2)), cnt); in ufs_clusteracct()
912 fs32_sub(sb, (__fs32*)ubh_get_addr(UCPI_UBH(ucpi), ucpi->c_clustersumoff + (forw << 2)), cnt); in ufs_clusteracct()