Changeset cb7056a in mainline
- Timestamp:
- 2012-04-21T20:54:37Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 728d771
- Parents:
- 2d1f7a21
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r2d1f7a21 rcb7056a 41 41 #include "libext4.h" 42 42 43 /** Get logical number of the block covered extent. 44 * 45 * @param extent extent to load number from 46 * @return logical number of the first block covered by extent 47 */ 43 48 uint32_t ext4_extent_get_first_block(ext4_extent_t *extent) 44 49 { … … 46 51 } 47 52 48 void ext4_extent_set_first_block(ext4_extent_t *extent, uint32_t first_block) 49 { 50 extent->first_block = host2uint32_t_le(first_block); 51 } 52 53 /** Set logical number of the first block covered by extent. 54 * 55 * @param extent extent to load number from 56 * @param iblock logical number of the first block covered by extent 57 */ 58 void ext4_extent_set_first_block(ext4_extent_t *extent, uint32_t iblock) 59 { 60 extent->first_block = host2uint32_t_le(iblock); 61 } 62 63 /** Get number of blocks covered by extent. 64 * 65 * @param extent extent to load count from 66 * @return number of blocks covered by extent 67 */ 53 68 uint16_t ext4_extent_get_block_count(ext4_extent_t *extent) 54 69 { … … 56 71 } 57 72 58 void ext4_extent_set_block_count(ext4_extent_t *extent, uint16_t block_count) 59 { 60 extent->block_count = host2uint16_t_le(block_count); 61 } 62 73 /** Set number of blocks covered by extent. 74 * 75 * @param extent extent to load count from 76 * @param count number of blocks covered by extent 77 */ 78 void ext4_extent_set_block_count(ext4_extent_t *extent, uint16_t count) 79 { 80 extent->block_count = host2uint16_t_le(count); 81 } 82 83 /** Get physical number of the first block covered by extent. 84 * 85 * @param extent extent to load number 86 * @return physical number of the first block covered by extent 87 */ 63 88 uint64_t ext4_extent_get_start(ext4_extent_t *extent) 64 89 { … … 67 92 } 68 93 69 void ext4_extent_set_start(ext4_extent_t *extent, uint64_t start) 70 { 71 extent->start_lo = host2uint32_t_le((start << 32) >> 32); 72 extent->start_hi = host2uint16_t_le((uint16_t)(start >> 32)); 73 } 94 /** Set physical number of the first block covered by extent. 95 * 96 * @param extent extent to load number 97 * @param fblock physical number of the first block covered by extent 98 */ 99 void ext4_extent_set_start(ext4_extent_t *extent, uint64_t fblock) 100 { 101 extent->start_lo = host2uint32_t_le((fblock << 32) >> 32); 102 extent->start_hi = host2uint16_t_le((uint16_t)(fblock >> 32)); 103 } 104 105 // TODO start comments here 74 106 75 107 uint32_t ext4_extent_index_get_first_block(ext4_extent_index_t *index)
Note:
See TracChangeset
for help on using the changeset viewer.