Changeset cb7056a in mainline


Ignore:
Timestamp:
2012-04-21T20:54:37Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
728d771
Parents:
2d1f7a21
Message:

comments on getters and setters used for extent structure

File:
1 edited

Legend:

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

    r2d1f7a21 rcb7056a  
    4141#include "libext4.h"
    4242
     43/** Get logical number of the block covered extent.
     44 *
     45 * @param extent        extent to load number from
     46 * @return                      logical number of the first block covered by extent
     47 */
    4348uint32_t ext4_extent_get_first_block(ext4_extent_t *extent)
    4449{
     
    4651}
    4752
    48 void ext4_extent_set_first_block(ext4_extent_t *extent, uint32_t first_block)
    49 {
    50         extent->first_block = host2uint32_t_le(first_block);
    51 }
    52 
     53/** Set logical number of the first block covered by extent.
     54 *
     55 * @param extent        extent to load number from
     56 * @param iblock        logical number of the first block covered by extent
     57 */
     58void ext4_extent_set_first_block(ext4_extent_t *extent, uint32_t iblock)
     59{
     60        extent->first_block = host2uint32_t_le(iblock);
     61}
     62
     63/** Get number of blocks covered by extent.
     64 *
     65 * @param extent        extent to load count from
     66 * @return                      number of blocks covered by extent
     67 */
    5368uint16_t ext4_extent_get_block_count(ext4_extent_t *extent)
    5469{
     
    5671}
    5772
    58 void ext4_extent_set_block_count(ext4_extent_t *extent, uint16_t block_count)
    59 {
    60         extent->block_count = host2uint16_t_le(block_count);
    61 }
    62 
     73/** Set number of blocks covered by extent.
     74 *
     75 * @param extent        extent to load count from
     76 * @param count         number of blocks covered by extent
     77 */
     78void ext4_extent_set_block_count(ext4_extent_t *extent, uint16_t count)
     79{
     80        extent->block_count = host2uint16_t_le(count);
     81}
     82
     83/** Get physical number of the first block covered by extent.
     84 *
     85 * @param extent        extent to load number
     86 * @return                      physical number of the first block covered by extent
     87 */
    6388uint64_t ext4_extent_get_start(ext4_extent_t *extent)
    6489{
     
    6792}
    6893
    69 void ext4_extent_set_start(ext4_extent_t *extent, uint64_t start)
    70 {
    71         extent->start_lo = host2uint32_t_le((start << 32) >> 32);
    72         extent->start_hi = host2uint16_t_le((uint16_t)(start >> 32));
    73 }
     94/** Set physical number of the first block covered by extent.
     95 *
     96 * @param extent        extent to load number
     97 * @param fblock        physical number of the first block covered by extent
     98 */
     99void ext4_extent_set_start(ext4_extent_t *extent, uint64_t fblock)
     100{
     101        extent->start_lo = host2uint32_t_le((fblock << 32) >> 32);
     102        extent->start_hi = host2uint16_t_le((uint16_t)(fblock >> 32));
     103}
     104
     105// TODO start comments here
    74106
    75107uint32_t ext4_extent_index_get_first_block(ext4_extent_index_t *index)
Note: See TracChangeset for help on using the changeset viewer.