Lines Matching refs:cgno
45 unsigned cgno, bit, end_bit, bbase, blkmap, i; in ufs_free_fragments() local
59 cgno = ufs_dtog(uspi, fragment); in ufs_free_fragments()
61 if (cgno >= uspi->s_ncg) { in ufs_free_fragments()
66 ucpi = ufs_load_cylinder (sb, cgno); in ufs_free_fragments()
71 ufs_panic (sb, "ufs_free_fragments", "internal error, bad magic number on cg %u", cgno); in ufs_free_fragments()
90 fs32_add(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, count); in ufs_free_fragments()
101 fs32_sub(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, uspi->s_fpb); in ufs_free_fragments()
106 fs32_add(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nbfree, 1); in ufs_free_fragments()
141 unsigned overflow, cgno, bit, end_bit, i; in ufs_free_blocks() local
161 cgno = ufs_dtog(uspi, fragment); in ufs_free_blocks()
163 if (cgno >= uspi->s_ncg) { in ufs_free_blocks()
174 ucpi = ufs_load_cylinder (sb, cgno); in ufs_free_blocks()
179 ufs_panic (sb, "ufs_free_blocks", "internal error, bad magic number on cg %u", cgno); in ufs_free_blocks()
195 fs32_add(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nbfree, 1); in ufs_free_blocks()
347 unsigned cgno, oldcount, newcount; in ufs_new_fragments() local
411 cgno = ufs_inotocg (inode->i_ino); in ufs_new_fragments()
413 cgno = ufs_dtog(uspi, goal); in ufs_new_fragments()
419 result = ufs_alloc_fragments (inode, cgno, goal, count, err); in ufs_new_fragments()
464 result = ufs_alloc_fragments (inode, cgno, goal, request, err); in ufs_new_fragments()
511 unsigned cgno, fragno, fragoff, count, fragsize, i; in ufs_add_fragments() local
520 cgno = ufs_dtog(uspi, fragment); in ufs_add_fragments()
521 if (fs32_to_cpu(sb, UFS_SB(sb)->fs_cs(cgno).cs_nffree) < count) in ufs_add_fragments()
525 ucpi = ufs_load_cylinder (sb, cgno); in ufs_add_fragments()
531 "internal error, bad magic number on cg %u", cgno); in ufs_add_fragments()
553 "internal error or corrupted bitmap on cg %u", cgno); in ufs_add_fragments()
561 fs32_sub(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, count); in ufs_add_fragments()
576 ucg = (struct ufs_cylinder_group *) UFS_SB(sb)->s_ucg[cgno]->b_data; \
583 static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno, in ufs_alloc_fragments() argument
594 inode->i_ino, cgno, (unsigned long long)goal, count); in ufs_alloc_fragments()
598 oldcg = cgno; in ufs_alloc_fragments()
609 cgno += j; in ufs_alloc_fragments()
610 if (cgno >= uspi->s_ncg) in ufs_alloc_fragments()
611 cgno -= uspi->s_ncg; in ufs_alloc_fragments()
619 cgno = (oldcg + 1) % uspi->s_ncg; in ufs_alloc_fragments()
621 cgno++; in ufs_alloc_fragments()
622 if (cgno >= uspi->s_ncg) in ufs_alloc_fragments()
623 cgno = 0; in ufs_alloc_fragments()
631 ucpi = ufs_load_cylinder (sb, cgno); in ufs_alloc_fragments()
637 "internal error, bad magic number on cg %u", cgno); in ufs_alloc_fragments()
663 fs32_add(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, i); in ufs_alloc_fragments()
678 fs32_sub(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, count); in ufs_alloc_fragments()
691 result += cgno * uspi->s_fpg; in ufs_alloc_fragments()