Changeset 566c401 in mainline for uspace/lib/ext2/libext2_superblock.c
- Timestamp:
- 2011-02-13T20:37:31Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8bd5dad
- Parents:
- e272949
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext2/libext2_superblock.c
re272949 r566c401 42 42 * Return a magic number from ext2 superblock, this should be equal to 43 43 * EXT_SUPERBLOCK_MAGIC for valid ext2 superblock 44 * 45 * @param sb pointer to superblock 44 46 */ 45 inline uint16_t ext2_superblock_get_magic(ext2_superblock_t *sb) { 47 inline uint16_t ext2_superblock_get_magic(ext2_superblock_t *sb) 48 { 46 49 return uint16_t_le2host(sb->magic); 47 50 } … … 50 53 * Get the position of first ext2 data block (i.e. the block number 51 54 * containing main superblock) 55 * 56 * @param sb pointer to superblock 52 57 */ 53 inline uint32_t ext2_superblock_get_first_block(ext2_superblock_t *sb) { 58 inline uint32_t ext2_superblock_get_first_block(ext2_superblock_t *sb) 59 { 54 60 return uint32_t_le2host(sb->first_block); 55 61 } … … 58 64 * Get the number of bits to shift a value of 1024 to the left necessary 59 65 * to get the size of a block 66 * 67 * @param sb pointer to superblock 60 68 */ 61 inline uint32_t ext2_superblock_get_block_size_log2(ext2_superblock_t *sb) { 69 inline uint32_t ext2_superblock_get_block_size_log2(ext2_superblock_t *sb) 70 { 62 71 return uint32_t_le2host(sb->block_size_log2); 63 72 } … … 65 74 /** 66 75 * Get the size of a block, in bytes 76 * 77 * @param sb pointer to superblock 67 78 */ 68 inline uint32_t ext2_superblock_get_block_size(ext2_superblock_t *sb) { 79 inline uint32_t ext2_superblock_get_block_size(ext2_superblock_t *sb) 80 { 69 81 return 1024 << ext2_superblock_get_block_size(sb); 70 82 } … … 74 86 * to get the size of a fragment (note that this is a signed integer and 75 87 * if negative, the value should be shifted to the right instead) 88 * 89 * @param sb pointer to superblock 76 90 */ 77 inline int32_t ext2_superblock_get_fragment_size_log2(ext2_superblock_t *sb) { 91 inline int32_t ext2_superblock_get_fragment_size_log2(ext2_superblock_t *sb) 92 { 78 93 return uint32_t_le2host(sb->fragment_size_log2); 79 94 } … … 81 96 /** 82 97 * Get the size of a fragment, in bytes 98 * 99 * @param sb pointer to superblock 83 100 */ 84 inline uint32_t ext2_superblock_get_fragment_size(ext2_superblock_t *sb) { 101 inline uint32_t ext2_superblock_get_fragment_size(ext2_superblock_t *sb) 102 { 85 103 int32_t log = ext2_superblock_get_fragment_size_log2(sb); 86 104 if (log >= 0) { … … 94 112 /** 95 113 * Get number of blocks per block group 114 * 115 * @param sb pointer to superblock 96 116 */ 97 inline uint32_t ext2_superblock_get_blocks_per_group(ext2_superblock_t *sb) { 117 inline uint32_t ext2_superblock_get_blocks_per_group(ext2_superblock_t *sb) 118 { 98 119 return uint32_t_le2host(sb->blocks_per_group); 99 120 } … … 101 122 /** 102 123 * Get number of fragments per block group 124 * 125 * @param sb pointer to superblock 103 126 */ 104 inline uint32_t ext2_superblock_get_fragments_per_group(ext2_superblock_t *sb) { 127 inline uint32_t ext2_superblock_get_fragments_per_group(ext2_superblock_t *sb) 128 { 105 129 return uint32_t_le2host(sb->fragments_per_group); 106 130 }
Note:
See TracChangeset
for help on using the changeset viewer.