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


Ignore:
Timestamp:
2011-10-06T09:48:53Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1114173
Parents:
3712434
Message:

mounting + list of mounted directory (ported from ext2) - many TODO remaining

File:
1 edited

Legend:

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

    r3712434 r9b9d37bb  
    3636#include <libblock.h>
    3737#include <sys/types.h>
     38#include "libext4_superblock.h"
    3839
    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)
     40
     41#define EXT4_INODE_DIRECT_BLOCK_COUNT           12
     42#define EXT4_INODE_INDIRECT_BLOCK                       EXT4_INODE_DIRECT_BLOCK_COUNT
     43#define EXT4_INODE_DOUBLE_INDIRECT_BLOCK        (EXT4_INODE_INDIRECT_BLOCK + 1)
     44#define EXT4_INODE_TRIPPLE_INDIRECT_BLOCK       (EXT4_INODE_DOUBLE_INDIRECT_BLOCK + 1)
     45#define EXT4_INODE_BLOCKS                                       (EXT4_INODE_TRIPPLE_INDIRECT_BLOCK + 1)
     46#define EXT4_INODE_INDIRECT_BLOCK_COUNT         (EXT4_INODE_BLOCKS - EXT4_INODE_DIRECT_BLOCK_COUNT)
    4447
    4548/*
     
    6467    uint32_t size_hi;
    6568    uint32_t obso_faddr; // Obsoleted fragment address
    66     uint32_t unused_osd2[3]; // OS dependent - not used in HelenOS
     69    union {
     70        struct {
     71                uint16_t blocks_high; /* were l_i_reserved1 */
     72                uint16_t file_acl_high;
     73                uint16_t uid_high;   /* these 2 fields */
     74                uint16_t gid_high;   /* were reserved2[0] */
     75                uint32_t reserved2;
     76        } linux2;
     77        struct {
     78                uint16_t reserved1;  /* Obsoleted fragment number/size which are removed in ext4 */
     79                uint16_t mode_high;
     80                uint16_t uid_high;
     81                uint16_t gid_high;
     82                uint32_t author;
     83        } hurd2;
     84        struct {
     85                uint16_t reserved1;  /* Obsoleted fragment number/size which are removed in ext4 */
     86                uint16_t file_acl_high;
     87                uint32_t reserved2[2];
     88        } masix2;
     89    } __attribute__ ((packed)) osd2;
     90
    6791    uint16_t extra_isize;
    6892    uint16_t pad1;
     
    7599} __attribute__ ((packed)) ext4_inode_t;
    76100
     101#define EXT4_INODE_MODE_FIFO            0x1000
     102#define EXT4_INODE_MODE_CHARDEV         0x2000
     103#define EXT4_INODE_MODE_DIRECTORY       0x4000
     104#define EXT4_INODE_MODE_BLOCKDEV        0x6000
     105#define EXT4_INODE_MODE_FILE            0x8000
     106#define EXT4_INODE_MODE_SOFTLINK        0xA000
     107#define EXT4_INODE_MODE_SOCKET          0xC000
     108#define EXT4_INODE_MODE_TYPE_MASK       0xF000
    77109
    78110#define EXT4_INODE_ROOT_INDEX   2
     
    84116} ext4_inode_ref_t;
    85117
     118
     119extern uint32_t ext4_inode_get_mode(ext4_superblock_t *, ext4_inode_t *);
     120extern bool ext4_inode_is_type(ext4_superblock_t *, ext4_inode_t *, uint32_t);
    86121/*
    87 extern uint16_t ext4_inode_get_mode(ext4_inode_t *);
    88122extern uint32_t ext4_inode_get_uid(ext4_inode_t *);
    89123*/
    90 extern uint64_t ext4_inode_get_size(ext4_inode_t *);
     124extern uint64_t ext4_inode_get_size(ext4_superblock_t *, ext4_inode_t *);
    91125/*
    92126extern uint32_t ext4_inode_get_access_time(ext4_inode_t *);
     
    101135extern uint32_t ext4_inode_get_flags(ext4_inode_t *);
    102136*/
     137
     138uint32_t ext4_inode_get_direct_block(ext4_inode_t *, uint8_t);
     139uint32_t ext4_inode_get_indirect_block(ext4_inode_t *, uint8_t);
    103140
    104141/*
Note: See TracChangeset for help on using the changeset viewer.