Changeset a6e094f in mainline


Ignore:
Timestamp:
2011-03-01T18:34:30Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
85d32df7
Parents:
128b8ee
Message:

Drop code copied from minix3

Location:
uspace/srv/fs/minixfs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs_const.h

    r128b8ee ra6e094f  
    3737#include <sys/types.h>
    3838
    39 #define V2_NR_TZONES    10
     39#define V2_NR_DIRECT_ZONES      7
     40#define V2_NR_INDIRECT_ZONES    3
    4041
    4142#endif
  • uspace/srv/fs/minixfs/mfs_inode.h

    r128b8ee ra6e094f  
    3737#include "mfs_const.h"
    3838
    39 /*Declaration of the V2 inode as it is on disk.*/
     39/*Declaration of the MinixFS V2 inode as it is on disk.*/
    4040
    4141struct 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];
    5254} __attribute__ ((packed));
    5355
  • uspace/srv/fs/minixfs/mfs_super.h

    r128b8ee ra6e094f  
    3636#include "mfs_const.h"
    3737
    38 /* Super block table.  The root file system and every mounted file system
    39  * has an entry here.  The entry holds information about the sizes of the bit
    40  * maps and inodes.  The s_ninodes field gives the number of inodes available
    41  * for files and directories, including the root directory.  Inode 0 is
    42  * on the disk, but not used.  Thus s_ninodes = 4 means that 5 bits will be
    43  * used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
    44  * for files and directories.  The disk layout is:
    45  *
    46  *    Item        # blocks
    47  *    boot block      1
    48  *    super block     1    (offset 1kB)
    49  *    inode map     s_imap_blocks
    50  *    zone map      s_zmap_blocks
    51  *    inodes        (s_ninodes + 'inodes per block' - 1)/'inodes per block'
    52  *    unused        whatever is needed to fill out the current zone
    53  *    data zones    (s_zones - s_firstdatazone) << s_log_zone_size
    54  *
    55  */
    5638
    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*/
     39struct 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;
    6859
    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
    7162        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;
    7467} __attribute__ ((packed));
    7568
Note: See TracChangeset for help on using the changeset viewer.