Changeset 8c76c30 in mainline for uspace/srv/fs/minixfs/mfs_read.c


Ignore:
Timestamp:
2011-03-20T12:50:04Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4611094f
Parents:
6adba0a8
Message:

Fix some comments and remove unused nr_indirect var.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs_read.c

    r6adba0a8 r8c76c30  
    7272{
    7373        block_t *bi1, *bi2;
    74         int r, nr_direct, nr_indirect;
     74        int r, nr_direct;
    7575        int ptrs_per_block;
    7676
     
    8888        if (fs_version == MFS_VERSION_V1) {
    8989                nr_direct = V1_NR_DIRECT_ZONES;
    90                 nr_indirect = V1_NR_INDIRECT_ZONES;
    9190                ptrs_per_block = MFS_BLOCKSIZE / sizeof(uint16_t);
    9291        } else {
    9392                nr_direct = V2_NR_DIRECT_ZONES;
    94                 nr_indirect = V2_NR_INDIRECT_ZONES;
    9593                ptrs_per_block = sbi->block_size / sizeof(uint32_t);
    9694        }
    9795
     96        /*Check if the wanted block is in the direct zones*/
    9897        if (rblock < nr_direct) {
    9998                *b = ino_i->i_dzone[rblock];
     
    103102        rblock -= nr_direct - 1;
    104103
    105         /*Check if the wanted block is in the single indirect zone*/
    106104        if (rblock < ptrs_per_block) {
     105                /*The wanted block is in the single indirect zone chain*/
    107106                if (ino_i->i_izone[0] == 0) {
    108107                        r = -1;
     
    123122        rblock -= ptrs_per_block - 1;
    124123
    125         /*The wanted block is in the double indirect zone*/
    126         uint32_t di_block = rblock / ptrs_per_block;
     124        /*The wanted block is in the double indirect zone chain*/
    127125
    128         /*read the first indirect zone*/
     126        /*read the first indirect zone of the chain*/
    129127        if (ino_i->i_izone[1] == 0) {
    130128                r = -1;
    131129                goto out;
    132130        }
    133 
    134131        r = read_ind_block(bi1, mnode->instance, ino_i->i_izone[1]);
    135132
     
    137134                goto out;
    138135
    139         /*read the second indirect zone*/
     136        /*
     137         *Compute the position of the second indirect
     138         *zone pointer in the chain.
     139         */
     140        uint32_t di_block = rblock / ptrs_per_block;
     141
     142        /*read the second indirect zone of the chain*/
    140143        if (fs_version == MFS_VERSION_V1) {
    141144                r = read_ind_block(bi2, mnode->instance,
     
    155158                *b = ((uint32_t *) bi2->data)[rblock % ptrs_per_block];
    156159        }
     160        r = EOK;
    157161        block_put(bi2);
    158162
Note: See TracChangeset for help on using the changeset viewer.