Changeset 25696fea in mainline for uspace/srv/fs/mfs/mfs_balloc.c


Ignore:
Timestamp:
2011-10-15T20:05: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:
22ceff3a
Parents:
1ccc32f (diff), 721d4b6e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/mfs/mfs_balloc.c

    r1ccc32f r25696fea  
    3636static int
    3737find_free_bit_and_set(bitchunk_t *b, const int bsize,
    38                       const bool native, unsigned start_bit);
     38    const bool native, unsigned start_bit);
    3939
    4040static int
     
    129129                if (idx > sbi->nzones) {
    130130                        printf(NAME ": Error! Trying to free beyond the" \
    131                                "bitmap max size\n");
     131                            "bitmap max size\n");
    132132                        return -1;
    133133                }
    134134        } else {
    135                 /*bid == BMAP_INODE*/
     135                /* bid == BMAP_INODE */
    136136                search = &sbi->isearch;
    137137                start_block = 2;
    138138                if (idx > sbi->ninodes) {
    139139                        printf(NAME ": Error! Trying to free beyond the" \
    140                                "bitmap max size\n");
     140                            "bitmap max size\n");
    141141                        return -1;
    142142                }
    143143        }
    144144
    145         /*Compute the bitmap block*/
     145        /* Compute the bitmap block */
    146146        uint32_t block = idx / (sbi->block_size * 8) + start_block;
    147147
     
    150150                goto out_err;
    151151
    152         /*Compute the bit index in the block*/
     152        /* Compute the bit index in the block */
    153153        idx %= (sbi->block_size * 8);
    154154        bitchunk_t *ptr = b->data;
     
    220220
    221221                freebit = find_free_bit_and_set(b->data, sbi->block_size,
    222                                                 sbi->native, tmp);
     222                    sbi->native, tmp);
    223223                if (freebit == -1) {
    224                         /*No free bit in this block*/
     224                        /* No free bit in this block */
    225225                        r = block_put(b);
    226226                        if (r != EOK)
     
    229229                }
    230230
    231                 /*Free bit found in this block, compute the real index*/
     231                /* Free bit found in this block, compute the real index */
    232232                *idx = freebit + bits_per_block * i;
    233233                if (*idx > limit) {
    234                         /*Index is beyond the limit, it is invalid*/
     234                        /* Index is beyond the limit, it is invalid */
    235235                        r = block_put(b);
    236236                        if (r != EOK)
     
    246246
    247247        if (*search > 0) {
    248                 /*Repeat the search from the first bitmap block*/
     248                /* Repeat the search from the first bitmap block */
    249249                *search = 0;
    250250                goto retry;
    251251        }
    252252
    253         /*Free bit not found, return error*/
     253        /* Free bit not found, return error */
    254254        return ENOSPC;
    255255
     
    260260static int
    261261find_free_bit_and_set(bitchunk_t *b, const int bsize,
    262                       const bool native, unsigned start_bit)
     262    const bool native, unsigned start_bit)
    263263{
    264264        int r = -1;
     
    268268
    269269        for (i = start_bit / chunk_bits;
    270              i < bsize / sizeof(bitchunk_t); ++i) {
     270            i < bsize / sizeof(bitchunk_t); ++i) {
     271
    271272                if (!(~b[i])) {
    272                         /*No free bit in this chunk*/
     273                        /* No free bit in this chunk */
    273274                        continue;
    274275                }
Note: See TracChangeset for help on using the changeset viewer.