7 struct tfs_sb_info
* tfs_mount(void)
9 struct tfs_sb_info
*sbi
;
10 struct tfs_super_block sb
;
13 floppy_read(TFS_SB_SECTOR
, &sb
);
14 if (sb
.s_magic
!= TFS_MAGIC
) {
15 printk("Trying to mount not tfs file system!\n");
19 sbi
= malloc(sizeof(*sbi
));
21 printk("Malloc from tfs sbi object failed!\n");
25 sbi
->s_block_shift
= sb
.s_block_shift
;
26 sbi
->s_block_size
= 1 << sbi
->s_block_shift
;
27 sbi
->s_blocks_count
= sb
.s_blocks_count
;
28 sbi
->s_inodes_count
= sb
.s_inodes_count
;
29 sbi
->s_free_blocks_count
= sb
.s_free_blocks_count
;
30 sbi
->s_free_inodes_count
= sb
.s_free_inodes_count
;
33 sbi
->s_inode_bitmap
= sb
.s_inode_bitmap
;
34 sbi
->s_block_bitmap
= sb
.s_block_bitmap
;
35 sbi
->s_inode_table
= sb
.s_inode_table
;
36 sbi
->s_data_area
= sb
.s_data_area
;
38 sbi
->s_inode_bitmap_count
= sb
.s_block_bitmap
- sb
.s_inode_bitmap
;
39 sbi
->s_block_bitmap_count
= sb
.s_inode_table
- sb
.s_block_bitmap
;
40 sbi
->s_inode_table_count
= sb
.s_data_area
- sb
.s_inode_table
;
43 sbi
->s_offset
= sb
.s_offset
;
45 sbi
->s_inodes_per_block
= sbi
->s_block_size
/ sizeof(struct tfs_inode
);