Changeset 9c0c0e1 in mainline for uspace/lib/ext4/libext4_inode.h


Ignore:
Timestamp:
2011-10-04T12:18:44Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a23297c
Parents:
01ab41b
Message:

part of code needed for successful mount (porting from ext2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_inode.h

    r01ab41b r9c0c0e1  
    3737#include <sys/types.h>
    3838
    39 // TODO better constant definition !!!
    40 #define EXT4_N_BLOCKS   15
     39#define EXT4_DIRECT_BLOCK_COUNT         12
     40#define EXT4_INDIRECT_BLOCK             EXT4_DIRECT_BLOCK_COUNT
     41#define EXT4_DOUBLE_INDIRECT_BLOCK      (EXT4_INDIRECT_BLOCK + 1)
     42#define EXT4_TRIPPLE_INDIRECT_BLOCK     (EXT4_DOUBLE_INDIRECT_BLOCK + 1)
     43#define EXT4_INODE_BLOCKS                       (EXT4_TRIPPLE_INDIRECT_BLOCK + 1)
    4144
    4245/*
     
    4447 */
    4548typedef struct ext4_inode {
    46         uint16_t i_mode; // File mode
    47         uint16_t i_uid; // Low 16 bits of owner uid
    48         uint32_t i_size_lo; // Size in bytes
    49         uint32_t i_atime; // Access time
    50         uint32_t i_ctime; // Inode change time
    51         uint32_t i_mtime; // Modification time
    52         uint32_t i_dtime; // Deletion time
    53         uint16_t i_gid; // Low 16 bits of group id
    54         uint16_t i_links_count; // Links count
    55         uint32_t i_blocks_lo; // Blocks count
    56         uint32_t i_flags; // File flags
     49        uint16_t mode; // File mode
     50        uint16_t uid; // Low 16 bits of owner uid
     51        uint32_t size_lo; // Size in bytes
    5752
    58         /*
    59         union {
    60                 struct {
    61                         __le32  l_i_version;
    62                 } linux1;
    63                 struct {
    64                         __u32  h_i_translator;
    65                 } hurd1;
    66                 struct {
    67                         __u32  m_i_reserved1;
    68                 } masix1;
    69         } osd1;
    70         */
     53        // TODO Used in HelenOS ???
     54        uint32_t atime; // Access time
     55        uint32_t ctime; // Inode change time
     56        uint32_t mtime; // Modification time
     57        uint32_t dtime; // Deletion time
     58
     59        uint16_t gid; // Low 16 bits of group id
     60        uint16_t links_count; // Links count
     61        uint32_t blocks_lo; // Blocks count
     62        uint32_t flags; // File flags
    7163        uint32_t unused_osd1; // OS dependent - not used in HelenOS
    72 
    73     uint32_t i_block[EXT4_N_BLOCKS]; // Pointers to blocks
    74     uint32_t i_generation; // File version (for NFS)
    75     uint32_t i_file_acl_lo; // File ACL
    76     uint32_t i_size_high;
    77     uint32_t i_obso_faddr; // Obsoleted fragment address
    78 
    79     /*
    80         union {
    81                 struct {
    82                         __le16  l_i_blocks_high;
    83                         __le16  l_i_file_acl_high;
    84                         __le16  l_i_uid_high;
    85                         __le16  l_i_gid_high;
    86                         __u32   l_i_reserved2;
    87                 } linux2;
    88                 struct {
    89                         __le16  h_i_reserved1;
    90                         __u16   h_i_mode_high;
    91                         __u16   h_i_uid_high;
    92                         __u16   h_i_gid_high;
    93                         __u32   h_i_author;
    94                 } hurd2;
    95                 struct {
    96                         __le16  h_i_reserved1;
    97                         __le16  m_i_file_acl_high;
    98                         __u32   m_i_reserved2[2];
    99                 } masix2;
    100         } osd2;
    101         */
    102 
    103         uint32_t unused_osd2[3]; // OS dependent - not used in HelenOS
    104         uint16_t i_extra_isize;
    105         uint16_t i_pad1;
    106         uint32_t  i_ctime_extra; // Extra change time (nsec << 2 | epoch)
    107         uint32_t i_mtime_extra; // Extra Modification time (nsec << 2 | epoch)
    108         uint32_t i_atime_extra; // Extra Access time (nsec << 2 | epoch)
    109         uint32_t i_crtime; // File creation time
    110         uint32_t i_crtime_extra; // Extra file creation time (nsec << 2 | epoch)
    111         uint32_t i_version_hi;   // High 32 bits for 64-bit version
     64    uint32_t blocks[EXT4_INODE_BLOCKS]; // Pointers to blocks
     65    uint32_t generation; // File version (for NFS)
     66    uint32_t file_acl_lo; // File ACL
     67    uint32_t size_hi;
     68    uint32_t obso_faddr; // Obsoleted fragment address
     69    uint32_t unused_osd2[3]; // OS dependent - not used in HelenOS
     70    uint16_t extra_isize;
     71    uint16_t pad1;
     72    uint32_t ctime_extra; // Extra change time (nsec << 2 | epoch)
     73    uint32_t mtime_extra; // Extra Modification time (nsec << 2 | epoch)
     74    uint32_t atime_extra; // Extra Access time (nsec << 2 | epoch)
     75    uint32_t crtime; // File creation time
     76    uint32_t crtime_extra; // Extra file creation time (nsec << 2 | epoch)
     77    uint32_t version_hi;   // High 32 bits for 64-bit version
    11278} __attribute__ ((packed)) ext4_inode_t;
    11379
    11480
    115 // TODO check value
    11681#define EXT4_INODE_ROOT_INDEX   2
    11782
Note: See TracChangeset for help on using the changeset viewer.