Changeset 40949d5 in mainline


Ignore:
Timestamp:
2011-05-02T18:55:36Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c2fcfc0
Parents:
fdc05ca
Message:

Fix bugs in bitmap code

File:
1 edited

Legend:

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

    rfdc05ca r40949d5  
    128128                on_error(r, goto out);
    129129
     130                unsigned tmp = *search % bits_per_block;
     131
    130132                freebit = find_free_bit_and_set(b->data, sbi->block_size,
    131                                                 sbi->native, *search);
     133                                                sbi->native, tmp);
    132134                if (freebit == -1) {
    133135                        /*No free bit in this block*/
     
    138140                /*Free bit found in this block, compute the real index*/
    139141                *idx = freebit + bits_per_block * i;
    140                 *idx += (bid == BMAP_INODE);
     142                *idx += (bid == BMAP_INODE) ? 1 : 0;
    141143                mfsdebug("alloc index %d %d\n", (int) *idx, i);
    142144                if (*idx > limit) {
     
    175177        const size_t chunk_bits = sizeof(bitchunk_t) * 8;
    176178
    177         for (i = start_bit / sizeof(uint32_t);
    178              i < bsize / sizeof(uint32_t); ++i) {
     179        for (i = start_bit / chunk_bits;
     180             i < bsize / sizeof(bitchunk_t); ++i) {
    179181                if (!(~b[i])) {
    180182                        /*No free bit in this chunk*/
Note: See TracChangeset for help on using the changeset viewer.