Lines Matching refs:ucpi

43 	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()
91 blkmap = ubh_blkmap (UCPI_UBH(ucpi), ucpi->c_freeoff, bbase); in ufs_free_fragments()
98 if (ubh_isblockset(UCPI_UBH(ucpi), ucpi->c_freeoff, blkno)) { in ufs_free_fragments()
103 ufs_clusteracct (sb, ucpi, blkno, 1); in ufs_free_fragments()
110 fs16_add(sb, &ubh_cg_blks(ucpi, cylno, in ufs_free_fragments()
112 fs32_add(sb, &ubh_cg_blktot(ucpi, cylno), 1); in ufs_free_fragments()
117 ubh_mark_buffer_dirty (UCPI_UBH(ucpi)); in ufs_free_fragments()
119 ubh_sync_block(UCPI_UBH(ucpi)); in ufs_free_fragments()
139 struct ufs_cg_private_info * ucpi; in ufs_free_blocks() local
174 ucpi = ufs_load_cylinder (sb, cgno); in ufs_free_blocks()
175 if (!ucpi) in ufs_free_blocks()
177 ucg = ubh_get_ucg (UCPI_UBH(ucpi)); in ufs_free_blocks()
185 if (ubh_isblockset(UCPI_UBH(ucpi), ucpi->c_freeoff, blkno)) { in ufs_free_blocks()
188 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()
509 struct ufs_cg_private_info * ucpi; in ufs_add_fragments() local
525 ucpi = ufs_load_cylinder (sb, cgno); in ufs_add_fragments()
526 if (!ucpi) in ufs_add_fragments()
528 ucg = ubh_get_ucg (UCPI_UBH(ucpi)); in ufs_add_fragments()
538 if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i)) in ufs_add_fragments()
548 if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i)) in ufs_add_fragments()
558 ubh_clrbit (UCPI_UBH(ucpi), ucpi->c_freeoff, fragno + i); in ufs_add_fragments()
565 ubh_mark_buffer_dirty (UCPI_UBH(ucpi)); in ufs_add_fragments()
567 ubh_sync_block(UCPI_UBH(ucpi)); in ufs_add_fragments()
588 struct ufs_cg_private_info * ucpi; in ufs_alloc_fragments() local
631 ucpi = ufs_load_cylinder (sb, cgno); in ufs_alloc_fragments()
632 if (!ucpi) in ufs_alloc_fragments()
634 ucg = ubh_get_ucg (UCPI_UBH(ucpi)); in ufs_alloc_fragments()
641 result = ufs_alloccg_block (inode, ucpi, goal, err); in ufs_alloc_fragments()
652 result = ufs_alloccg_block (inode, ucpi, goal, err); in ufs_alloc_fragments()
657 ubh_setbit (UCPI_UBH(ucpi), ucpi->c_freeoff, goal + i); in ufs_alloc_fragments()
668 result = ufs_bitmap_search (sb, ucpi, goal, allocsize); in ufs_alloc_fragments()
674 ubh_clrbit (UCPI_UBH(ucpi), ucpi->c_freeoff, result + i); in ufs_alloc_fragments()
686 ubh_mark_buffer_dirty (UCPI_UBH(ucpi)); in ufs_alloc_fragments()
688 ubh_sync_block(UCPI_UBH(ucpi)); in ufs_alloc_fragments()
697 struct ufs_cg_private_info *ucpi, in ufs_alloccg_block() argument
709 ucg = ubh_get_ucg(UCPI_UBH(ucpi)); in ufs_alloccg_block()
712 goal = ucpi->c_rotor; in ufs_alloccg_block()
721 if (ubh_isblockset(UCPI_UBH(ucpi), ucpi->c_freeoff, ufs_fragstoblks(goal))) { in ufs_alloccg_block()
727 result = ufs_bitmap_search (sb, ucpi, goal, uspi->s_fpb); in ufs_alloccg_block()
730 ucpi->c_rotor = result; in ufs_alloccg_block()
735 ubh_clrblock (UCPI_UBH(ucpi), ucpi->c_freeoff, blkno); in ufs_alloccg_block()
737 ufs_clusteracct (sb, ucpi, blkno, -1); in ufs_alloccg_block()
741 fs32_sub(sb, &UFS_SB(sb)->fs_cs(ucpi->c_cgx).cs_nbfree, 1); in ufs_alloccg_block()
746 fs16_sub(sb, &ubh_cg_blks(ucpi, cylno, in ufs_alloccg_block()
748 fs32_sub(sb, &ubh_cg_blktot(ucpi, cylno), 1); in ufs_alloccg_block()
792 struct ufs_cg_private_info *ucpi, in ufs_bitmap_search() argument
810 UFSD("ENTER, cg %u, goal %llu, count %u\n", ucpi->c_cgx, in ufs_bitmap_search()
816 start = ucpi->c_frotor >> 3; in ufs_bitmap_search()
819 loc = ubh_scanc(uspi, UCPI_UBH(ucpi), ucpi->c_freeoff + start, length, in ufs_bitmap_search()
824 loc = ubh_scanc(uspi, UCPI_UBH(ucpi), ucpi->c_freeoff, length, in ufs_bitmap_search()
832 ucpi->c_cgx, start, length, count, in ufs_bitmap_search()
833 ucpi->c_freeoff); in ufs_bitmap_search()
839 ucpi->c_frotor = result; in ufs_bitmap_search()
846 blockmap = ubh_blkmap(UCPI_UBH(ucpi), ucpi->c_freeoff, result); in ufs_bitmap_search()
862 ucpi->c_cgx); in ufs_bitmap_search()
868 struct ufs_cg_private_info * ucpi, unsigned blkno, int cnt) in ufs_clusteracct() argument
878 ubh_setbit(UCPI_UBH(ucpi), ucpi->c_clusteroff, blkno); in ufs_clusteracct()
880 ubh_clrbit(UCPI_UBH(ucpi), ucpi->c_clusteroff, blkno); in ufs_clusteracct()
887 if ( end >= ucpi->c_nclusterblks) in ufs_clusteracct()
888 end = ucpi->c_nclusterblks; in ufs_clusteracct()
889 i = ubh_find_next_zero_bit (UCPI_UBH(ucpi), ucpi->c_clusteroff, end, start); in ufs_clusteracct()
901 i = ubh_find_last_zero_bit (UCPI_UBH(ucpi), ucpi->c_clusteroff, start, end); in ufs_clusteracct()
913 fs32_add(sb, (__fs32*)ubh_get_addr(UCPI_UBH(ucpi), ucpi->c_clustersumoff + (i << 2)), cnt); in ufs_clusteracct()
915 fs32_sub(sb, (__fs32*)ubh_get_addr(UCPI_UBH(ucpi), ucpi->c_clustersumoff + (back << 2)), cnt); in ufs_clusteracct()
917 fs32_sub(sb, (__fs32*)ubh_get_addr(UCPI_UBH(ucpi), ucpi->c_clustersumoff + (forw << 2)), cnt); in ufs_clusteracct()