X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/73662a7c0b0d1e462f2b99322183295be3a24a5a..f9e6853d2c5b7b867211700bc12f0ee57f640b30:/src/simix/smx_io.c diff --git a/src/simix/smx_io.c b/src/simix/smx_io.c index 5bfbe2060e..4b5b1f28ca 100644 --- a/src/simix/smx_io.c +++ b/src/simix/smx_io.c @@ -50,17 +50,16 @@ void SIMIX_storage_destroy(void *s) } //SIMIX FILE READ -void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size) +void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, smx_host_t host) { - smx_action_t action = SIMIX_file_read(simcall->issuer, fd, size); + smx_action_t action = SIMIX_file_read(simcall->issuer, fd, size, host); xbt_fifo_push(action->simcalls, simcall); simcall->issuer->waiting_action = action; } -smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size) +smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host) { smx_action_t action; - smx_host_t host = process->smx_host; /* check if the host is active */ if (surf_resource_get_state(surf_workstation_resource_priv(host)) != SURF_RESOURCE_ON) { @@ -85,17 +84,16 @@ smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t siz } //SIMIX FILE WRITE -void SIMIX_pre_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size) +void SIMIX_pre_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, smx_host_t host) { - smx_action_t action = SIMIX_file_write(simcall->issuer, fd, size); + smx_action_t action = SIMIX_file_write(simcall->issuer, fd, size, host); xbt_fifo_push(action->simcalls, simcall); simcall->issuer->waiting_action = action; } -smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size) +smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host) { smx_action_t action; - smx_host_t host = process->smx_host; /* check if the host is active */ if (surf_resource_get_state(surf_workstation_resource_priv(host)) != SURF_RESOURCE_ON) { @@ -290,14 +288,26 @@ int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_size_t offset, int return surf_workstation_file_seek(host, fd->surf_file, offset, origin); } -void SIMIX_pre_storage_file_rename(smx_simcall_t simcall, smx_storage_t storage, const char* src, const char* dest) +int SIMIX_pre_file_move(smx_simcall_t simcall, smx_file_t file, const char* fullpath) +{ + return SIMIX_file_move(simcall->issuer, file, fullpath); +} + +int SIMIX_file_move(smx_process_t process, smx_file_t file, const char* fullpath) { - return SIMIX_storage_file_rename(simcall->issuer, storage, src, dest); + smx_host_t host = process->smx_host; + return surf_workstation_file_move(host, file->surf_file, fullpath); } -void SIMIX_storage_file_rename(smx_process_t process, smx_storage_t storage, const char* src, const char* dest) +int SIMIX_pre_file_rcopy(smx_simcall_t simcall, smx_file_t fd, smx_host_t host, const char* fullpath) { - return surf_storage_rename(storage, src, dest); + return SIMIX_file_rcopy(simcall->issuer, fd, host, fullpath); +} + +int SIMIX_file_rcopy(smx_process_t process, smx_file_t file, smx_host_t host_dest, const char* fullpath) +{ + smx_host_t host = process->smx_host; + return surf_workstation_file_rcopy(host, file->surf_file, host_dest, fullpath); } sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall, const char* name)