Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    r2f591127 rcc8044e  
    259259        rc = ext4fs_node_get_core(rfn, eparent->instance, inode);
    260260        if (rc != EOK)
    261                 goto exit;
    262 
    263 exit:
    264         ;
    265 
     261                return rc;
     262       
    266263        /* Destroy search result structure */
    267         int const rc2 = ext4_directory_destroy_result(&result);
    268         return rc == EOK ? rc2 : rc;
     264        return ext4_directory_destroy_result(&result);
    269265}
    270266
     
    10061002        *lnkcnt = 1;
    10071003       
    1008         return ext4fs_node_put(root_node);
     1004        ext4fs_node_put(root_node);
     1005       
     1006        return EOK;
    10091007}
    10101008
     
    10951093        }
    10961094       
    1097         int const rc2 = ext4_filesystem_put_inode_ref(inode_ref);
    1098        
    1099         return rc == EOK ? rc2 : rc;
     1095        ext4_filesystem_put_inode_ref(inode_ref);
     1096       
     1097        return rc;
    11001098}
    11011099
     
    12701268                memset(buffer, 0, bytes);
    12711269               
    1272                 rc = async_data_read_finalize(callid, buffer, bytes);
     1270                async_data_read_finalize(callid, buffer, bytes);
    12731271                *rbytes = bytes;
    12741272               
    12751273                free(buffer);
    1276                 return rc;
     1274                return EOK;
    12771275        }
    12781276       
     
    12861284       
    12871285        assert(offset_in_block + bytes <= block_size);
    1288         rc = async_data_read_finalize(callid, block->data + offset_in_block, bytes);
    1289         if (rc != EOK) {
    1290                 block_put(block);
    1291                 return rc;
    1292         }
     1286        async_data_read_finalize(callid, block->data + offset_in_block, bytes);
    12931287       
    12941288        rc = block_put(block);
     
    13221316        size_t len;
    13231317        if (!async_data_write_receive(&callid, &len)) {
    1324                 rc = EINVAL;
    1325                 async_answer_0(callid, rc);
    1326                 goto exit;
     1318                ext4fs_node_put(fn);
     1319                async_answer_0(callid, EINVAL);
     1320                return EINVAL;
    13271321        }
    13281322       
     
    13471341            &fblock);
    13481342        if (rc != EOK) {
     1343                ext4fs_node_put(fn);
    13491344                async_answer_0(callid, rc);
    1350                 goto exit;
     1345                return rc;
    13511346        }
    13521347       
     
    13641359                                    &fblock, true);
    13651360                                if (rc != EOK) {
     1361                                        ext4fs_node_put(fn);
    13661362                                        async_answer_0(callid, rc);
    1367                                         goto exit;
     1363                                        return rc;
    13681364                                }
    13691365                        }
     
    13721368                            &fblock, false);
    13731369                        if (rc != EOK) {
     1370                                ext4fs_node_put(fn);
    13741371                                async_answer_0(callid, rc);
    1375                                 goto exit;
     1372                                return rc;
    13761373                        }
    13771374                } else {
    13781375                        rc = ext4_balloc_alloc_block(inode_ref, &fblock);
    13791376                        if (rc != EOK) {
     1377                                ext4fs_node_put(fn);
    13801378                                async_answer_0(callid, rc);
    1381                                 goto exit;
     1379                                return rc;
    13821380                        }
    13831381                       
     
    13861384                        if (rc != EOK) {
    13871385                                ext4_balloc_free_block(inode_ref, fblock);
     1386                                ext4fs_node_put(fn);
    13881387                                async_answer_0(callid, rc);
    1389                                 goto exit;
     1388                                return rc;
    13901389                        }
    13911390                }
     
    13991398        rc = block_get(&write_block, service_id, fblock, flags);
    14001399        if (rc != EOK) {
     1400                ext4fs_node_put(fn);
    14011401                async_answer_0(callid, rc);
    1402                 goto exit;
    1403         }
    1404        
    1405         if (flags == BLOCK_FLAGS_NOREAD) {
     1402                return rc;
     1403        }
     1404       
     1405        if (flags == BLOCK_FLAGS_NOREAD)
    14061406                memset(write_block->data, 0, block_size);
    1407                 write_block->dirty = true;
    1408         }
    1409 
     1407       
    14101408        rc = async_data_write_finalize(callid, write_block->data +
    14111409            (pos % block_size), bytes);
    14121410        if (rc != EOK) {
    1413                 block_put(write_block);
    1414                 goto exit;
    1415         }
    1416 
     1411                ext4fs_node_put(fn);
     1412                return rc;
     1413        }
     1414       
     1415        write_block->dirty = true;
     1416       
    14171417        rc = block_put(write_block);
    1418         if (rc != EOK)
    1419                 goto exit;
    1420 
     1418        if (rc != EOK) {
     1419                ext4fs_node_put(fn);
     1420                return rc;
     1421        }
     1422       
    14211423        /* Do some counting */
    14221424        uint32_t old_inode_size = ext4_inode_get_size(fs->superblock,
     
    14261428                inode_ref->dirty = true;
    14271429        }
    1428 
     1430       
    14291431        *nsize = ext4_inode_get_size(fs->superblock, inode_ref->inode);
    14301432        *wbytes = bytes;
    1431 
    1432 exit:
    1433         ;
    1434 
    1435         int const rc2 = ext4fs_node_put(fn);
    1436         return rc == EOK ? rc2 : rc;
     1433       
     1434        return ext4fs_node_put(fn);
    14371435}
    14381436
     
    14601458       
    14611459        rc = ext4_filesystem_truncate_inode(inode_ref, new_size);
    1462         int const rc2 = ext4fs_node_put(fn);
    1463        
    1464         return rc == EOK ? rc2 : rc;
     1460        ext4fs_node_put(fn);
     1461       
     1462        return rc;
    14651463}
    14661464
Note: See TracChangeset for help on using the changeset viewer.