Changeset 532f53d in mainline for uspace/srv/fs/ext4fs/ext4fs_ops.c
- Timestamp:
- 2013-11-20T21:47:41Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e5a1ace3
- Parents:
- 2764497
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/ext4fs/ext4fs_ops.c
r2764497 r532f53d 259 259 rc = ext4fs_node_get_core(rfn, eparent->instance, inode); 260 260 if (rc != EOK) 261 return rc; 262 261 goto exit; 262 263 exit: 264 ; 265 263 266 /* Destroy search result structure */ 264 return ext4_directory_destroy_result(&result); 267 int const rc2 = ext4_directory_destroy_result(&result); 268 return rc == EOK ? rc2 : rc; 265 269 } 266 270 … … 1002 1006 *lnkcnt = 1; 1003 1007 1004 ext4fs_node_put(root_node); 1005 1006 return EOK; 1008 return ext4fs_node_put(root_node); 1007 1009 } 1008 1010 … … 1093 1095 } 1094 1096 1095 ext4_filesystem_put_inode_ref(inode_ref);1096 1097 return rc ;1097 int const rc2 = ext4_filesystem_put_inode_ref(inode_ref); 1098 1099 return rc == EOK ? rc2 : rc; 1098 1100 } 1099 1101 … … 1268 1270 memset(buffer, 0, bytes); 1269 1271 1270 async_data_read_finalize(callid, buffer, bytes);1272 rc = async_data_read_finalize(callid, buffer, bytes); 1271 1273 *rbytes = bytes; 1272 1274 1273 1275 free(buffer); 1274 return EOK;1276 return rc; 1275 1277 } 1276 1278 … … 1284 1286 1285 1287 assert(offset_in_block + bytes <= block_size); 1286 async_data_read_finalize(callid, block->data + offset_in_block, bytes); 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 } 1287 1293 1288 1294 rc = block_put(block); … … 1316 1322 size_t len; 1317 1323 if (!async_data_write_receive(&callid, &len)) { 1318 ext4fs_node_put(fn);1319 async_answer_0(callid, EINVAL);1320 return EINVAL;1324 rc = EINVAL; 1325 async_answer_0(callid, rc); 1326 goto exit; 1321 1327 } 1322 1328 … … 1341 1347 &fblock); 1342 1348 if (rc != EOK) { 1343 ext4fs_node_put(fn);1344 1349 async_answer_0(callid, rc); 1345 return rc;1350 goto exit; 1346 1351 } 1347 1352 … … 1359 1364 &fblock, true); 1360 1365 if (rc != EOK) { 1361 ext4fs_node_put(fn);1362 1366 async_answer_0(callid, rc); 1363 return rc;1367 goto exit; 1364 1368 } 1365 1369 } … … 1368 1372 &fblock, false); 1369 1373 if (rc != EOK) { 1370 ext4fs_node_put(fn);1371 1374 async_answer_0(callid, rc); 1372 return rc;1375 goto exit; 1373 1376 } 1374 1377 } else { 1375 1378 rc = ext4_balloc_alloc_block(inode_ref, &fblock); 1376 1379 if (rc != EOK) { 1377 ext4fs_node_put(fn);1378 1380 async_answer_0(callid, rc); 1379 return rc;1381 goto exit; 1380 1382 } 1381 1383 … … 1384 1386 if (rc != EOK) { 1385 1387 ext4_balloc_free_block(inode_ref, fblock); 1386 ext4fs_node_put(fn);1387 1388 async_answer_0(callid, rc); 1388 return rc;1389 goto exit; 1389 1390 } 1390 1391 } … … 1398 1399 rc = block_get(&write_block, service_id, fblock, flags); 1399 1400 if (rc != EOK) { 1400 ext4fs_node_put(fn);1401 1401 async_answer_0(callid, rc); 1402 return rc;1402 goto exit; 1403 1403 } 1404 1404 1405 1405 if (flags == BLOCK_FLAGS_NOREAD) 1406 1406 memset(write_block->data, 0, block_size); 1407 1407 1408 1408 rc = async_data_write_finalize(callid, write_block->data + 1409 1409 (pos % block_size), bytes); 1410 if (rc != EOK) { 1411 ext4fs_node_put(fn); 1412 return rc; 1413 } 1414 1410 if (rc != EOK) 1411 goto exit; 1412 1415 1413 write_block->dirty = true; 1416 1414 1417 1415 rc = block_put(write_block); 1418 if (rc != EOK) { 1419 ext4fs_node_put(fn); 1420 return rc; 1421 } 1422 1416 if (rc != EOK) 1417 goto exit; 1418 1423 1419 /* Do some counting */ 1424 1420 uint32_t old_inode_size = ext4_inode_get_size(fs->superblock, … … 1428 1424 inode_ref->dirty = true; 1429 1425 } 1430 1426 1431 1427 *nsize = ext4_inode_get_size(fs->superblock, inode_ref->inode); 1432 1428 *wbytes = bytes; 1433 1434 return ext4fs_node_put(fn); 1429 1430 exit: 1431 ; 1432 1433 int const rc2 = ext4fs_node_put(fn); 1434 return rc == EOK ? rc2 : rc; 1435 1435 } 1436 1436 … … 1458 1458 1459 1459 rc = ext4_filesystem_truncate_inode(inode_ref, new_size); 1460 ext4fs_node_put(fn);1461 1462 return rc ;1460 int const rc2 = ext4fs_node_put(fn); 1461 1462 return rc == EOK ? rc2 : rc; 1463 1463 } 1464 1464
Note:
See TracChangeset
for help on using the changeset viewer.