Changeset 8a49fed in mainline for uspace/srv/fs/minixfs/mfs_balloc.c


Ignore:
Timestamp:
2011-04-30T11:45:33Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
44c6091f
Parents:
2874547
Message:

Added implementation of mfs_truncate(), it does not prune indirect blocks yet.

File:
1 edited

Legend:

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

    r2874547 r8a49fed  
    7272
    7373        r = block_get(&b, inst->handle, block, BLOCK_FLAGS_NONE);
    74         if (r != EOK)
    75                 goto out_err;
     74        on_error(r, goto out_err);
    7675
    7776        /*Compute the bit index in the block*/
     
    8584        ptr[idx / chunk_bits] = conv32(sbi->native, chunk);
    8685        b->dirty = true;
    87         r = EOK;
    88         block_put(b);
     86        r = block_put(b);
    8987
    9088out_err:
     
    128126                                BLOCK_FLAGS_NONE);
    129127
    130                 if (r != EOK)
    131                         goto out;
     128                on_error(r, goto out);
    132129
    133130                freebit = find_free_bit_and_set(b->data, sbi->block_size,
     
    145142                if (*idx > limit) {
    146143                        /*Index is beyond the limit, it is invalid*/
    147                         block_put(b);
     144                        r = block_put(b);
     145                        on_error(r, goto out);
    148146                        break;
    149147                }
     
    151149                *search = *idx;
    152150                b->dirty = true;
    153                 block_put(b);
    154                 goto found;
     151                r = block_put(b);
     152                goto out;
    155153        }
    156154
     
    163161        /*Free bit not found, return error*/
    164162        return ENOSPC;
    165 
    166 found:
    167         r = EOK;
    168163
    169164out:
Note: See TracChangeset for help on using the changeset viewer.