X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3d3a632d7de077980120453b3863065bed65201c..16e27d2a68b9d21536c50eddff53fb68caa30d91:/src/kernel/activity/SynchroIo.cpp diff --git a/src/kernel/activity/SynchroIo.cpp b/src/kernel/activity/SynchroIo.cpp index 30e5cdd119..9001cf9c57 100644 --- a/src/kernel/activity/SynchroIo.cpp +++ b/src/kernel/activity/SynchroIo.cpp @@ -1,11 +1,10 @@ -/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/activity/SynchroIo.hpp" -#include "src/simix/smx_private.h" -#include "src/surf/FileImpl.hpp" +#include "src/simix/smx_private.hpp" #include "src/surf/surf_interface.hpp" void simgrid::kernel::activity::IoImpl::suspend() @@ -22,40 +21,26 @@ void simgrid::kernel::activity::IoImpl::resume() void simgrid::kernel::activity::IoImpl::post() { - for (smx_simcall_t simcall : simcalls) { + for (smx_simcall_t const& simcall : simcalls) { switch (simcall->call) { - case SIMCALL_FILE_OPEN: { - surf_file_t tmp = surf_storage_action_get_file(surf_io); - simcall_file_open__set__result(simcall, tmp); - break; - } - case SIMCALL_FILE_CLOSE: - delete simcall_file_close__get__fd(simcall); - simcall_file_close__set__result(simcall, 0); - break; - case SIMCALL_FILE_WRITE: - simcall_file_write__set__result(simcall, surf_io->getCost()); - break; - - case SIMCALL_FILE_READ: - simcall_file_read__set__result(simcall, surf_io->getCost()); - break; - - default: - break; + case SIMCALL_STORAGE_WRITE: + simcall_storage_write__set__result(simcall, surf_io->getCost()); + break; + case SIMCALL_STORAGE_READ: + simcall_storage_read__set__result(simcall, surf_io->getCost()); + break; + default: + break; } } switch (surf_io->getState()) { - case simgrid::surf::Action::State::failed: state = SIMIX_FAILED; break; - case simgrid::surf::Action::State::done: state = SIMIX_DONE; break; - default: THROW_IMPOSSIBLE; break;