Changeset 95947d24 in mainline


Ignore:
Timestamp:
2012-04-08T09:21:51Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
847f2cb
Parents:
6f41312
Message:

balloc: error handling TODOs done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_balloc.c

    r6f41312 r95947d24  
    143143        if (rc != EOK) {
    144144                EXT4FS_DBG("error in saving bg_ref \%d", rc);
    145                 // TODO error
    146145                return rc;
    147146        }
     
    221220        if (rc != EOK) {
    222221                EXT4FS_DBG("error in saving bg_ref \%d", rc);
    223                 // TODO error
    224222                return rc;
    225223        }
     
    275273
    276274        if (inode_block_count > 0) {
    277                 // TODO check retval
    278                 ext4_filesystem_get_inode_data_block_index(inode_ref, inode_block_count - 1, &goal);
    279 
    280                 // TODO
    281                 // If goal == 0 -> SPARSE file !!!
    282 
    283                 goal++;
    284                 return goal;
     275
     276                rc = ext4_filesystem_get_inode_data_block_index(inode_ref, inode_block_count - 1, &goal);
     277                if (rc != EOK) {
     278                        return 0;
     279                }
     280
     281                if (goal != 0) {
     282                        goal++;
     283                        return goal;
     284                }
     285
     286                // if goal == 0, sparse file -> continue
    285287        }
    286288
     
    338340        uint32_t goal = ext4_balloc_find_goal(inode_ref);
    339341        if (goal == 0) {
    340                 // TODO
     342                // no goal found => partition is full
    341343                EXT4FS_DBG("ERRORR (goal == 0)");
    342344                return ENOSPC;
     
    385387                rc = block_put(bitmap_block);
    386388                if (rc != EOK) {
    387                         // TODO error
    388                         EXT4FS_DBG("goal check: error in saving initial bitmap \%d", rc);
     389                        EXT4FS_DBG("goal check: error in saving bitmap \%d", rc);
    389390                        ext4_filesystem_put_block_group_ref(bg_ref);
    390391                        return rc;
     
    411412                        rc = block_put(bitmap_block);
    412413                        if (rc != EOK) {
    413                                 // TODO error
    414414                                EXT4FS_DBG("near blocks: error in saving initial bitmap \%d", rc);
     415                                return rc;
    415416                        }
    416417
     
    429430                rc = block_put(bitmap_block);
    430431                if (rc != EOK) {
    431                         // TODO error
    432432                        EXT4FS_DBG("free byte: error in saving initial bitmap \%d", rc);
     433                        return rc;
    433434                }
    434435
     
    445446                rc = block_put(bitmap_block);
    446447                if (rc != EOK) {
    447                         // TODO error
    448448                        EXT4FS_DBG("free bit: error in saving initial bitmap \%d", rc);
     449                        return rc;
    449450                }
    450451
     
    468469                rc = ext4_filesystem_get_block_group_ref(inode_ref->fs, bgid, &bg_ref);
    469470                if (rc != EOK) {
    470                         EXT4FS_DBG("errrrrrrrrrrr");
     471                        EXT4FS_DBG("ERROR: unable to load block group \%u", bgid);
    471472                        return rc;
    472473                }
     
    479480                if (rc != EOK) {
    480481                        ext4_filesystem_put_block_group_ref(bg_ref);
    481                         EXT4FS_DBG("errrrrrrrrrr");
     482                        EXT4FS_DBG("ERROR: unable to load bitmap block");
    482483                        return rc;
    483484                }
     
    502503                        rc = block_put(bitmap_block);
    503504                        if (rc != EOK) {
    504                                 // TODO error
    505                                 EXT4FS_DBG("error in saving bitmap \%d", rc);
     505                                EXT4FS_DBG("ERROR: unable to save bitmap block");
     506                                return rc;
    506507                        }
    507508
     
    518519                        rc = block_put(bitmap_block);
    519520                        if (rc != EOK) {
    520                                 // TODO error
    521                                 EXT4FS_DBG("error in saving bitmap \%d", rc);
     521                                EXT4FS_DBG("ERROR: unable to save bitmap block");
     522                                return rc;
    522523                        }
    523524
Note: See TracChangeset for help on using the changeset viewer.