Changeset a6e094f in mainline
- Timestamp:
- 2011-03-01T18:34:30Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 85d32df7
- Parents:
- 128b8ee
- Location:
- uspace/srv/fs/minixfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs_const.h
r128b8ee ra6e094f 37 37 #include <sys/types.h> 38 38 39 #define V2_NR_TZONES 10 39 #define V2_NR_DIRECT_ZONES 7 40 #define V2_NR_INDIRECT_ZONES 3 40 41 41 42 #endif -
uspace/srv/fs/minixfs/mfs_inode.h
r128b8ee ra6e094f 37 37 #include "mfs_const.h" 38 38 39 /*Declaration of the V2 inode as it is on disk.*/39 /*Declaration of the MinixFS V2 inode as it is on disk.*/ 40 40 41 41 struct mfs_v2_inode { 42 uint16_t mode; /*File type, protection, etc.*/ 43 uint16_t n_links; /*How many links to this file.*/ 44 int16_t uid; /*User id of the file owner.*/ 45 uint16_t gid; /*Group number.*/ 46 int32_t size; /*Current file size in bytes.*/ 47 int32_t atime; /*When was file data last accessed.*/ 48 int32_t mtime; /*When was file data last changed.*/ 49 int32_t ctime; /*When was inode data last changed.*/ 50 /*Block nums for direct, indirect, and double indirect zones.*/ 51 uint32_t zone[V2_NR_TZONES]; 42 uint16_t i_mode; 43 uint16_t i_nlinks; 44 int16_t i_uid; 45 uint16_t i_gid; 46 int32_t i_size; 47 int32_t i_atime; 48 int32_t i_mtime; 49 int32_t i_ctime; 50 /*Block numbers for direct zones*/ 51 uint32_t dzone[V2_NR_DIRECT_ZONES]; 52 /*Block numbers for indirect zones*/ 53 uint32_t izone[V2_NR_INDIRECT_ZONES]; 52 54 } __attribute__ ((packed)); 53 55 -
uspace/srv/fs/minixfs/mfs_super.h
r128b8ee ra6e094f 36 36 #include "mfs_const.h" 37 37 38 /* Super block table. The root file system and every mounted file system39 * has an entry here. The entry holds information about the sizes of the bit40 * maps and inodes. The s_ninodes field gives the number of inodes available41 * for files and directories, including the root directory. Inode 0 is42 * on the disk, but not used. Thus s_ninodes = 4 means that 5 bits will be43 * used in the bit map, bit 0, which is always 1 and not used, and bits 1-444 * for files and directories. The disk layout is:45 *46 * Item # blocks47 * boot block 148 * super block 1 (offset 1kB)49 * inode map s_imap_blocks50 * zone map s_zmap_blocks51 * inodes (s_ninodes + 'inodes per block' - 1)/'inodes per block'52 * unused whatever is needed to fill out the current zone53 * data zones (s_zones - s_firstdatazone) << s_log_zone_size54 *55 */56 38 57 struct mfs_v3_superblock { 58 uint32_t s_ninodes; /*# usable inodes on the device*/ 59 uint16_t s_nzones; /*total device size including bitmaps etc*/ 60 int16_t s_imap_blocks; /*# of blocks used by inode bitmap*/ 61 int16_t s_zmap_blocks; /*# of blocks used by zone bitmap*/ 62 uint16_t s_firstdatazone_old; /*# of first data zone (small)*/ 63 int16_t s_log_zone_size; /*log2 of blocks / zone*/ 64 int16_t s_pad; /*try to avoid compiler dependent padding*/ 65 int32_t s_max_size; /*maximum file size*/ 66 uint32_t s_zones; /*number of zones*/ 67 int16_t s_magic; /*magic number to recognize superblocks*/ 39 struct mfs_superblock { 40 /*Total number of inodes on the device*/ 41 uint32_t s_ninodes; 42 /*Device size expressed as number of zones (unused)*/ 43 uint16_t s_nzones; 44 /*Number of inode bitmap blocks*/ 45 int16_t s_ibmap_blocks; 46 /*Number of zone bitmap blocks*/ 47 int16_t s_zbmap_blocks; 48 /*First data zone on device*/ 49 uint16_t s_first_data_zone; 50 /*Base 2 logarithm of the zone to block ratio*/ 51 int16_t s_log2_zone_size; 52 int16_t s_pad; 53 /*Maximum file size expressed in bytes*/ 54 int32_t s_max_file_size; 55 /*Total number of zones on the device*/ 56 uint32_t s_total_zones; 57 /*Magic number used to recognize MinixFS and to detect on-disk endianness*/ 58 int16_t s_magic; 68 59 69 /* The following items are valid on disk only for V3 and above*/70 60 /* The following fields are valid only for MinixFS V3 */ 61 71 62 int16_t s_pad2; 72 uint16_t s_block_size; /*block size in bytes*/ 73 int8_t s_disk_version; /*filesystem format sub-version*/ 63 /*Filesystem block size expressed in bytes*/ 64 uint16_t s_block_size; 65 /*Filesystem disk format version*/ 66 int8_t s_disk_version; 74 67 } __attribute__ ((packed)); 75 68
Note:
See TracChangeset
for help on using the changeset viewer.