Changeset 343ccfd in mainline for uspace/lib/ext4/libext4_directory.c


Ignore:
Timestamp:
2011-11-20T12:56:00Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ebeaaa06
Parents:
fe27eb4
Message:

next bunch of getters and setters added

File:
1 edited

Legend:

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

    rfe27eb4 r343ccfd  
    4949}
    5050
     51void ext4_directory_entry_ll_set_inode(ext4_directory_entry_ll_t *de,
     52                uint32_t inode)
     53{
     54        de->inode = host2uint32_t_le(inode);
     55}
     56
    5157uint16_t ext4_directory_entry_ll_get_entry_length(
    52     ext4_directory_entry_ll_t *de)
     58                ext4_directory_entry_ll_t *de)
    5359{
    5460        return uint16_t_le2host(de->entry_length);
     61}
     62
     63void ext4_directory_entry_ll_set_entry_length(ext4_directory_entry_ll_t *de,
     64                uint16_t length)
     65{
     66        de->entry_length = host2uint16_t_le(length);
    5567}
    5668
     
    6072        if (ext4_superblock_get_rev_level(sb) == 0 &&
    6173            ext4_superblock_get_minor_rev_level(sb) < 5) {
    62                 return ((uint16_t)de->name_length_high) << 8 |
    63                     ((uint16_t)de->name_length);
    64         }
    65         return de->name_length;
    66 }
    67 
    68 uint8_t ext4_directory_dx_root_info_get_hash_version(ext4_directory_dx_root_info_t *root_info)
    69 {
    70         return root_info->hash_version;
    71 }
    72 
    73 uint8_t ext4_directory_dx_root_info_get_info_length(ext4_directory_dx_root_info_t *root_info)
    74 {
    75         return root_info->info_length;
    76 }
    77 
    78 uint8_t ext4_directory_dx_root_info_get_indirect_levels(ext4_directory_dx_root_info_t *root_info)
    79 {
    80         return root_info->indirect_levels;
    81 }
    82 
    83 uint16_t ext4_directory_dx_countlimit_get_limit(ext4_directory_dx_countlimit_t *countlimit)
    84 {
    85         return uint16_t_le2host(countlimit->limit);
    86 }
    87 uint16_t ext4_directory_dx_countlimit_get_count(ext4_directory_dx_countlimit_t *countlimit)
    88 {
    89         return uint16_t_le2host(countlimit->count);
    90 }
    91 
    92 uint32_t ext4_directory_dx_entry_get_hash(ext4_directory_dx_entry_t *entry)
    93 {
    94         return uint32_t_le2host(entry->hash);
    95 }
    96 
    97 uint32_t ext4_directory_dx_entry_get_block(ext4_directory_dx_entry_t *entry)
    98 {
    99         return uint32_t_le2host(entry->block);
    100 }
    101 
     74
     75                return de->name_length;
     76        }
     77
     78        return ((uint16_t)de->name_length_high) << 8 |
     79            ((uint16_t)de->name_length);
     80
     81
     82}
     83
     84void ext4_directory_entry_ll_set_name_length(ext4_superblock_t *sb,
     85                ext4_directory_entry_ll_t *de, uint16_t length)
     86{
     87
     88        de->name_length = (length << 8) >> 8;
     89
     90        if (ext4_superblock_get_rev_level(sb) > 0 ||
     91                    ext4_superblock_get_minor_rev_level(sb) >= 5) {
     92
     93                de->name_length_high = length >> 8;
     94        }
     95
     96}
    10297
    10398
Note: See TracChangeset for help on using the changeset viewer.