Lines Matching defs:cgs
112 /* pointers to the in-core cgs, read off disk and possibly modified */
113 static struct cg **cgs;
324 * Load the cgs and csums off disk. Also allocates the space to load
334 cgs = nfmalloc(oldsb->fs_ncg * sizeof(*cgs), "cg pointers");
335 cgp = alloconce(oldsb->fs_ncg * cgblksz, "cgs");
339 cgs[cg] = (struct cg *) cgp;
342 ffs_cg_swap(cgs[cg],cgs[cg],oldsb);
474 cg = cgs[cgn];
640 * and assumes the cgs[] structures correctly describe the area to be
673 bits = cg_blksfree(cgs[cgn], 0);
674 cgsize = cgs[cgn]->cg_ndblk;
695 bits = cg_blksfree(cgs[cgn], 0);
696 cgsize = cgs[cgn]->cg_ndblk;
705 * for sb values, and assumes the cgs[] structures correctly describe
724 bits = cg_blksfree(cgs[cgn], 0);
725 cgsize = ffs_blknum(newsb, cgs[cgn]->cg_ndblk);
741 bits = cg_blksfree(cgs[cgn], 0);
742 cgsize = ffs_blknum(newsb, cgs[cgn]->cg_ndblk);
748 * Uses newsb for sb values, and assumes the cgs[] structures
766 bits = cg_inosused(cgs[cgn], 0);
782 bits = cg_inosused(cgs[cgn], 0);
796 set_bits(cg_blksfree(cgs[cgn], 0), dtogd(newsb, fno), 1);
809 clr_bits(cg_blksfree(cgs[cgn], 0), dtogd(newsb, fno), 1);
862 if (bit_is_clr(cg_blksfree(cgs[cgn], 0),
892 * Recompute newsb->fs_dsize. Just scans all cgs, adding the number of
1004 /* Allocate and clear the new-inode area, in case we add any cgs. */
1027 /* If we're adding any cgs, realloc structures and set up the new
1028 cgs. */
1031 cgs = nfrealloc(cgs, newsb->fs_ncg * sizeof(*cgs),
1037 "cgs");
1039 cgs[i] = (struct cg *) cgp;
1045 cgs[oldsb->fs_ncg - 1]->cg_old_ncyl = oldsb->fs_old_cpg;
1055 cg = cgs[oldsb->fs_ncg - 1];
1350 clr_bits(cg_blksfree(cgs[dtog(oldsb, off)], 0),
1399 clr_bits(cg_blksfree(cgs[dtog(oldsb, off)], 0),
1657 cgs[ino_to_cg(newsb, fi)], 0),
1785 /* Evict data from any cgs being wholly eliminated */
1795 if (dmax > cgs[i]->cg_ndblk)
1796 dmax = cgs[i]->cg_ndblk;
1797 evict_data(cgs[i], 0, dlow);
1798 evict_data(cgs[i], dhigh, dmax - dhigh);
1799 newsb->fs_cstotal.cs_ndir -= cgs[i]->cg_cs.cs_ndir;
1800 newsb->fs_cstotal.cs_nifree -= cgs[i]->cg_cs.cs_nifree;
1801 newsb->fs_cstotal.cs_nffree -= cgs[i]->cg_cs.cs_nffree;
1802 newsb->fs_cstotal.cs_nbfree -= cgs[i]->cg_cs.cs_nbfree;
1805 cgs[newsb->fs_ncg - 1]->cg_ndblk = newsb->fs_size -
1813 cg = cgs[newsb->fs_ncg - 1];
1829 slop += cgs[i]->cg_cs.cs_nifree;
1831 slop -= oldsb->fs_ipg - cgs[i]->cg_cs.cs_nifree;
1843 evict_inodes(cgs[i]);
1854 cgs[newsb->fs_ncg - 1]->cg_old_ncyl =
1875 cg = cgs[cgn];
1989 cg = cgs[cgn];
2022 * Flush cgs to disk, recomputing anything they're marked as needing.
2039 cgs[i]->cg_rotor = 0;
2040 cgs[i]->cg_frotor = 0;
2041 cgs[i]->cg_irotor = 0;
2043 ffs_cg_swap(cgs[i],cgs[i],newsb);
2044 writeat(FFS_FSBTODB(newsb, cgtod(newsb, i)), cgs[i],