Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset b489f66 in mainline


Ignore:
Timestamp:
2011-07-25T20:19:33Z (10 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master
Children:
76b7622
Parents:
7accfac
Message:

Fix inode allocation, update the search field when freeing a zone or an inode.

File:
1 edited

Legend:

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

    r7accfac rb489f66  
    6969mfs_free_inode(struct mfs_instance *inst, uint32_t inum)
    7070{
    71         return mfs_free_bit(inst, inum, BMAP_INODE);
     71        return mfs_free_bit(inst, inum - 1, BMAP_INODE);
    7272}
    7373
     
    119119        int r;
    120120        unsigned start_block;
     121        unsigned *search;
    121122        block_t *b;
    122123
     
    126127
    127128        if (bid == BMAP_ZONE) {
     129                search = &sbi->zsearch;
    128130                start_block = 2 + sbi->ibmap_blocks;
    129131                if (idx > sbi->nzones) {
     
    134136        } else {
    135137                /*bid == BMAP_INODE*/
     138                search = &sbi->isearch;
    136139                start_block = 2;
    137140                if (idx > sbi->ninodes) {
     
    160163        r = block_put(b);
    161164        mfsdebug("free index %u\n", idx);
     165
     166        if (*search > idx)
     167                *search = idx;
    162168
    163169out_err:
Note: See TracChangeset for help on using the changeset viewer.