12 #include <linux/time.h>
13 #include <linux/stat.h>
14 #include <linux/string.h>
15 #include <linux/bitops.h>
17 #include <asm/byteorder.h>
29 unsigned cgno,
unsigned bitmap_nr)
37 UFSD(
"ENTER, cgno %u, bitmap_nr %u\n", cgno, bitmap_nr);
39 ucpi = sbi->
s_ucpi[bitmap_nr];
47 UCPI_UBH(ucpi)->bh[0] = sbi->
s_ucg[cgno];
48 for (i = 1; i < UCPI_UBH(ucpi)->count; i++)
49 if (!(UCPI_UBH(ucpi)->bh[i] = sb_bread(sb, UCPI_UBH(ucpi)->fragment + i)))
51 sbi->
s_cgno[bitmap_nr] = cgno;
72 for (j = 1; j <
i; j++)
73 brelse (sbi->
s_ucg[j]);
75 ufs_error (sb,
"ufs_read_cylinder",
"can't read cylinder group block %u", cgno);
90 UFSD(
"ENTER, bitmap_nr %u\n", bitmap_nr);
97 ucpi = sbi->
s_ucpi[bitmap_nr];
101 ufs_panic (sb,
"ufs_put_cylinder",
"internal error");
112 for (i = 1; i < UCPI_UBH(ucpi)->count; i++) {
113 brelse (UCPI_UBH(ucpi)->bh[i]);
134 UFSD(
"ENTER, cgno %u\n", cgno);
137 if (cgno >= uspi->
s_ncg) {
138 ufs_panic (sb,
"ufs_load_cylinder",
"internal error, high number of cg");
144 if (sbi->
s_cgno[0] == cgno) {
153 if (sbi->
s_cgno[cgno] != cgno) {
154 ufs_panic (sb,
"ufs_load_cylinder",
"internal error, wrong number of cg in cache");
155 UFSD(
"EXIT (FAILED)\n");
163 ufs_read_cylinder (sb, cgno, cgno);
173 if (i < sbi->s_cg_loaded && sbi->
s_cgno[i] == cgno) {
176 for (j = i; j > 0; j--) {
197 ufs_read_cylinder (sb, cgno, 0);