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