Changeset 1412b7ee in mainline for uspace/lib/ext4/libext4_extent.c


Ignore:
Timestamp:
2014-02-01T21:46:42Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3eb0c85
Parents:
680708d (diff), 0dd022ec (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:

mainline changes

File:
1 edited

Legend:

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

    r680708d r1412b7ee  
    371371    uint32_t *fblock)
    372372{
     373        int rc;
    373374        /* Compute bound defined by i-node size */
    374375        uint64_t inode_size =
     
    400401                uint64_t child = ext4_extent_index_get_leaf(index);
    401402               
    402                 if (block != NULL)
    403                         block_put(block);
    404                
    405                 int rc = block_get(&block, inode_ref->fs->device, child,
     403                if (block != NULL) {
     404                        rc = block_put(block);
     405                        if (rc != EOK)
     406                                return rc;
     407                }
     408               
     409                rc = block_get(&block, inode_ref->fs->device, child,
    406410                    BLOCK_FLAGS_NONE);
    407411                if (rc != EOK)
     
    429433        /* Cleanup */
    430434        if (block != NULL)
    431                 block_put(block);
    432        
    433         return EOK;
     435                rc = block_put(block);
     436       
     437        return rc;
    434438}
    435439
     
    505509       
    506510cleanup:
     511        ;
     512
     513        int rc2 = EOK;
     514
    507515        /*
    508516         * Put loaded blocks
     
    510518         */
    511519        for (uint16_t i = 1; i < tmp_path->depth; ++i) {
    512                 if (tmp_path[i].block)
    513                         block_put(tmp_path[i].block);
     520                if (tmp_path[i].block) {
     521                        rc2 = block_put(tmp_path[i].block);
     522                        if (rc == EOK && rc2 != EOK)
     523                                rc = rc2;
     524                }
    514525        }
    515526       
     
    594605                return rc;
    595606       
    596         ext4_balloc_free_block(inode_ref, fblock);
    597        
    598         return EOK;
     607        return ext4_balloc_free_block(inode_ref, fblock);
    599608}
    600609
     
    721730       
    722731cleanup:
     732        ;
     733
     734        int rc2 = EOK;
     735
    723736        /*
    724737         * Put loaded blocks
     
    726739         */
    727740        for (uint16_t i = 1; i <= path->depth; ++i) {
    728                 if (path[i].block)
    729                         block_put(path[i].block);
     741                if (path[i].block) {
     742                        rc2 = block_put(path[i].block);
     743                        if (rc == EOK && rc2 != EOK)
     744                                rc = rc2;
     745                }
    730746        }
    731747       
     
    778794                       
    779795                        /* Put back not modified old block */
    780                         block_put(path_ptr->block);
     796                        rc = block_put(path_ptr->block);
     797                        if (rc != EOK) {
     798                                ext4_balloc_free_block(inode_ref, fblock);
     799                                return rc;
     800                        }
    781801                       
    782802                        /* Initialize newly allocated block and remember it */
     
    10611081       
    10621082finish:
     1083        ;
     1084
     1085        int rc2 = EOK;
     1086
    10631087        /* Set return values */
    10641088        *iblock = new_block_idx;
     
    10701094         */
    10711095        for (uint16_t i = 1; i <= path->depth; ++i) {
    1072                 if (path[i].block)
    1073                         block_put(path[i].block);
     1096                if (path[i].block) {
     1097                        rc2 = block_put(path[i].block);
     1098                        if (rc == EOK && rc2 != EOK)
     1099                                rc = rc2;
     1100                }
    10741101        }
    10751102       
Note: See TracChangeset for help on using the changeset viewer.