Index: uspace/lib/ext4/libext4_inode.h
===================================================================
--- uspace/lib/ext4/libext4_inode.h	(revision 343ccfd8e68d1b8af5ab00c04b07d36ffa854c56)
+++ uspace/lib/ext4/libext4_inode.h	(revision b53a7335885c21fb5a52af874031e5d7a9db7648)
@@ -36,111 +36,5 @@
 #include <libblock.h>
 #include <sys/types.h>
-#include "libext4_extent.h"
-#include "libext4_superblock.h"
-
-#define EXT4_INODE_BLOCK_SIZE				512
-
-#define EXT4_INODE_DIRECT_BLOCK_COUNT		12
-#define EXT4_INODE_INDIRECT_BLOCK 			EXT4_INODE_DIRECT_BLOCK_COUNT
-#define EXT4_INODE_DOUBLE_INDIRECT_BLOCK	(EXT4_INODE_INDIRECT_BLOCK + 1)
-#define EXT4_INODE_TRIPPLE_INDIRECT_BLOCK	(EXT4_INODE_DOUBLE_INDIRECT_BLOCK + 1)
-#define EXT4_INODE_BLOCKS					(EXT4_INODE_TRIPPLE_INDIRECT_BLOCK + 1)
-#define EXT4_INODE_INDIRECT_BLOCK_COUNT		(EXT4_INODE_BLOCKS - EXT4_INODE_DIRECT_BLOCK_COUNT)
-
-/*
- * Structure of an inode on the disk
- */
-typedef struct ext4_inode {
-	uint16_t mode; // File mode
-	uint16_t uid; // Low 16 bits of owner uid
-	uint32_t size_lo; // Size in bytes
-	uint32_t access_time; // Access time
-	uint32_t change_inode_time; // Inode change time
-	uint32_t modification_time; // Modification time
-	uint32_t deletion_time; // Deletion time
-	uint16_t gid; // Low 16 bits of group id
-	uint16_t links_count; // Links count
-	uint32_t blocks_count_lo; // Blocks count
-	uint32_t flags; // File flags
-	uint32_t unused_osd1; // OS dependent - not used in HelenOS
-    uint32_t blocks[EXT4_INODE_BLOCKS]; // Pointers to blocks
-    uint32_t generation; // File version (for NFS)
-    uint32_t file_acl_lo; // File ACL
-    uint32_t size_hi;
-    uint32_t obso_faddr; // Obsoleted fragment address
-    union {
-    	struct {
-    		uint16_t blocks_high; /* were l_i_reserved1 */
-    		uint16_t file_acl_high;
-    		uint16_t uid_high;   /* these 2 fields */
-    		uint16_t gid_high;   /* were reserved2[0] */
-    		uint32_t reserved2;
-    	} linux2;
-    	struct {
-    		uint16_t reserved1;  /* Obsoleted fragment number/size which are removed in ext4 */
-    		uint16_t mode_high;
-    		uint16_t uid_high;
-    		uint16_t gid_high;
-    		uint32_t author;
-    	} hurd2;
-    } __attribute__ ((packed)) osd2;
-
-    uint16_t extra_isize;
-    uint16_t pad1;
-    uint32_t ctime_extra; // Extra change time (nsec << 2 | epoch)
-    uint32_t mtime_extra; // Extra Modification time (nsec << 2 | epoch)
-    uint32_t atime_extra; // Extra Access time (nsec << 2 | epoch)
-    uint32_t crtime; // File creation time
-    uint32_t crtime_extra; // Extra file creation time (nsec << 2 | epoch)
-    uint32_t version_hi;   // High 32 bits for 64-bit version
-} __attribute__ ((packed)) ext4_inode_t;
-
-#define EXT4_INODE_MODE_FIFO		0x1000
-#define EXT4_INODE_MODE_CHARDEV		0x2000
-#define EXT4_INODE_MODE_DIRECTORY	0x4000
-#define EXT4_INODE_MODE_BLOCKDEV	0x6000
-#define EXT4_INODE_MODE_FILE		0x8000
-#define EXT4_INODE_MODE_SOFTLINK	0xA000
-#define EXT4_INODE_MODE_SOCKET		0xC000
-#define EXT4_INODE_MODE_TYPE_MASK	0xF000
-
-/*
- * Inode flags
- */
-#define EXT4_INODE_FLAG_SECRM		0x00000001 // Secure deletion
-#define EXT4_INODE_FLAG_UNRM		0x00000002 // Undelete
-#define EXT4_INODE_FLAG_COMPR		0x00000004 // Compress file
-#define EXT4_INODE_FLAG_SYNC		0x00000008 // Synchronous updates
-#define EXT4_INODE_FLAG_IMMUTABLE   0x00000010 // Immutable file
-#define EXT4_INODE_FLAG_APPEND		0x00000020 // writes to file may only append
-#define EXT4_INODE_FLAG_NODUMP		0x00000040 // do not dump file
-#define EXT4_INODE_FLAG_NOATIME		0x00000080 // do not update atime
-/* Compression flags */
-#define EXT4_INODE_FLAG_DIRTY		0x00000100
-#define EXT4_INODE_FLAG_COMPRBLK	0x00000200 // One or more compressed clusters
-#define EXT4_INODE_FLAG_NOCOMPR		0x00000400 // Don't compress
-#define EXT4_INODE_FLAG_ECOMPR		0x00000800 // Compression error
-/* End compression flags --- maybe not all used */
-#define EXT4_INODE_FLAG_INDEX		0x00001000 // hash-indexed directory
-#define EXT4_INODE_FLAG_IMAGIC		0x00002000 // AFS directory */
-#define EXT4_INODE_FLAG_JOURNAL_DATA	0x00004000 // File data should be journaled
-#define EXT4_INODE_FLAG_NOTAIL		0x00008000 // File tail should not be merged
-#define EXT4_INODE_FLAG_DIRSYNC		0x00010000 // Dirsync behaviour (directories only)
-#define EXT4_INODE_FLAG_TOPDIR		0x00020000 // Top of directory hierarchies
-#define EXT4_INODE_FLAG_HUGE_FILE	0x00040000 // Set to each huge file
-#define EXT4_INODE_FLAG_EXTENTS		0x00080000 // Inode uses extents
-#define EXT4_INODE_FLAG_EA_INODE	0x00200000 // Inode used for large EA
-#define EXT4_INODE_FLAG_EOFBLOCKS	0x00400000 // Blocks allocated beyond EOF
-#define EXT4_INODE_FLAG_RESERVED	0x80000000 // reserved for ext4 lib
-
-#define EXT4_INODE_ROOT_INDEX	2
-
-typedef struct ext4_inode_ref {
-	block_t *block; // Reference to a block containing this inode
-	ext4_inode_t *inode;
-	uint32_t index; // Index number of this inode
-	bool dirty;
-} ext4_inode_ref_t;
-
+#include "libext4_types.h"
 
 extern uint32_t ext4_inode_get_mode(ext4_superblock_t *, ext4_inode_t *);
