Lines Matching refs:uspi
40 struct ufs_sb_private_info * uspi;
48 uspi = UFS_SB(sb)->s_uspi;
49 usb1 = ubh_get_usb_first(uspi);
54 if (ufs_fragnum(fragment) + count > uspi->s_fpg)
59 cgno = ufs_dtog(uspi, fragment);
60 bit = ufs_dtogd(uspi, fragment);
61 if (cgno >= uspi->s_ncg) {
88 uspi->cs_total.cs_nffree += count;
98 fs32_sub(sb, &ucg->cg_cs.cs_nffree, uspi->s_fpb);
99 uspi->cs_total.cs_nffree -= uspi->s_fpb;
100 fs32_sub(sb, &UFS_SB(sb)->fs_cs(cgno).cs_nffree, uspi->s_fpb);
104 uspi->cs_total.cs_nbfree++;
106 if (uspi->fs_magic != UFS2_MAGIC) {
115 ubh_mark_buffer_dirty (USPI_UBH(uspi));
137 struct ufs_sb_private_info * uspi;
145 uspi = UFS_SB(sb)->s_uspi;
146 usb1 = ubh_get_usb_first(uspi);
151 if ((fragment & uspi->s_fpbmask) || (count & uspi->s_fpbmask)) {
162 cgno = ufs_dtog(uspi, fragment);
163 bit = ufs_dtogd(uspi, fragment);
164 if (cgno >= uspi->s_ncg) {
169 if (end_bit > uspi->s_fpg) {
170 overflow = bit + count - uspi->s_fpg;
184 for (i = bit; i < end_bit; i += uspi->s_fpb) {
194 uspi->cs_total.cs_nbfree++;
197 if (uspi->fs_magic != UFS2_MAGIC) {
206 ubh_mark_buffer_dirty (USPI_UBH(uspi));
350 struct ufs_sb_private_info * uspi;
360 uspi = UFS_SB(sb)->s_uspi;
361 usb1 = ubh_get_usb_first(uspi);
367 if (count + ufs_fragnum(fragment) > uspi->s_fpb) {
371 count = uspi->s_fpb - ufs_fragnum(fragment);
405 if (!capable(CAP_SYS_RESOURCE) && ufs_freespace(uspi, UFS_MINFREE) <= 0) {
411 if (goal >= uspi->s_size)
416 cgno = ufs_dtog(uspi, goal);
457 if (uspi->s_minfree < 5 || uspi->cs_total.cs_nffree
458 > uspi->s_dsize * uspi->s_minfree / (2 * 100))
466 request = uspi->s_fpb;
467 if (uspi->cs_total.cs_nffree < uspi->s_dsize *
468 (uspi->s_minfree - 2) / 100)
478 uspi->s_sbbase + tmp,
479 uspi->s_sbbase + result, locked_page);
500 struct ufs_sb_private_info * uspi;
510 uspi = UFS_SB(sb)->s_uspi;
511 usb1 = ubh_get_usb_first (uspi);
514 cgno = ufs_dtog(uspi, fragment);
517 if ((ufs_fragnum (fragment) + newcount) > uspi->s_fpb)
529 fragno = ufs_dtogd(uspi, fragment);
538 for (i = newcount; i < (uspi->s_fpb - fragoff); i++)
553 uspi->cs_total.cs_nffree -= count;
555 ubh_mark_buffer_dirty (USPI_UBH(uspi));
570 for (k = count; k < uspi->s_fpb; k++) \
578 struct ufs_sb_private_info * uspi;
589 uspi = UFS_SB(sb)->s_uspi;
590 usb1 = ubh_get_usb_first(uspi);
601 for (j = 1; j < uspi->s_ncg; j *= 2) {
603 if (cgno >= uspi->s_ncg)
604 cgno -= uspi->s_ncg;
612 cgno = (oldcg + 1) % uspi->s_ncg;
613 for (j = 2; j < uspi->s_ncg; j++) {
615 if (cgno >= uspi->s_ncg)
633 if (count == uspi->s_fpb) {
640 for (allocsize = count; allocsize < uspi->s_fpb; allocsize++)
644 if (allocsize == uspi->s_fpb) {
648 goal = ufs_dtogd(uspi, result);
649 for (i = count; i < uspi->s_fpb; i++)
651 i = uspi->s_fpb - count;
654 uspi->cs_total.cs_nffree += i;
667 uspi->cs_total.cs_nffree -= count;
675 ubh_mark_buffer_dirty (USPI_UBH(uspi));
681 result += cgno * uspi->s_fpg;
691 struct ufs_sb_private_info * uspi;
699 uspi = UFS_SB(sb)->s_uspi;
700 usb1 = ubh_get_usb_first(uspi);
708 goal = ufs_dtogd(uspi, goal);
719 result = ufs_bitmap_search (sb, ucpi, goal, uspi->s_fpb);
730 uspi->cs_total.cs_nbfree--;
733 if (uspi->fs_magic != UFS2_MAGIC) {
746 static unsigned ubh_scanc(struct ufs_sb_private_info *uspi,
755 offset = begin & ~uspi->s_fmask;
756 begin >>= uspi->s_fshift;
758 if ((offset + size) < uspi->s_fsize)
761 rest = uspi->s_fsize - offset;
795 struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
805 usb1 = ubh_get_usb_first (uspi);
809 start = ufs_dtogd(uspi, goal) >> 3;
813 length = ((uspi->s_fpg + 7) >> 3) - start;
814 loc = ubh_scanc(uspi, UCPI_UBH(ucpi), ucpi->c_freeoff + start, length,
815 (uspi->s_fpb == 8) ? ufs_fragtable_8fpb : ufs_fragtable_other,
816 1 << (count - 1 + (uspi->s_fpb & 7)));
819 loc = ubh_scanc(uspi, UCPI_UBH(ucpi), ucpi->c_freeoff, length,
820 (uspi->s_fpb == 8) ? ufs_fragtable_8fpb :
822 1 << (count - 1 + (uspi->s_fpb & 7)));
840 for (end = result + 8; result < end; result += uspi->s_fpb) {
845 for (pos = 0; pos <= uspi->s_fpb - count; pos++) {
865 struct ufs_sb_private_info * uspi;
868 uspi = UFS_SB(sb)->s_uspi;
869 if (uspi->s_contigsumsize <= 0)
881 end = start + uspi->s_contigsumsize;
893 end = start - uspi->s_contigsumsize;
906 if (i > uspi->s_contigsumsize)
907 i = uspi->s_contigsumsize;