Changeset 343ccfd in mainline for uspace/lib/ext4/libext4_directory_index.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_directory_index.c
rfe27eb4 r343ccfd 36 36 */ 37 37 38 #include <byteorder.h> 38 39 #include <errno.h> 39 40 #include "libext4.h" 41 42 43 uint8_t ext4_directory_dx_root_info_get_hash_version( 44 ext4_directory_dx_root_info_t *root_info) 45 { 46 return root_info->hash_version; 47 } 48 49 void ext4_directory_dx_root_info_set_hash_version( 50 ext4_directory_dx_root_info_t *root_info, uint8_t version) 51 { 52 root_info->hash_version = version; 53 } 54 55 uint8_t ext4_directory_dx_root_info_get_info_length( 56 ext4_directory_dx_root_info_t *root_info) 57 { 58 return root_info->info_length; 59 } 60 61 void ext4_directory_dx_root_info_set_info_length( 62 ext4_directory_dx_root_info_t *root_info, uint8_t info_length) 63 { 64 root_info->info_length = info_length; 65 } 66 67 uint8_t ext4_directory_dx_root_info_get_indirect_levels( 68 ext4_directory_dx_root_info_t *root_info) 69 { 70 return root_info->indirect_levels; 71 } 72 73 void ext4_directory_dx_root_info_set_indirect_levels( 74 ext4_directory_dx_root_info_t *root_info, uint8_t levels) 75 { 76 root_info->indirect_levels = levels; 77 } 78 79 uint16_t ext4_directory_dx_countlimit_get_limit( 80 ext4_directory_dx_countlimit_t *countlimit) 81 { 82 return uint16_t_le2host(countlimit->limit); 83 } 84 85 void ext4_directory_dx_countlimit_set_limit( 86 ext4_directory_dx_countlimit_t *countlimit, uint16_t limit) 87 { 88 countlimit->limit = host2uint16_t_le(limit); 89 } 90 91 uint16_t ext4_directory_dx_countlimit_get_count( 92 ext4_directory_dx_countlimit_t *countlimit) 93 { 94 return uint16_t_le2host(countlimit->count); 95 } 96 97 void ext4_directory_dx_countlimit_set_count( 98 ext4_directory_dx_countlimit_t *countlimit, uint16_t count) 99 { 100 countlimit->count = host2uint16_t_le(count); 101 } 102 103 uint32_t ext4_directory_dx_entry_get_hash(ext4_directory_dx_entry_t *entry) 104 { 105 return uint32_t_le2host(entry->hash); 106 } 107 108 void ext4_directory_dx_entry_set_hash(ext4_directory_dx_entry_t *entry, 109 uint32_t hash) 110 { 111 entry->hash = host2uint32_t_le(hash); 112 } 113 114 uint32_t ext4_directory_dx_entry_get_block(ext4_directory_dx_entry_t *entry) 115 { 116 return uint32_t_le2host(entry->block); 117 } 118 119 void ext4_directory_dx_entry_set_block(ext4_directory_dx_entry_t *entry, 120 uint32_t block) 121 { 122 entry->block = host2uint32_t_le(block); 123 } 124 125 126 /**************************************************************************/ 127 40 128 41 129 static int ext4_directory_hinfo_init(ext4_hash_info_t *hinfo, block_t *root_block,
Note:
See TracChangeset
for help on using the changeset viewer.