From: suter Date: Tue, 18 Jun 2013 13:15:57 +0000 (+0200) Subject: don't call things storage when it's mount X-Git-Tag: v3_9_90~247 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/16d1cb7e0e92b43f7e8485f25167c254f6c7f1e5 don't call things storage when it's mount --- diff --git a/src/surf/storage.c b/src/surf/storage.c index 7d3fed64fd..d399fdb0b6 100644 --- a/src/surf/storage.c +++ b/src/surf/storage.c @@ -95,7 +95,7 @@ static surf_action_t storage_action_open(void *storage, const char* mount, surf_file_t file = xbt_new0(s_surf_file_t,1); file->name = xbt_strdup(path); file->size = size; - file->storage = xbt_strdup(mount); + file->mount = xbt_strdup(mount); surf_action_t action = storage_action_execute(storage,0, OPEN); action->file = (void *)file; @@ -117,7 +117,7 @@ static surf_action_t storage_action_close(void *storage, surf_file_t fd) } free(fd->name); - free(fd->storage); + free(fd->mount); xbt_free(fd); surf_action_t action = storage_action_execute(storage,0, CLOSE); return action; diff --git a/src/surf/storage_private.h b/src/surf/storage_private.h index 1d896f5bac..41b94c4079 100644 --- a/src/surf/storage_private.h +++ b/src/surf/storage_private.h @@ -22,7 +22,7 @@ typedef struct s_mount { typedef struct surf_file { char *name; - char *storage; + char *mount; size_t size; } s_surf_file_t; diff --git a/src/surf/workstation.c b/src/surf/workstation.c index ff6564d3a3..1d0fcca4ce 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -345,7 +345,7 @@ static surf_action_t ws_action_open(void *workstation, const char* mount, static surf_action_t ws_action_close(void *workstation, surf_file_t fd) { - storage_t st = find_storage_on_mount_list(workstation, fd->storage); + storage_t st = find_storage_on_mount_list(workstation, fd->mount); XBT_DEBUG("CLOSE on disk '%s'",st->generic_resource.name); surf_model_t model = st->generic_resource.model; return model->extension.storage.close(st, fd); @@ -354,7 +354,7 @@ static surf_action_t ws_action_close(void *workstation, surf_file_t fd) static surf_action_t ws_action_read(void *workstation, size_t size, surf_file_t fd) { - storage_t st = find_storage_on_mount_list(workstation, fd->storage); + storage_t st = find_storage_on_mount_list(workstation, fd->mount); XBT_DEBUG("READ on disk '%s'",st->generic_resource.name); surf_model_t model = st->generic_resource.model; return model->extension.storage.read(st, size, fd); @@ -363,7 +363,7 @@ static surf_action_t ws_action_read(void *workstation, size_t size, static surf_action_t ws_action_write(void *workstation, size_t size, surf_file_t fd) { - storage_t st = find_storage_on_mount_list(workstation, fd->storage); + storage_t st = find_storage_on_mount_list(workstation, fd->mount); XBT_DEBUG("WRITE on disk '%s'",st->generic_resource.name); surf_model_t model = st->generic_resource.model; return model->extension.storage.write(st, size, fd); @@ -376,7 +376,7 @@ static int ws_file_unlink(void *workstation, surf_file_t fd) return 0; } else { // XBT_INFO("%s %zu", fd->storage, fd->size); - storage_t st = find_storage_on_mount_list(workstation, fd->storage); + storage_t st = find_storage_on_mount_list(workstation, fd->mount); xbt_dict_t content_dict = (st)->content; /* Check if the file is on this storage */ if (!xbt_dict_get_or_null(content_dict, fd->name)){ @@ -391,7 +391,7 @@ static int ws_file_unlink(void *workstation, surf_file_t fd) xbt_dict_remove(content_dict,fd->name); free(fd->name); - free(fd->storage); + free(fd->mount); xbt_free(fd); return 1; }