Changeset acd869e in mainline
- Timestamp:
- 2011-10-11T10:32:02Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8958a26
- Parents:
- 6d52126b
- Location:
- uspace/lib/ext4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r6d52126b racd869e 36 36 */ 37 37 38 #include <byteorder.h> 39 #include "libext4_extent.h" 38 40 41 uint16_t ext4_extent_header_get_magic(ext4_extent_header_t *header) 42 { 43 return uint16_t_le2host(header->magic); 44 } 45 46 uint16_t ext4_extent_header_get_entries_count(ext4_extent_header_t *header) 47 { 48 return uint16_t_le2host(header->entries_count); 49 } 50 51 uint16_t ext4_extent_header_get_max_entries_count(ext4_extent_header_t *header) 52 { 53 return uint16_t_le2host(header->max_entries_count); 54 } 55 56 uint16_t ext4_extent_header_get_depth(ext4_extent_header_t *header) 57 { 58 return uint16_t_le2host(header->depth); 59 } 60 61 uint32_t ext4_extent_header_get_generation(ext4_extent_header_t *header) 62 { 63 return uint32_t_le2host(header->generation); 64 } 39 65 40 66 /** -
uspace/lib/ext4/libext4_extent.h
r6d52126b racd869e 68 68 } ext4_extent_header_t; 69 69 70 #define EXT4_EXTENT_MAGIC host2uint16_t_le(0xF30A) 70 #define EXT4_EXTENT_MAGIC 0xF30A 71 72 extern uint16_t ext4_extent_header_get_magic(ext4_extent_header_t *); 73 extern uint16_t ext4_extent_header_get_entries_count(ext4_extent_header_t *); 74 extern uint16_t ext4_extent_header_get_max_entries_count(ext4_extent_header_t *); 75 extern uint16_t ext4_extent_header_get_depth(ext4_extent_header_t *); 76 extern uint32_t ext4_extent_header_get_generation(ext4_extent_header_t *); 71 77 72 78 #endif -
uspace/lib/ext4/libext4_filesystem.c
r6d52126b racd869e 301 301 block_t *block; 302 302 303 // TODO extents 304 if (ext4_inode_has_flag(inode, EXT4_INODE_FLAG_EXTENTS)) { 305 EXT4FS_DBG("Inode contains Extent"); 306 // TODO 307 /* 308 current_block = ext4_inode_get_extent_block(inode, iblock); 309 *fblock = current_block; 310 return EOK; 311 */ 312 313 } 314 303 315 /* Handle simple case when we are dealing with direct reference */ 304 316 if (iblock < EXT4_INODE_DIRECT_BLOCK_COUNT) { -
uspace/lib/ext4/libext4_inode.c
r6d52126b racd869e 62 62 uint32_t major_rev = ext4_superblock_get_rev_level(sb); 63 63 64 if ( major_rev > 0&& ext4_inode_is_type(sb, inode, EXT4_INODE_MODE_FILE)) {64 if ((major_rev > 0) && ext4_inode_is_type(sb, inode, EXT4_INODE_MODE_FILE)) { 65 65 return ((uint64_t)uint32_t_le2host(inode->size_hi)) << 32 | 66 66 ((uint64_t)uint32_t_le2host(inode->size_lo)); … … 102 102 } 103 103 104 uint32_t ext4_inode_get_extent_block(ext4_inode_t *inode, uint64_t idx) 105 { 106 //ext4_extent_header_t *header = ext4_inode_get_extent_header(inode); 107 // TODO search required block 108 return 0; 109 110 } 111 112 ext4_extent_header_t * ext4_inode_get_extent_header(ext4_inode_t *inode) 113 { 114 return (ext4_extent_header_t *)inode->blocks; 115 } 104 116 105 117 // Flags checker -
uspace/lib/ext4/libext4_inode.h
r6d52126b racd869e 36 36 #include <libblock.h> 37 37 #include <sys/types.h> 38 #include "libext4_extent.h" 38 39 #include "libext4_superblock.h" 39 40 … … 167 168 uint32_t ext4_inode_get_direct_block(ext4_inode_t *, uint8_t); 168 169 uint32_t ext4_inode_get_indirect_block(ext4_inode_t *, uint8_t); 169 170 uint32_t ext4_inode_get_extent_block(ext4_inode_t *, uint64_t); 170 171 /* 171 172 uint32_t blocks[EXT4_INODE_BLOCKS]; // Pointers to blocks … … 181 182 */ 182 183 184 extern ext4_extent_header_t * ext4_inode_get_extent_header(ext4_inode_t *); 183 185 extern bool ext4_inode_has_flag(ext4_inode_t *, uint32_t); 184 186
Note:
See TracChangeset
for help on using the changeset viewer.