Changeset 9c0c0e1 in mainline for uspace/lib/ext4/libext4_superblock.c


Ignore:
Timestamp:
2011-10-04T12:18:44Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a23297c
Parents:
01ab41b
Message:

part of code needed for successful mount (porting from ext2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_superblock.c

    r01ab41b r9c0c0e1  
    4545 * TODO doxy
    4646 */
    47 uint16_t ext2_superblock_get_magic(ext4_superblock_t *sb)
     47uint16_t ext4_superblock_get_magic(ext4_superblock_t *sb)
    4848{
    49         return uint16_t_le2host(sb->s_magic);
     49        return uint16_t_le2host(sb->magic);
    5050}
    5151
     
    5555uint32_t ext4_superblock_get_first_block(ext4_superblock_t *sb)
    5656{
    57         return uint32_t_le2host(sb->s_first_data_block);
     57        return uint32_t_le2host(sb->first_data_block);
    5858}
    5959
     
    6363uint32_t ext4_superblock_get_block_size_log2(ext4_superblock_t *sb)
    6464{
    65         return uint32_t_le2host(sb->s_log_block_size);
     65        return uint32_t_le2host(sb->log_block_size);
    6666}
    6767
     
    7272{
    7373        return 1024 << ext4_superblock_get_block_size_log2(sb);
     74}
     75
     76/**
     77 * TODO doxy
     78 */
     79uint32_t ext4_superblock_get_rev_level(ext4_superblock_t *sb)
     80{
     81        return uint32_t_le2host(sb->rev_level);
     82}
     83
     84/**
     85 * TODO doxy
     86 */
     87uint32_t ext4_superblock_get_features_compatible(ext4_superblock_t *sb)
     88{
     89        return uint32_t_le2host(sb->features_compatible);
     90}
     91
     92/**
     93 * TODO doxy
     94 */
     95uint32_t ext4_superblock_get_features_incompatible(ext4_superblock_t *sb)
     96{
     97        return uint32_t_le2host(sb->features_incompatible);
     98}
     99
     100/**
     101 * TODO doxy
     102 */
     103uint32_t ext4_superblock_get_features_read_only(ext4_superblock_t *sb)
     104{
     105        return uint32_t_le2host(sb->features_read_only);
    74106}
    75107
     
    107139int ext4_superblock_check_sanity(ext4_superblock_t *sb)
    108140{
    109         // TODO
     141        if (ext4_superblock_get_magic(sb) != EXT4_SUPERBLOCK_MAGIC) {
     142                return ENOTSUP;
     143        }
     144
     145        // TODO more checks !!!
     146
    110147        return EOK;
    111148}
Note: See TracChangeset for help on using the changeset viewer.