Changeset c00e729 in mainline for uspace/lib/ext2/libext2_superblock.c


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

Support for some more superblock fields and displaying in ext2info

File:
1 edited

Legend:

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

    r8bd5dad rc00e729  
    130130}
    131131
     132/**
     133 * Get filesystem state
     134 *
     135 * @param sb pointer to superblock
     136 */
     137inline uint16_t ext2_superblock_get_state(ext2_superblock_t *sb)
     138{
     139        return uint16_t_le2host(sb->state);
     140}
     141
     142/**
     143 * Get minor revision number
     144 *
     145 * @param sb pointer to superblock
     146 */
     147inline uint16_t ext2_superblock_get_rev_minor(ext2_superblock_t *sb)
     148{
     149        return uint16_t_le2host(sb->rev_minor);
     150}
     151
     152/**
     153 * Get major revision number
     154 *
     155 * @param sb pointer to superblock
     156 */
     157inline uint32_t ext2_superblock_get_rev_major(ext2_superblock_t *sb)
     158{
     159        return uint32_t_le2host(sb->rev_major);
     160}
     161
     162/**
     163 * Get index of first regular inode
     164 *
     165 * @param sb pointer to superblock
     166 */
     167inline uint32_t ext2_superblock_get_first_inode(ext2_superblock_t *sb)
     168{
     169        if (ext2_superblock_get_rev_major(sb) == 0) {
     170                return EXT2_REV0_FIRST_INODE;
     171        }
     172        return uint32_t_le2host(sb->first_inode);
     173}
     174
     175/**
     176 * Get size of inode
     177 *
     178 * @param sb pointer to superblock
     179 */
     180inline uint16_t ext2_superblock_get_inode_size(ext2_superblock_t *sb)
     181{
     182        if (ext2_superblock_get_rev_major(sb) == 0) {
     183                return EXT2_REV0_INODE_SIZE;
     184        }
     185        return uint32_t_le2host(sb->inode_size);
     186}
     187
    132188
    133189/** Read a superblock directly from device (i.e. no libblock cache)
Note: See TracChangeset for help on using the changeset viewer.