A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
use pointers on sg_storage_size_t in the dict instead of crappy void*
[simgrid.git]
/
src
/
surf
/
workstation.c
diff --git
a/src/surf/workstation.c
b/src/surf/workstation.c
index
e328332
..
c2b8396
100644
(file)
--- a/
src/surf/workstation.c
+++ b/
src/surf/workstation.c
@@
-369,7
+369,7
@@
static xbt_dict_t ws_get_storage_list(void *workstation)
{
s_mount_t mnt;
unsigned int i;
- xbt_dict_t storage_list = xbt_dict_new
(
);
+ xbt_dict_t storage_list = xbt_dict_new
_homogeneous(NULL
);
char *storage_name = NULL;
workstation_CLM03_t ws = (workstation_CLM03_t) surf_workstation_resource_priv(workstation);
@@
-400,22
+400,20
@@
static surf_action_t ws_action_close(void *workstation, surf_file_t fd)
return model->extension.storage.close(st, fd);
}
-static surf_action_t ws_action_read(void *workstation, size_t size,
- surf_file_t fd)
+static surf_action_t ws_action_read(void *workstation, surf_file_t fd, sg_storage_size_t size)
{
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
);
+ return model->extension.storage.read(st,
fd, size
);
}
-static surf_action_t ws_action_write(void *workstation, size_t size,
- surf_file_t fd)
+static surf_action_t ws_action_write(void *workstation, surf_file_t fd, sg_storage_size_t size)
{
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
);
+ return model->extension.storage.write(st,
fd, size
);
}
static int ws_file_unlink(void *workstation, surf_file_t fd)
@@
-456,7
+454,7
@@
static surf_action_t ws_action_ls(void *workstation, const char* mount,
return model->extension.storage.ls(st, path);
}
-static size_t ws_file_get_size(void *workstation, surf_file_t fd)
+static s
g_storage_s
ize_t ws_file_get_size(void *workstation, surf_file_t fd)
{
return fd->size;
}
@@
-464,8
+462,10
@@
static size_t ws_file_get_size(void *workstation, surf_file_t fd)
static xbt_dynar_t ws_file_get_info(void *workstation, surf_file_t fd)
{
storage_t st = find_storage_on_mount_list(workstation, fd->mount);
+ sg_storage_size_t *psize = xbt_new(sg_storage_size_t, 1);
+ *psize = fd->size;
xbt_dynar_t info = xbt_dynar_new(sizeof(void*), NULL);
- xbt_dynar_push_as(info,
void *, (void*)fd->
size);
+ xbt_dynar_push_as(info,
sg_storage_size_t *, p
size);
xbt_dynar_push_as(info, void *, fd->mount);
xbt_dynar_push_as(info, void *, st->generic_resource.name);
xbt_dynar_push_as(info, void *, st->type_id);
@@
-474,13
+474,13
@@
static xbt_dynar_t ws_file_get_info(void *workstation, surf_file_t fd)
return info;
}
-static size_t ws_storage_get_free_size(void *workstation,const char* name)
+static s
g_storage_s
ize_t ws_storage_get_free_size(void *workstation,const char* name)
{
storage_t st = find_storage_on_mount_list(workstation, name);
return st->size - st->used_size;
}
-static size_t ws_storage_get_used_size(void *workstation,const char* name)
+static s
g_storage_s
ize_t ws_storage_get_used_size(void *workstation,const char* name)
{
storage_t st = find_storage_on_mount_list(workstation, name);
return st->used_size;