Lines Matching full:sbi
48 static void detected_xenix(struct sysv_sb_info *sbi, unsigned *max_links) in detected_xenix() argument
50 struct buffer_head *bh1 = sbi->s_bh1; in detected_xenix()
51 struct buffer_head *bh2 = sbi->s_bh2; in detected_xenix()
64 sbi->s_fic_size = XENIX_NICINOD; in detected_xenix()
65 sbi->s_flc_size = XENIX_NICFREE; in detected_xenix()
66 sbi->s_sbd1 = (char *)sbd1; in detected_xenix()
67 sbi->s_sbd2 = (char *)sbd2; in detected_xenix()
68 sbi->s_sb_fic_count = &sbd1->s_ninode; in detected_xenix()
69 sbi->s_sb_fic_inodes = &sbd1->s_inode[0]; in detected_xenix()
70 sbi->s_sb_total_free_inodes = &sbd2->s_tinode; in detected_xenix()
71 sbi->s_bcache_count = &sbd1->s_nfree; in detected_xenix()
72 sbi->s_bcache = &sbd1->s_free[0]; in detected_xenix()
73 sbi->s_free_blocks = &sbd2->s_tfree; in detected_xenix()
74 sbi->s_sb_time = &sbd2->s_time; in detected_xenix()
75 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd1->s_isize); in detected_xenix()
76 sbi->s_nzones = fs32_to_cpu(sbi, sbd1->s_fsize); in detected_xenix()
79 static void detected_sysv4(struct sysv_sb_info *sbi, unsigned *max_links) in detected_sysv4() argument
82 struct buffer_head *bh1 = sbi->s_bh1; in detected_sysv4()
83 struct buffer_head *bh2 = sbi->s_bh2; in detected_sysv4()
91 sbi->s_fic_size = SYSV_NICINOD; in detected_sysv4()
92 sbi->s_flc_size = SYSV_NICFREE; in detected_sysv4()
93 sbi->s_sbd1 = (char *)sbd; in detected_sysv4()
94 sbi->s_sbd2 = (char *)sbd; in detected_sysv4()
95 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_sysv4()
96 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_sysv4()
97 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_sysv4()
98 sbi->s_bcache_count = &sbd->s_nfree; in detected_sysv4()
99 sbi->s_bcache = &sbd->s_free[0]; in detected_sysv4()
100 sbi->s_free_blocks = &sbd->s_tfree; in detected_sysv4()
101 sbi->s_sb_time = &sbd->s_time; in detected_sysv4()
102 sbi->s_sb_state = &sbd->s_state; in detected_sysv4()
103 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_sysv4()
104 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_sysv4()
107 static void detected_sysv2(struct sysv_sb_info *sbi, unsigned *max_links) in detected_sysv2() argument
110 struct buffer_head *bh1 = sbi->s_bh1; in detected_sysv2()
111 struct buffer_head *bh2 = sbi->s_bh2; in detected_sysv2()
119 sbi->s_fic_size = SYSV_NICINOD; in detected_sysv2()
120 sbi->s_flc_size = SYSV_NICFREE; in detected_sysv2()
121 sbi->s_sbd1 = (char *)sbd; in detected_sysv2()
122 sbi->s_sbd2 = (char *)sbd; in detected_sysv2()
123 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_sysv2()
124 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_sysv2()
125 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_sysv2()
126 sbi->s_bcache_count = &sbd->s_nfree; in detected_sysv2()
127 sbi->s_bcache = &sbd->s_free[0]; in detected_sysv2()
128 sbi->s_free_blocks = &sbd->s_tfree; in detected_sysv2()
129 sbi->s_sb_time = &sbd->s_time; in detected_sysv2()
130 sbi->s_sb_state = &sbd->s_state; in detected_sysv2()
131 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_sysv2()
132 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_sysv2()
135 static void detected_coherent(struct sysv_sb_info *sbi, unsigned *max_links) in detected_coherent() argument
138 struct buffer_head *bh1 = sbi->s_bh1; in detected_coherent()
143 sbi->s_fic_size = COH_NICINOD; in detected_coherent()
144 sbi->s_flc_size = COH_NICFREE; in detected_coherent()
145 sbi->s_sbd1 = (char *)sbd; in detected_coherent()
146 sbi->s_sbd2 = (char *)sbd; in detected_coherent()
147 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_coherent()
148 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_coherent()
149 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_coherent()
150 sbi->s_bcache_count = &sbd->s_nfree; in detected_coherent()
151 sbi->s_bcache = &sbd->s_free[0]; in detected_coherent()
152 sbi->s_free_blocks = &sbd->s_tfree; in detected_coherent()
153 sbi->s_sb_time = &sbd->s_time; in detected_coherent()
154 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_coherent()
155 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_coherent()
158 static void detected_v7(struct sysv_sb_info *sbi, unsigned *max_links) in detected_v7() argument
160 struct buffer_head *bh2 = sbi->s_bh2; in detected_v7()
164 sbi->s_fic_size = V7_NICINOD; in detected_v7()
165 sbi->s_flc_size = V7_NICFREE; in detected_v7()
166 sbi->s_sbd1 = (char *)sbd; in detected_v7()
167 sbi->s_sbd2 = (char *)sbd; in detected_v7()
168 sbi->s_sb_fic_count = &sbd->s_ninode; in detected_v7()
169 sbi->s_sb_fic_inodes = &sbd->s_inode[0]; in detected_v7()
170 sbi->s_sb_total_free_inodes = &sbd->s_tinode; in detected_v7()
171 sbi->s_bcache_count = &sbd->s_nfree; in detected_v7()
172 sbi->s_bcache = &sbd->s_free[0]; in detected_v7()
173 sbi->s_free_blocks = &sbd->s_tfree; in detected_v7()
174 sbi->s_sb_time = &sbd->s_time; in detected_v7()
175 sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize); in detected_v7()
176 sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize); in detected_v7()
179 static int detect_xenix(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_xenix() argument
183 sbi->s_bytesex = BYTESEX_LE; in detect_xenix()
185 sbi->s_bytesex = BYTESEX_BE; in detect_xenix()
188 switch (fs32_to_cpu(sbi, sbd->s_type)) { in detect_xenix()
190 sbi->s_type = FSTYPE_XENIX; in detect_xenix()
193 sbi->s_type = FSTYPE_XENIX; in detect_xenix()
200 static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_sysv() argument
202 struct super_block *sb = sbi->s_sb; in detect_sysv()
209 sbi->s_bytesex = BYTESEX_LE; in detect_sysv()
211 sbi->s_bytesex = BYTESEX_BE; in detect_sysv()
215 type = fs32_to_cpu(sbi, sbd->s_type); in detect_sysv()
217 if (fs16_to_cpu(sbi, sbd->s_nfree) == 0xffff) { in detect_sysv()
218 sbi->s_type = FSTYPE_AFS; in detect_sysv()
219 sbi->s_forced_ro = 1; in detect_sysv()
228 if (fs32_to_cpu(sbi, sbd->s_time) < JAN_1_1980) { in detect_sysv()
232 sbi->s_type = FSTYPE_SYSV2; in detect_sysv()
246 sbi->s_forced_ro = 1; in detect_sysv()
249 sbi->s_type = FSTYPE_SYSV4; in detect_sysv()
253 static int detect_coherent(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_coherent() argument
261 sbi->s_bytesex = BYTESEX_PDP; in detect_coherent()
262 sbi->s_type = FSTYPE_COH; in detect_coherent()
266 static int detect_sysv_odd(struct sysv_sb_info *sbi, struct buffer_head *bh) in detect_sysv_odd() argument
268 int size = detect_sysv(sbi, bh); in detect_sysv_odd()
305 struct sysv_sb_info *sbi = SYSV_SB(sb); in complete_read_super() local
307 char *found = flavour_names[sbi->s_type]; in complete_read_super()
312 sbi->s_firstinodezone = 2; in complete_read_super()
314 flavour_setup[sbi->s_type](sbi, &sb->s_max_links); in complete_read_super()
315 if (sbi->s_firstdatazone < sbi->s_firstinodezone) in complete_read_super()
318 sbi->s_ndatazones = sbi->s_nzones - sbi->s_firstdatazone; in complete_read_super()
319 sbi->s_inodes_per_block = bsize >> 6; in complete_read_super()
320 sbi->s_inodes_per_block_1 = (bsize >> 6)-1; in complete_read_super()
321 sbi->s_inodes_per_block_bits = n_bits-6; in complete_read_super()
322 sbi->s_ind_per_block = bsize_4; in complete_read_super()
323 sbi->s_ind_per_block_2 = bsize_4*bsize_4; in complete_read_super()
324 sbi->s_toobig_block = 10 + bsize_4 * (1 + bsize_4 * (1 + bsize_4)); in complete_read_super()
325 sbi->s_ind_per_block_bits = n_bits-2; in complete_read_super()
327 sbi->s_ninodes = (sbi->s_firstdatazone - sbi->s_firstinodezone) in complete_read_super()
328 << sbi->s_inodes_per_block_bits; in complete_read_super()
334 sb->s_magic = SYSV_MAGIC_BASE + sbi->s_type; in complete_read_super()
337 if (sbi->s_forced_ro) 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()
410 sbi->s_bh1 = bh1; in sysv_fill_super()
411 sbi->s_bh2 = bh; in sysv_fill_super()
421 kfree(sbi); in sysv_fill_super()
443 struct sysv_sb_info *sbi; in v7_sanity_check() local
445 sbi = sb->s_fs_info; in v7_sanity_check()
449 if (fs16_to_cpu(sbi, v7sb->s_nfree) > V7_NICFREE || in v7_sanity_check()
450 fs16_to_cpu(sbi, v7sb->s_ninode) > V7_NICINOD || in v7_sanity_check()
451 fs32_to_cpu(sbi, v7sb->s_fsize) > V7_MAXSIZE) in v7_sanity_check()
461 if ((fs16_to_cpu(sbi, v7i->i_mode) & ~0777) != S_IFDIR || in v7_sanity_check()
462 (fs32_to_cpu(sbi, v7i->i_size) == 0) || in v7_sanity_check()
463 (fs32_to_cpu(sbi, v7i->i_size) & 017) || in v7_sanity_check()
464 (fs32_to_cpu(sbi, v7i->i_size) > V7_NFILES * in v7_sanity_check()
476 struct sysv_sb_info *sbi; in v7_fill_super() local
482 sbi = kzalloc(sizeof(struct sysv_sb_info), GFP_KERNEL); in v7_fill_super()
483 if (!sbi) in v7_fill_super()
486 sbi->s_sb = sb; in v7_fill_super()
487 sbi->s_block_base = 0; in v7_fill_super()
488 sbi->s_type = FSTYPE_V7; in v7_fill_super()
489 mutex_init(&sbi->s_lock); in v7_fill_super()
490 sb->s_fs_info = sbi; in v7_fill_super()
504 sbi->s_bytesex = BYTESEX_PDP; in v7_fill_super()
509 sbi->s_bytesex = BYTESEX_LE; in v7_fill_super()
516 sbi->s_bh1 = bh; in v7_fill_super()
517 sbi->s_bh2 = bh; in v7_fill_super()
525 kfree(sbi); in v7_fill_super()