Changeset 2ea6392 in mainline for uspace/lib/ext4


Ignore:
Timestamp:
2011-10-10T09:22:25Z (14 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7b9381b
Parents:
7a68fe5
Message:

cleaning debug some debug messages and added feature checkers

Location:
uspace/lib/ext4
Files:
4 edited

Legend:

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

    r7a68fe5 r2ea6392  
    142142                }
    143143
    144                 EXT4FS_DBG("next_block_phys_idx: \%d", next_block_phys_idx);
    145 
    146144                rc = block_get(&it->current_block, it->fs->device, next_block_phys_idx,
    147145                    BLOCK_FLAGS_NONE);
  • uspace/lib/ext4/libext4_directory.h

    r7a68fe5 r2ea6392  
    3737#include "libext4_inode.h"
    3838
     39#define EXT4_FILENAME_LEN       255
     40
    3941/**
    4042 * Linked list directory entry structure
     
    4850                uint8_t inode_type; // Type of referenced inode (in rev >= 0.5)
    4951        } __attribute__ ((packed));
    50         uint8_t name; // First byte of name, if present
     52        uint8_t name[EXT4_FILENAME_LEN]; // Entry name
    5153} __attribute__ ((packed)) ext4_directory_entry_ll_t;
    5254
  • uspace/lib/ext4/libext4_filesystem.c

    r7a68fe5 r2ea6392  
    127127}
    128128
     129// Feature checkers
     130bool ext4_filesystem_has_feature_compatible(ext4_filesystem_t *fs, uint32_t feature)
     131{
     132        ext4_superblock_t *sb = fs->superblock;
     133
     134        if (ext4_superblock_get_features_compatible(sb) & feature) {
     135                return true;
     136        }
     137        return false;
     138}
     139
     140bool ext4_filesystem_has_feature_incompatible(ext4_filesystem_t *fs, uint32_t feature)
     141{
     142        ext4_superblock_t *sb = fs->superblock;
     143
     144        if (ext4_superblock_get_features_incompatible(sb) & feature) {
     145                return true;
     146        }
     147        return false;
     148}
     149
     150bool ext4_filesystem_has_feature_read_only(ext4_filesystem_t *fs, uint32_t feature)
     151{
     152        ext4_superblock_t *sb = fs->superblock;
     153
     154        if (ext4_superblock_get_features_read_only(sb) & feature) {
     155                return true;
     156        }
     157        return false;
     158}
     159
     160
    129161int ext4_filesystem_get_block_group_ref(ext4_filesystem_t *fs, uint32_t bgid,
    130162    ext4_block_group_ref_t **ref)
  • uspace/lib/ext4/libext4_filesystem.h

    r7a68fe5 r2ea6392  
    104104extern int ext4_filesystem_check_sanity(ext4_filesystem_t *fs);
    105105extern int ext4_filesystem_check_features(ext4_filesystem_t *, bool *);
     106extern bool ext4_filesystem_has_feature_compatible(ext4_filesystem_t *, uint32_t);
     107extern bool ext4_filesystem_has_feature_incompatible(ext4_filesystem_t *, uint32_t);
     108extern bool ext4_filesystem_has_feature_read_only(ext4_filesystem_t *, uint32_t);
    106109extern int ext4_filesystem_get_block_group_ref(ext4_filesystem_t *, uint32_t,
    107110    ext4_block_group_ref_t **);
Note: See TracChangeset for help on using the changeset viewer.