Changeset 9875711 in mainline for uspace/lib/ext4/libext4_inode.h


Ignore:
Timestamp:
2011-09-29T17:17:39Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c501f8
Parents:
eb91db7
Message:

Superblock and inode structures definition

File:
1 edited

Legend:

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

    reb91db7 r9875711  
    3434#define LIBEXT4_LIBEXT4_INODE_H_
    3535
     36#include <sys/types.h>
     37
     38// TODO better constant definition !!!
     39#define EXT4_N_BLOCKS   15
     40
     41/*
     42 * Structure of an inode on the disk
     43 */
     44typedef struct ext4_inode {
     45        uint16_t i_mode; // File mode
     46        uint16_t i_uid; // Low 16 bits of owner uid
     47        uint32_t i_size_lo; // Size in bytes
     48        uint32_t i_atime; // Access time
     49        uint32_t i_ctime; // Inode change time
     50        uint32_t i_mtime; // Modification time
     51        uint32_t i_dtime; // Deletion time
     52        uint16_t i_gid; // Low 16 bits of group id
     53        uint16_t i_links_count; // Links count
     54        uint32_t i_blocks_lo; // Blocks count
     55        uint32_t i_flags; // File flags
     56
     57        /*
     58        union {
     59                struct {
     60                        __le32  l_i_version;
     61                } linux1;
     62                struct {
     63                        __u32  h_i_translator;
     64                } hurd1;
     65                struct {
     66                        __u32  m_i_reserved1;
     67                } masix1;
     68        } osd1;
     69        */
     70        uint32_t unused_osd1; // OS dependent - not used in HelenOS
     71
     72    uint32_t i_block[EXT4_N_BLOCKS]; // Pointers to blocks
     73    uint32_t i_generation; // File version (for NFS)
     74    uint32_t i_file_acl_lo; // File ACL
     75    uint32_t i_size_high;
     76    uint32_t i_obso_faddr; // Obsoleted fragment address
     77
     78    /*
     79        union {
     80                struct {
     81                        __le16  l_i_blocks_high;
     82                        __le16  l_i_file_acl_high;
     83                        __le16  l_i_uid_high;
     84                        __le16  l_i_gid_high;
     85                        __u32   l_i_reserved2;
     86                } linux2;
     87                struct {
     88                        __le16  h_i_reserved1;
     89                        __u16   h_i_mode_high;
     90                        __u16   h_i_uid_high;
     91                        __u16   h_i_gid_high;
     92                        __u32   h_i_author;
     93                } hurd2;
     94                struct {
     95                        __le16  h_i_reserved1;
     96                        __le16  m_i_file_acl_high;
     97                        __u32   m_i_reserved2[2];
     98                } masix2;
     99        } osd2;
     100        */
     101
     102        uint32_t unused_osd2[3]; // OS dependent - not used in HelenOS
     103        uint16_t i_extra_isize;
     104        uint16_t i_pad1;
     105        uint32_t  i_ctime_extra; // Extra change time (nsec << 2 | epoch)
     106        uint32_t i_mtime_extra; // Extra Modification time (nsec << 2 | epoch)
     107        uint32_t i_atime_extra; // Extra Access time (nsec << 2 | epoch)
     108        uint32_t i_crtime; // File creation time
     109        uint32_t i_crtime_extra; // Extra file creation time (nsec << 2 | epoch)
     110        uint32_t i_version_hi;   // High 32 bits for 64-bit version
     111} __attribute__ ((packed)) ext4_inode_t;
     112
     113
    36114
    37115#endif
Note: See TracChangeset for help on using the changeset viewer.