Changeset 566c401 in mainline for uspace/lib/ext2/libext2_superblock.c


Ignore:
Timestamp:
2011-02-13T20:37:31Z (14 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8bd5dad
Parents:
e272949
Message:

Cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext2/libext2_superblock.c

    re272949 r566c401  
    4242 * Return a magic number from ext2 superblock, this should be equal to
    4343 * EXT_SUPERBLOCK_MAGIC for valid ext2 superblock
     44 *
     45 * @param sb pointer to superblock
    4446 */
    45 inline uint16_t ext2_superblock_get_magic(ext2_superblock_t *sb) {
     47inline uint16_t ext2_superblock_get_magic(ext2_superblock_t *sb)
     48{
    4649        return uint16_t_le2host(sb->magic);
    4750}
     
    5053 * Get the position of first ext2 data block (i.e. the block number
    5154 * containing main superblock)
     55 *
     56 * @param sb pointer to superblock
    5257 */
    53 inline uint32_t ext2_superblock_get_first_block(ext2_superblock_t *sb) {
     58inline uint32_t ext2_superblock_get_first_block(ext2_superblock_t *sb)
     59{
    5460        return uint32_t_le2host(sb->first_block);
    5561}
     
    5864 * Get the number of bits to shift a value of 1024 to the left necessary
    5965 * to get the size of a block
     66 *
     67 * @param sb pointer to superblock
    6068 */
    61 inline uint32_t ext2_superblock_get_block_size_log2(ext2_superblock_t *sb) {
     69inline uint32_t ext2_superblock_get_block_size_log2(ext2_superblock_t *sb)
     70{
    6271        return uint32_t_le2host(sb->block_size_log2);
    6372}
     
    6574/**
    6675 * Get the size of a block, in bytes
     76 *
     77 * @param sb pointer to superblock
    6778 */
    68 inline uint32_t ext2_superblock_get_block_size(ext2_superblock_t *sb) {
     79inline uint32_t ext2_superblock_get_block_size(ext2_superblock_t *sb)
     80{
    6981        return 1024 << ext2_superblock_get_block_size(sb);
    7082}
     
    7486 * to get the size of a fragment (note that this is a signed integer and
    7587 * if negative, the value should be shifted to the right instead)
     88 *
     89 * @param sb pointer to superblock
    7690 */
    77 inline int32_t ext2_superblock_get_fragment_size_log2(ext2_superblock_t *sb) {
     91inline int32_t ext2_superblock_get_fragment_size_log2(ext2_superblock_t *sb)
     92{
    7893        return uint32_t_le2host(sb->fragment_size_log2);
    7994}
     
    8196/**
    8297 * Get the size of a fragment, in bytes
     98 *
     99 * @param sb pointer to superblock
    83100 */
    84 inline uint32_t ext2_superblock_get_fragment_size(ext2_superblock_t *sb) {
     101inline uint32_t ext2_superblock_get_fragment_size(ext2_superblock_t *sb)
     102{
    85103        int32_t log = ext2_superblock_get_fragment_size_log2(sb);
    86104        if (log >= 0) {
     
    94112/**
    95113 * Get number of blocks per block group
     114 *
     115 * @param sb pointer to superblock
    96116 */
    97 inline uint32_t ext2_superblock_get_blocks_per_group(ext2_superblock_t *sb) {
     117inline uint32_t ext2_superblock_get_blocks_per_group(ext2_superblock_t *sb)
     118{
    98119        return uint32_t_le2host(sb->blocks_per_group);
    99120}
     
    101122/**
    102123 * Get number of fragments per block group
     124 *
     125 * @param sb pointer to superblock
    103126 */
    104 inline uint32_t ext2_superblock_get_fragments_per_group(ext2_superblock_t *sb) {
     127inline uint32_t ext2_superblock_get_fragments_per_group(ext2_superblock_t *sb)
     128{
    105129        return uint32_t_le2host(sb->fragments_per_group);
    106130}
Note: See TracChangeset for help on using the changeset viewer.