Changeset 82650385 in mainline for uspace/lib/c/include/fs/minix.h


Ignore:
Timestamp:
2011-03-05T17:11:24Z (14 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3564cdd
Parents:
939b7d2
Message:

export minixfs headers into a separate library

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/fs/minix.h

    r939b7d2 r82650385  
    2929/** @addtogroup fs
    3030 * @{
    31  */ 
     31 */
    3232
    33 #ifndef _MFS_SUPER_H_
    34 #define _MFS_SUPER_H_
     33#ifndef _MINIX_FS_H_
     34#define _MINIX_FS_H_
    3535
    36 #include "mfs_const.h"
     36#include <sys/types.h>
     37#include <bool.h>
     38
     39#define MFS_MAX_BLOCK_SIZE      4096
     40#define MFS_MIN_BLOCK_SIZE      1024
     41
     42#define MFS_ROOT_INO            1
     43#define MFS_SUPER_BLOCK         0
     44#define MFS_SUPER_BLOCK_SIZE    1024
     45
     46#define V2_NR_DIRECT_ZONES      7
     47#define V2_NR_INDIRECT_ZONES    3
     48
     49#define V1_NR_DIRECT_ZONES      7
     50#define V1_NR_INDIRECT_ZONES    2
     51
     52#define V1_MAX_NAME_LEN         14
     53#define V1L_MAX_NAME_LEN        30
     54#define V2_MAX_NAME_LEN         14
     55#define V2L_MAX_NAME_LEN        30
     56#define V3_MAX_NAME_LEN         60
    3757
    3858#define MFS_MAGIC_V1            0x137F
     
    108128} __attribute__ ((packed));
    109129
    110 typedef enum {
    111         MFS_VERSION_V1 = 1,
    112         MFS_VERSION_V1L,
    113         MFS_VERSION_V2,
    114         MFS_VERSION_V2L,
    115         MFS_VERSION_V3
    116 } mfs_version_t;
     130/*MinixFS V1 inode structure as it is on disk*/
     131struct mfs_v1_inode {
     132        uint16_t        i_mode;
     133        int16_t         i_uid;
     134        int32_t         i_size;
     135        int32_t         i_mtime;
     136        uint8_t         i_gid;
     137        uint8_t         i_nlinks;
     138        /*Block numbers for direct zones*/
     139        uint16_t        i_dzone[V1_NR_DIRECT_ZONES];
     140        /*Block numbers for indirect zones*/
     141        uint16_t        i_izone[V1_NR_INDIRECT_ZONES];
     142} __attribute__ ((packed));
     143
     144/*MinixFS V2 inode structure as it is on disk.*/
     145struct mfs_v2_inode {
     146        uint16_t        i_mode;
     147        uint16_t        i_nlinks;
     148        int16_t         i_uid;
     149        uint16_t        i_gid;
     150        int32_t         i_size;
     151        int32_t         i_atime;
     152        int32_t         i_mtime;
     153        int32_t         i_ctime;
     154        /*Block numbers for direct zones*/
     155        uint32_t        i_dzone[V2_NR_DIRECT_ZONES];
     156        /*Block numbers for indirect zones*/
     157        uint32_t        i_izone[V2_NR_INDIRECT_ZONES];
     158} __attribute__ ((packed));
     159
     160#define mfs_v2_dentry   mfs_v1_dentry
     161#define mfs_v1l_dentry  mfs_v2l_dentry
     162
     163/*MinixFS V1 directory entry on-disk structure*/
     164struct mfs_v1_dentry {
     165        uint16_t d_inum;
     166        char d_name[V1_MAX_NAME_LEN];
     167} __attribute__ ((packed));
     168
     169/*MinixFS V2 with 30-char filenames (Linux variant)*/
     170struct mfs_v2l_dentry {
     171        uint16_t d_inum;
     172        char d_name[V2L_MAX_NAME_LEN];
     173} __attribute__ ((packed));
     174
     175/*MinixFS V3 directory entry on-disk structure*/
     176struct mfs_v3_dentry {
     177        uint32_t d_inum;
     178        char d_name[V3_MAX_NAME_LEN];
     179} __attribute__ ((packed));
     180
    117181
    118182#endif
     
    120184/**
    121185 * @}
    122  */
     186 */
     187
Note: See TracChangeset for help on using the changeset viewer.