Changeset 343ccfd in mainline for uspace/lib/ext4/libext4_extent.c
- Timestamp:
- 2011-11-20T12:56:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ebeaaa06
- Parents:
- fe27eb4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
rfe27eb4 r343ccfd 44 44 } 45 45 46 void ext4_extent_set_first_block(ext4_extent_t *extent, uint32_t first_block) 47 { 48 extent->first_block = host2uint32_t_le(first_block); 49 } 50 46 51 uint16_t ext4_extent_get_block_count(ext4_extent_t *extent) 47 52 { 48 53 return uint16_t_le2host(extent->block_count); 54 } 55 56 void ext4_extent_set_block_count(ext4_extent_t *extent, uint16_t block_count) 57 { 58 extent->block_count = host2uint16_t_le(block_count); 49 59 } 50 60 … … 53 63 return ((uint64_t)uint16_t_le2host(extent->start_hi)) << 32 | 54 64 ((uint64_t)uint32_t_le2host(extent->start_lo)); 65 } 55 66 67 void ext4_extent_set_start(ext4_extent_t *extent, uint64_t start) 68 { 69 extent->start_lo = host2uint32_t_le((start << 32) >> 32); 70 extent->start_hi = host2uint16_t_le((uint16_t)(start >> 32)); 56 71 } 57 72 … … 61 76 } 62 77 78 void ext4_extent_index_set_first_block(ext4_extent_index_t *index, 79 uint32_t first) 80 { 81 index->first_block = host2uint32_t_le(first); 82 } 83 63 84 uint64_t ext4_extent_index_get_leaf(ext4_extent_index_t *index) 64 85 { 65 86 return ((uint64_t)uint16_t_le2host(index->leaf_hi)) << 32 | 66 ((uint64_t)uint32_t_le2host(index->leaf_lo)); 87 ((uint64_t)uint32_t_le2host(index->leaf_lo)); 88 } 89 90 void ext4_extent_index_set_leaf(ext4_extent_index_t *index, uint64_t leaf) 91 { 92 index->leaf_lo = host2uint32_t_le((leaf << 32) >> 32); 93 index->leaf_hi = host2uint16_t_le((uint16_t)(leaf >> 32)); 67 94 } 68 95 … … 72 99 } 73 100 101 void ext4_extent_header_set_magic(ext4_extent_header_t *header, uint16_t magic) 102 { 103 header->magic = host2uint16_t_le(magic); 104 } 105 74 106 uint16_t ext4_extent_header_get_entries_count(ext4_extent_header_t *header) 75 107 { 76 108 return uint16_t_le2host(header->entries_count); 109 } 110 111 void ext4_extent_header_set_entries_count(ext4_extent_header_t *header, 112 uint16_t count) 113 { 114 header->entries_count = host2uint16_t_le(count); 77 115 } 78 116 … … 82 120 } 83 121 122 void ext4_extent_header_set_max_entries_count(ext4_extent_header_t *header, 123 uint16_t max_count) 124 { 125 header->max_entries_count = host2uint16_t_le(max_count); 126 } 127 84 128 uint16_t ext4_extent_header_get_depth(ext4_extent_header_t *header) 85 129 { 86 130 return uint16_t_le2host(header->depth); 131 } 132 133 void ext4_extent_header_set_depth(ext4_extent_header_t *header, uint16_t depth) 134 { 135 header->depth = host2uint16_t_le(depth); 87 136 } 88 137 … … 92 141 } 93 142 143 void ext4_extent_header_set_generation(ext4_extent_header_t *header, 144 uint32_t generation) 145 { 146 header->generation = host2uint32_t_le(generation); 147 } 148 94 149 /** 95 150 * @}
Note:
See TracChangeset
for help on using the changeset viewer.