Changes in uspace/srv/fs/fat/fat_ops.c [ffa2c8ef:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
rffa2c8ef r96b02eb9 42 42 #include <libfs.h> 43 43 #include <libblock.h> 44 #include <ipc/ipc.h> 44 45 #include <ipc/services.h> 45 46 #include <ipc/devmap.h> … … 954 955 955 956 if (rc != EOK) { 956 async_answer_0(rid, rc);957 ipc_answer_0(rid, rc); 957 958 return; 958 959 } … … 969 970 rc = block_init(devmap_handle, BS_SIZE); 970 971 if (rc != EOK) { 971 async_answer_0(rid, rc);972 ipc_answer_0(rid, rc); 972 973 return; 973 974 } … … 977 978 if (rc != EOK) { 978 979 block_fini(devmap_handle); 979 async_answer_0(rid, rc);980 ipc_answer_0(rid, rc); 980 981 return; 981 982 } … … 986 987 if (BPS(bs) != BS_SIZE) { 987 988 block_fini(devmap_handle); 988 async_answer_0(rid, ENOTSUP);989 ipc_answer_0(rid, ENOTSUP); 989 990 return; 990 991 } … … 994 995 if (rc != EOK) { 995 996 block_fini(devmap_handle); 996 async_answer_0(rid, rc);997 ipc_answer_0(rid, rc); 997 998 return; 998 999 } … … 1003 1004 (void) block_cache_fini(devmap_handle); 1004 1005 block_fini(devmap_handle); 1005 async_answer_0(rid, rc);1006 ipc_answer_0(rid, rc); 1006 1007 return; 1007 1008 } … … 1011 1012 (void) block_cache_fini(devmap_handle); 1012 1013 block_fini(devmap_handle); 1013 async_answer_0(rid, rc);1014 ipc_answer_0(rid, rc); 1014 1015 return; 1015 1016 } … … 1021 1022 block_fini(devmap_handle); 1022 1023 fat_idx_fini_by_devmap_handle(devmap_handle); 1023 async_answer_0(rid, ENOMEM);1024 ipc_answer_0(rid, ENOMEM); 1024 1025 return; 1025 1026 } … … 1031 1032 block_fini(devmap_handle); 1032 1033 fat_idx_fini_by_devmap_handle(devmap_handle); 1033 async_answer_0(rid, ENOMEM);1034 ipc_answer_0(rid, ENOMEM); 1034 1035 return; 1035 1036 } … … 1043 1044 block_fini(devmap_handle); 1044 1045 fat_idx_fini_by_devmap_handle(devmap_handle); 1045 async_answer_0(rid, ENOMEM);1046 ipc_answer_0(rid, ENOMEM); 1046 1047 return; 1047 1048 } … … 1061 1062 fibril_mutex_unlock(&ridxp->lock); 1062 1063 1063 async_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt);1064 ipc_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt); 1064 1065 } 1065 1066 … … 1078 1079 rc = fat_root_get(&fn, devmap_handle); 1079 1080 if (rc != EOK) { 1080 async_answer_0(rid, rc);1081 ipc_answer_0(rid, rc); 1081 1082 return; 1082 1083 } … … 1089 1090 if (nodep->refcnt != 2) { 1090 1091 (void) fat_node_put(fn); 1091 async_answer_0(rid, EBUSY);1092 ipc_answer_0(rid, EBUSY); 1092 1093 return; 1093 1094 } … … 1109 1110 block_fini(devmap_handle); 1110 1111 1111 async_answer_0(rid, EOK);1112 ipc_answer_0(rid, EOK); 1112 1113 } 1113 1114 … … 1137 1138 rc = fat_node_get(&fn, devmap_handle, index); 1138 1139 if (rc != EOK) { 1139 async_answer_0(rid, rc);1140 ipc_answer_0(rid, rc); 1140 1141 return; 1141 1142 } 1142 1143 if (!fn) { 1143 async_answer_0(rid, ENOENT);1144 ipc_answer_0(rid, ENOENT); 1144 1145 return; 1145 1146 } … … 1150 1151 if (!async_data_read_receive(&callid, &len)) { 1151 1152 fat_node_put(fn); 1152 async_answer_0(callid, EINVAL);1153 async_answer_0(rid, EINVAL);1153 ipc_answer_0(callid, EINVAL); 1154 ipc_answer_0(rid, EINVAL); 1154 1155 return; 1155 1156 } … … 1174 1175 if (rc != EOK) { 1175 1176 fat_node_put(fn); 1176 async_answer_0(callid, rc);1177 async_answer_0(rid, rc);1177 ipc_answer_0(callid, rc); 1178 ipc_answer_0(rid, rc); 1178 1179 return; 1179 1180 } … … 1183 1184 if (rc != EOK) { 1184 1185 fat_node_put(fn); 1185 async_answer_0(rid, rc);1186 ipc_answer_0(rid, rc); 1186 1187 return; 1187 1188 } … … 1240 1241 miss: 1241 1242 rc = fat_node_put(fn); 1242 async_answer_0(callid, rc != EOK ? rc : ENOENT);1243 async_answer_1(rid, rc != EOK ? rc : ENOENT, 0);1243 ipc_answer_0(callid, rc != EOK ? rc : ENOENT); 1244 ipc_answer_1(rid, rc != EOK ? rc : ENOENT, 0); 1244 1245 return; 1245 1246 1246 1247 err: 1247 1248 (void) fat_node_put(fn); 1248 async_answer_0(callid, rc);1249 async_answer_0(rid, rc);1249 ipc_answer_0(callid, rc); 1250 ipc_answer_0(rid, rc); 1250 1251 return; 1251 1252 … … 1256 1257 1257 1258 rc = fat_node_put(fn); 1258 async_answer_1(rid, rc, (sysarg_t)bytes);1259 ipc_answer_1(rid, rc, (sysarg_t)bytes); 1259 1260 } 1260 1261 … … 1276 1277 rc = fat_node_get(&fn, devmap_handle, index); 1277 1278 if (rc != EOK) { 1278 async_answer_0(rid, rc);1279 ipc_answer_0(rid, rc); 1279 1280 return; 1280 1281 } 1281 1282 if (!fn) { 1282 async_answer_0(rid, ENOENT);1283 ipc_answer_0(rid, ENOENT); 1283 1284 return; 1284 1285 } … … 1289 1290 if (!async_data_write_receive(&callid, &len)) { 1290 1291 (void) fat_node_put(fn); 1291 async_answer_0(callid, EINVAL);1292 async_answer_0(rid, EINVAL);1292 ipc_answer_0(callid, EINVAL); 1293 ipc_answer_0(rid, EINVAL); 1293 1294 return; 1294 1295 } … … 1318 1319 if (rc != EOK) { 1319 1320 (void) fat_node_put(fn); 1320 async_answer_0(callid, rc);1321 async_answer_0(rid, rc);1321 ipc_answer_0(callid, rc); 1322 ipc_answer_0(rid, rc); 1322 1323 return; 1323 1324 } … … 1325 1326 if (rc != EOK) { 1326 1327 (void) fat_node_put(fn); 1327 async_answer_0(callid, rc);1328 async_answer_0(rid, rc);1328 ipc_answer_0(callid, rc); 1329 ipc_answer_0(rid, rc); 1329 1330 return; 1330 1331 } … … 1335 1336 if (rc != EOK) { 1336 1337 (void) fat_node_put(fn); 1337 async_answer_0(rid, rc);1338 ipc_answer_0(rid, rc); 1338 1339 return; 1339 1340 } … … 1344 1345 size = nodep->size; 1345 1346 rc = fat_node_put(fn); 1346 async_answer_2(rid, rc, bytes, nodep->size);1347 ipc_answer_2(rid, rc, bytes, nodep->size); 1347 1348 return; 1348 1349 } else { … … 1360 1361 /* could not allocate a chain of nclsts clusters */ 1361 1362 (void) fat_node_put(fn); 1362 async_answer_0(callid, rc);1363 async_answer_0(rid, rc);1363 ipc_answer_0(callid, rc); 1364 ipc_answer_0(rid, rc); 1364 1365 return; 1365 1366 } … … 1369 1370 (void) fat_free_clusters(bs, devmap_handle, mcl); 1370 1371 (void) fat_node_put(fn); 1371 async_answer_0(callid, rc);1372 async_answer_0(rid, rc);1372 ipc_answer_0(callid, rc); 1373 ipc_answer_0(rid, rc); 1373 1374 return; 1374 1375 } … … 1378 1379 (void) fat_free_clusters(bs, devmap_handle, mcl); 1379 1380 (void) fat_node_put(fn); 1380 async_answer_0(callid, rc);1381 async_answer_0(rid, rc);1381 ipc_answer_0(callid, rc); 1382 ipc_answer_0(rid, rc); 1382 1383 return; 1383 1384 } … … 1389 1390 (void) fat_free_clusters(bs, devmap_handle, mcl); 1390 1391 (void) fat_node_put(fn); 1391 async_answer_0(rid, rc);1392 ipc_answer_0(rid, rc); 1392 1393 return; 1393 1394 } … … 1400 1401 (void) fat_free_clusters(bs, devmap_handle, mcl); 1401 1402 (void) fat_node_put(fn); 1402 async_answer_0(rid, rc);1403 ipc_answer_0(rid, rc); 1403 1404 return; 1404 1405 } … … 1406 1407 nodep->dirty = true; /* need to sync node */ 1407 1408 rc = fat_node_put(fn); 1408 async_answer_2(rid, rc, bytes, size);1409 ipc_answer_2(rid, rc, bytes, size); 1409 1410 return; 1410 1411 } … … 1424 1425 rc = fat_node_get(&fn, devmap_handle, index); 1425 1426 if (rc != EOK) { 1426 async_answer_0(rid, rc);1427 ipc_answer_0(rid, rc); 1427 1428 return; 1428 1429 } 1429 1430 if (!fn) { 1430 async_answer_0(rid, ENOENT);1431 ipc_answer_0(rid, ENOENT); 1431 1432 return; 1432 1433 } … … 1474 1475 out: 1475 1476 fat_node_put(fn); 1476 async_answer_0(rid, rc);1477 ipc_answer_0(rid, rc); 1477 1478 return; 1478 1479 } … … 1480 1481 void fat_close(ipc_callid_t rid, ipc_call_t *request) 1481 1482 { 1482 async_answer_0(rid, EOK);1483 ipc_answer_0(rid, EOK); 1483 1484 } 1484 1485 … … 1492 1493 rc = fat_node_get(&fn, devmap_handle, index); 1493 1494 if (rc != EOK) { 1494 async_answer_0(rid, rc);1495 ipc_answer_0(rid, rc); 1495 1496 return; 1496 1497 } 1497 1498 if (!fn) { 1498 async_answer_0(rid, ENOENT);1499 ipc_answer_0(rid, ENOENT); 1499 1500 return; 1500 1501 } 1501 1502 1502 1503 rc = fat_destroy_node(fn); 1503 async_answer_0(rid, rc);1504 ipc_answer_0(rid, rc); 1504 1505 } 1505 1506 … … 1522 1523 int rc = fat_node_get(&fn, devmap_handle, index); 1523 1524 if (rc != EOK) { 1524 async_answer_0(rid, rc);1525 ipc_answer_0(rid, rc); 1525 1526 return; 1526 1527 } 1527 1528 if (!fn) { 1528 async_answer_0(rid, ENOENT);1529 ipc_answer_0(rid, ENOENT); 1529 1530 return; 1530 1531 } … … 1536 1537 1537 1538 fat_node_put(fn); 1538 async_answer_0(rid, rc);1539 ipc_answer_0(rid, rc); 1539 1540 } 1540 1541
Note:
See TracChangeset
for help on using the changeset viewer.