Lines Matching refs:sbi

47 static void detected_xenix(struct sysv_sb_info *sbi, unsigned *max_links)  in detected_xenix()  argument
49 struct buffer_head *bh1 = sbi->s_bh1; in detected_xenix()
50 struct buffer_head *bh2 = sbi->s_bh2; in detected_xenix()
63 sbi->s_fic_size = XENIX_NICINOD; in detected_xenix()
64 sbi->s_flc_size = XENIX_NICFREE; in detected_xenix()
65 sbi->s_sbd1 = (char *)sbd1; in detected_xenix()
66 sbi->s_sbd2 = (char *)sbd2; in detected_xenix()
67 sbi->s_sb_fic_count = &sbd1->s_ninode; in detected_xenix()
68 sbi->s_sb_fic_inodes = &sbd1->s_inode[0]; in detected_xenix()
69 sbi->s_sb_total_free_inodes = &sbd2->s_tinode; in detected_xenix()
70 sbi->s_bcache_count = &sbd1->s_nfree; in detected_xenix()
71 sbi->s_bcache = &sbd1->s_free[0]; in detected_xenix()
72 sbi->s_free_blocks = &sbd2->s_tfree; in detected_xenix()
73 sbi->s_sb_time = &sbd2->s_time; in detected_xenix()
74 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd1->s_isize); in detected_xenix()
75 sbi->s_nzones = fs32_to_cpu(sbi, sbd1->s_fsize); in detected_xenix()
78 static void detected_sysv4(struct sysv_sb_info *sbi, unsigned *max_links) in detected_sysv4() argument
81 struct buffer_head *bh1 = sbi->s_bh1; in detected_sysv4()
82 struct buffer_head *bh2 = sbi->s_bh2; in detected_sysv4()
90 sbi->s_fic_size = SYSV_NICINOD; in detected_sysv4()
91 sbi->s_flc_size = SYSV_NICFREE; in detected_sysv4()
92 sbi->s_sbd1 = (char *)sbd; in detected_sysv4()
93 sbi->s_sbd2 = (char *)sbd; in detected_sysv4()
94 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_sysv4()
95 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_sysv4()
96 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_sysv4()
97 sbi->s_bcache_count = &sbd->s_nfree; in detected_sysv4()
98 sbi->s_bcache = &sbd->s_free[0]; in detected_sysv4()
99 sbi->s_free_blocks = &sbd->s_tfree; in detected_sysv4()
100 sbi->s_sb_time = &sbd->s_time; in detected_sysv4()
101 sbi->s_sb_state = &sbd->s_state; in detected_sysv4()
102 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_sysv4()
103 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_sysv4()
106 static void detected_sysv2(struct sysv_sb_info *sbi, unsigned *max_links) in detected_sysv2() argument
109 struct buffer_head *bh1 = sbi->s_bh1; in detected_sysv2()
110 struct buffer_head *bh2 = sbi->s_bh2; in detected_sysv2()
118 sbi->s_fic_size = SYSV_NICINOD; in detected_sysv2()
119 sbi->s_flc_size = SYSV_NICFREE; in detected_sysv2()
120 sbi->s_sbd1 = (char *)sbd; in detected_sysv2()
121 sbi->s_sbd2 = (char *)sbd; in detected_sysv2()
122 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_sysv2()
123 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_sysv2()
124 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_sysv2()
125 sbi->s_bcache_count = &sbd->s_nfree; in detected_sysv2()
126 sbi->s_bcache = &sbd->s_free[0]; in detected_sysv2()
127 sbi->s_free_blocks = &sbd->s_tfree; in detected_sysv2()
128 sbi->s_sb_time = &sbd->s_time; in detected_sysv2()
129 sbi->s_sb_state = &sbd->s_state; in detected_sysv2()
130 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_sysv2()
131 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_sysv2()
134 static void detected_coherent(struct sysv_sb_info *sbi, unsigned *max_links) in detected_coherent() argument
137 struct buffer_head *bh1 = sbi->s_bh1; in detected_coherent()
142 sbi->s_fic_size = COH_NICINOD; in detected_coherent()
143 sbi->s_flc_size = COH_NICFREE; in detected_coherent()
144 sbi->s_sbd1 = (char *)sbd; in detected_coherent()
145 sbi->s_sbd2 = (char *)sbd; in detected_coherent()
146 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_coherent()
147 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_coherent()
148 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_coherent()
149 sbi->s_bcache_count = &sbd->s_nfree; in detected_coherent()
150 sbi->s_bcache = &sbd->s_free[0]; in detected_coherent()
151 sbi->s_free_blocks = &sbd->s_tfree; in detected_coherent()
152 sbi->s_sb_time = &sbd->s_time; in detected_coherent()
153 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_coherent()
154 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_coherent()
157 static void detected_v7(struct sysv_sb_info *sbi, unsigned *max_links) in detected_v7() argument
159 struct buffer_head *bh2 = sbi->s_bh2; in detected_v7()
163 sbi->s_fic_size = V7_NICINOD; in detected_v7()
164 sbi->s_flc_size = V7_NICFREE; in detected_v7()
165 sbi->s_sbd1 = (char *)sbd; in detected_v7()
166 sbi->s_sbd2 = (char *)sbd; in detected_v7()
167 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_v7()
168 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_v7()
169 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_v7()
170 sbi->s_bcache_count = &sbd->s_nfree; in detected_v7()
171 sbi->s_bcache = &sbd->s_free[0]; in detected_v7()
172 sbi->s_free_blocks = &sbd->s_tfree; in detected_v7()
173 sbi->s_sb_time = &sbd->s_time; in detected_v7()
174 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_v7()
175 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_v7()
178 static int detect_xenix(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_xenix() argument
182 sbi->s_bytesex = BYTESEX_LE; in detect_xenix()
184 sbi->s_bytesex = BYTESEX_BE; in detect_xenix()
187 switch (fs32_to_cpu(sbi, sbd->s_type)) { in detect_xenix()
189 sbi->s_type = FSTYPE_XENIX; in detect_xenix()
192 sbi->s_type = FSTYPE_XENIX; in detect_xenix()
199 static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_sysv() argument
201 struct super_block *sb = sbi->s_sb; in detect_sysv()
208 sbi->s_bytesex = BYTESEX_LE; in detect_sysv()
210 sbi->s_bytesex = BYTESEX_BE; in detect_sysv()
214 type = fs32_to_cpu(sbi, sbd->s_type); in detect_sysv()
216 if (fs16_to_cpu(sbi, sbd->s_nfree) == 0xffff) { in detect_sysv()
217 sbi->s_type = FSTYPE_AFS; in detect_sysv()
218 sbi->s_forced_ro = 1; in detect_sysv()
227 if (fs32_to_cpu(sbi, sbd->s_time) < JAN_1_1980) { in detect_sysv()
231 sbi->s_type = FSTYPE_SYSV2; in detect_sysv()
245 sbi->s_forced_ro = 1; in detect_sysv()
248 sbi->s_type = FSTYPE_SYSV4; in detect_sysv()
252 static int detect_coherent(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_coherent() argument
260 sbi->s_bytesex = BYTESEX_PDP; in detect_coherent()
261 sbi->s_type = FSTYPE_COH; in detect_coherent()
265 static int detect_sysv_odd(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_sysv_odd() argument
267 int size = detect_sysv(sbi, bh); in detect_sysv_odd()
304 struct sysv_sb_info *sbi = SYSV_SB(sb); in complete_read_super() local
306 char *found = flavour_names[sbi->s_type]; in complete_read_super()
311 sbi->s_firstinodezone = 2; in complete_read_super()
313 flavour_setup[sbi->s_type](sbi, &sb->s_max_links); in complete_read_super()
315 sbi->s_truncate = 1; in complete_read_super()
316 sbi->s_ndatazones = sbi->s_nzones - sbi->s_firstdatazone; in complete_read_super()
317 sbi->s_inodes_per_block = bsize >> 6; in complete_read_super()
318 sbi->s_inodes_per_block_1 = (bsize >> 6)-1; in complete_read_super()
319 sbi->s_inodes_per_block_bits = n_bits-6; in complete_read_super()
320 sbi->s_ind_per_block = bsize_4; in complete_read_super()
321 sbi->s_ind_per_block_2 = bsize_4*bsize_4; in complete_read_super()
322 sbi->s_toobig_block = 10 + bsize_4 * (1 + bsize_4 * (1 + bsize_4)); in complete_read_super()
323 sbi->s_ind_per_block_bits = n_bits-2; in complete_read_super()
325 sbi->s_ninodes = (sbi->s_firstdatazone - sbi->s_firstinodezone) in complete_read_super()
326 << sbi->s_inodes_per_block_bits; in complete_read_super()
332 sb->s_magic = SYSV_MAGIC_BASE + sbi->s_type; in complete_read_super()
335 if (sbi->s_forced_ro) in complete_read_super()
337 if (sbi->s_truncate) in complete_read_super()
355 struct sysv_sb_info *sbi; in sysv_fill_super() local
365 sbi = kzalloc(sizeof(struct sysv_sb_info), GFP_KERNEL); in sysv_fill_super()
366 if (!sbi) in sysv_fill_super()
369 sbi->s_sb = sb; in sysv_fill_super()
370 sbi->s_block_base = 0; in sysv_fill_super()
371 mutex_init(&sbi->s_lock); in sysv_fill_super()
372 sb->s_fs_info = sbi; in sysv_fill_super()
409 sbi->s_bh1 = bh1; in sysv_fill_super()
410 sbi->s_bh2 = bh; in sysv_fill_super()
420 kfree(sbi); in sysv_fill_super()
442 struct sysv_sb_info *sbi; in v7_sanity_check() local
444 sbi = sb->s_fs_info; in v7_sanity_check()
448 if (fs16_to_cpu(sbi, v7sb->s_nfree) > V7_NICFREE || in v7_sanity_check()
449 fs16_to_cpu(sbi, v7sb->s_ninode) > V7_NICINOD || in v7_sanity_check()
450 fs32_to_cpu(sbi, v7sb->s_fsize) > V7_MAXSIZE) in v7_sanity_check()
460 if ((fs16_to_cpu(sbi, v7i->i_mode) & ~0777) != S_IFDIR || in v7_sanity_check()
461 (fs32_to_cpu(sbi, v7i->i_size) == 0) || in v7_sanity_check()
462 (fs32_to_cpu(sbi, v7i->i_size) & 017) || in v7_sanity_check()
463 (fs32_to_cpu(sbi, v7i->i_size) > V7_NFILES * in v7_sanity_check()
475 struct sysv_sb_info *sbi; in v7_fill_super() local
483 sbi = kzalloc(sizeof(struct sysv_sb_info), GFP_KERNEL); in v7_fill_super()
484 if (!sbi) in v7_fill_super()
487 sbi->s_sb = sb; in v7_fill_super()
488 sbi->s_block_base = 0; in v7_fill_super()
489 sbi->s_type = FSTYPE_V7; in v7_fill_super()
490 mutex_init(&sbi->s_lock); in v7_fill_super()
491 sb->s_fs_info = sbi; in v7_fill_super()
503 sbi->s_bytesex = BYTESEX_PDP; in v7_fill_super()
508 sbi->s_bytesex = BYTESEX_LE; in v7_fill_super()
515 sbi->s_bh1 = bh; in v7_fill_super()
516 sbi->s_bh2 = bh; in v7_fill_super()
524 kfree(sbi); in v7_fill_super()