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
Change parameters order for msg_file_read, msg_file_write and in all their internal...
[simgrid.git]
/
src
/
surf
/
workstation.c
diff --git
a/src/surf/workstation.c
b/src/surf/workstation.c
index
ea645c5
..
bbd9664
100644
(file)
--- a/
src/surf/workstation.c
+++ b/
src/surf/workstation.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2004
, 2005, 2006, 2007, 2008, 2009, 2010
. The SimGrid Team.
+/* Copyright (c) 2004
-2013
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-365,10
+365,22
@@
static storage_t find_storage_on_mount_list(void *workstation,const char* mount)
return st;
}
return st;
}
-static xbt_d
ynar
_t ws_get_storage_list(void *workstation)
+static xbt_d
ict
_t ws_get_storage_list(void *workstation)
{
{
+ s_mount_t mnt;
+ unsigned int i;
+ 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);
workstation_CLM03_t ws = (workstation_CLM03_t) surf_workstation_resource_priv(workstation);
- return ws->storage;
+ xbt_dynar_t storages = ws->storage;
+
+ xbt_dynar_foreach(storages,i,mnt)
+ {
+ storage_name = ((storage_t)mnt.storage)->generic_resource.name;
+ xbt_dict_set(storage_list,mnt.name,storage_name,NULL);
+ }
+ return storage_list;
}
static surf_action_t ws_action_open(void *workstation, const char* mount,
}
static surf_action_t ws_action_open(void *workstation, const char* mount,
@@
-388,22
+400,20
@@
static surf_action_t ws_action_close(void *workstation, surf_file_t fd)
return model->extension.storage.close(st, 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;
{
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;
{
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)
}
static int ws_file_unlink(void *workstation, surf_file_t fd)
@@
-444,7
+454,7
@@
static surf_action_t ws_action_ls(void *workstation, const char* mount,
return model->extension.storage.ls(st, path);
}
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;
}
{
return fd->size;
}
@@
-462,13
+472,17
@@
static xbt_dynar_t ws_file_get_info(void *workstation, surf_file_t fd)
return info;
}
return info;
}
-static s
ize_t ws_storage_get_free_size(void *workstation, surf_storage_t storag
e)
+static s
g_storage_size_t ws_storage_get_free_size(void *workstation,const char* nam
e)
{
{
-
return storage->size - storage->used_size
;
-
+
storage_t st = find_storage_on_mount_list(workstation, name)
;
+ return st->size - st->used_size;
}
}
-
+static sg_storage_size_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;
+}
static void surf_workstation_model_init_internal(void)
{
static void surf_workstation_model_init_internal(void)
{
@@
-537,13
+551,14
@@
static void surf_workstation_model_init_internal(void)
surf_workstation_model->extension.workstation.get_size = ws_file_get_size;
surf_workstation_model->extension.workstation.get_info = ws_file_get_info;
surf_workstation_model->extension.workstation.get_free_size = ws_storage_get_free_size;
surf_workstation_model->extension.workstation.get_size = ws_file_get_size;
surf_workstation_model->extension.workstation.get_info = ws_file_get_info;
surf_workstation_model->extension.workstation.get_free_size = ws_storage_get_free_size;
+ surf_workstation_model->extension.workstation.get_used_size = ws_storage_get_used_size;
surf_workstation_model->extension.workstation.get_storage_list = ws_get_storage_list;
}
void surf_workstation_model_init_current_default(void)
{
surf_workstation_model_init_internal();
surf_workstation_model->extension.workstation.get_storage_list = ws_get_storage_list;
}
void surf_workstation_model_init_current_default(void)
{
surf_workstation_model_init_internal();
- xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic",
xbt_strdup("yes")
);
+ xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic",
"yes"
);
surf_cpu_model_init_Cas01();
surf_network_model_init_LegrandVelho();
surf_cpu_model_init_Cas01();
surf_network_model_init_LegrandVelho();