Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement file stat for storage model.
authornavarro <navarro@caraja.(none)>
Tue, 3 Apr 2012 13:10:24 +0000 (15:10 +0200)
committernavarro <navarro@caraja.(none)>
Tue, 3 Apr 2012 13:16:25 +0000 (15:16 +0200)
17 files changed:
examples/msg/io/file.c
include/msg/datatypes.h
include/msg/msg.h
include/simix/datatypes.h
include/simix/simix.h
include/xbt/file_stat.h [new file with mode: 0644]
src/include/surf/datatypes.h
src/include/surf/surf.h
src/msg/msg_io.c
src/simix/smx_io.c
src/simix/smx_io_private.h
src/simix/smx_private.h
src/simix/smx_smurf_private.h
src/simix/smx_user.c
src/surf/storage.c
src/surf/storage_private.h
src/surf/workstation.c

index d63d941..4b13333 100644 (file)
@@ -32,7 +32,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(io_file,
 
 int host(int argc, char *argv[])
 {
-  msg_file_t file;
+  msg_file_t file = NULL;
+  s_msg_stat_t stat;
+
   char* mount = bprintf("C:");
   size_t read,write;
   if(!strcmp(MSG_process_get_name(MSG_process_self()),"0"))
@@ -56,8 +58,8 @@ int host(int argc, char *argv[])
   read = MSG_file_read(mount,NULL,10000000,sizeof(char*),file);     // Read for 10Mo
   XBT_INFO("\tHaving read  %Zu \ton %s",read,file->name);
 
-//  res = MSG_file_stat(mount,0,NULL);
-//  XBT_INFO("Host '%s' stat %d",MSG_host_get_name(MSG_host_self()), res);
+  MSG_file_stat(mount,file,&stat);
+  XBT_INFO("\tFile %s Size %d",file->name,(int)stat.size);
 
   XBT_INFO("\tClose file '%s'",file->name);
   MSG_file_close(mount,file);
index 8816397..4741045 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef MSG_DATATYPE_H
 #define MSG_DATATYPE_H
 #include "xbt/misc.h"
+#include "xbt/file_stat.h"
 #include "simgrid_config.h"     // for HAVE_TRACING
 
 SG_BEGIN_DECL()
@@ -79,8 +80,11 @@ typedef struct msg_file {
 } s_msg_file_t;
 /** @brief File datatype
     @ingroup m_datatypes_management_details */
+
 typedef struct msg_file *msg_file_t;
 
+typedef s_file_stat_t s_msg_stat_t, *msg_stat_t;
+
 
 /*************** Begin GPU ***************/
 typedef struct simdata_gpu_task *simdata_gpu_task_t;
index 2452e27..c1c2d1d 100644 (file)
@@ -42,7 +42,7 @@ XBT_PUBLIC(size_t) MSG_file_read(const char* storage, void* ptr, size_t size, si
 XBT_PUBLIC(size_t) MSG_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, msg_file_t stream);
 XBT_PUBLIC(msg_file_t) MSG_file_open(const char* storage, const char* path, const char* mode);
 XBT_PUBLIC(int) MSG_file_close(const char* storage, msg_file_t fp);
-XBT_PUBLIC(int) MSG_file_stat(const char* storage, int fd, void* buf);
+XBT_PUBLIC(int) MSG_file_stat(const char* storage, msg_file_t fd, s_msg_stat_t *buf);
 
 
 /************************** Host handling ***********************************/
index 07c05c1..1ed5a6a 100644 (file)
@@ -53,6 +53,7 @@ typedef struct s_smx_sem *smx_sem_t;
 
 /********************************** File *************************************/
 typedef struct s_smx_file *smx_file_t;
+typedef struct s_smx_stat *smx_stat_t;
 
 /********************************** Action *************************************/
 typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized action handlers */
index 3c5919e..2de942e 100644 (file)
@@ -10,6 +10,7 @@
 #include "xbt/misc.h"
 #include "xbt/fifo.h"
 #include "xbt/dict.h"
+#include "xbt/file_stat.h"
 #include "xbt/function_types.h"
 #include "simix/datatypes.h"
 #include "simix/context.h"
@@ -248,7 +249,7 @@ XBT_PUBLIC(size_t) simcall_file_read(const char* storage, void* ptr, size_t size
 XBT_PUBLIC(size_t) simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
 XBT_PUBLIC(smx_file_t) simcall_file_open(const char* storage, const char* path, const char* mode);
 XBT_PUBLIC(int) simcall_file_close(const char* storage, smx_file_t fp);
-XBT_PUBLIC(int) simcall_file_stat(const char* storage, int fd, void* buf);
+XBT_PUBLIC(int) simcall_file_stat(const char* storage, smx_file_t fd, s_file_stat_t *buf);
 
 SG_END_DECL()
 #endif                          /* _SIMIX_SIMIX_H */
diff --git a/include/xbt/file_stat.h b/include/xbt/file_stat.h
new file mode 100644 (file)
index 0000000..b4ee8c7
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * file_stat.h
+ *
+ *  Created on: 3 avr. 2012
+ *      Author: navarro
+ */
+
+#ifndef _FILE_STAT_H
+#define _FILE_STAT_H
+
+#include "xbt/sysdep.h"
+
+typedef struct file_stat {
+  char *user_rights;
+  char *user;
+  char *group;
+  char *date; /* FIXME: update to time_t or double */
+  char *time; /* FIXME: update to time_t or double */
+  size_t size;
+} s_file_stat_t, *file_stat_t;
+
+static XBT_INLINE void file_stat_copy(s_file_stat_t *src, s_file_stat_t *dst)
+{
+    dst->date = xbt_strdup(src->date);
+    dst->group = xbt_strdup(src->group);
+    dst->size = src->size;
+    dst->time = xbt_strdup(src->time);
+    dst->user = xbt_strdup(src->user);
+    dst->user_rights = xbt_strdup(src->user_rights);
+}
+
+#endif /* _FILE_STAT_H */
index c24e58e..e7764f1 100644 (file)
@@ -23,6 +23,7 @@ typedef struct surf_model *surf_model_t;
  */
 typedef struct surf_action *surf_action_t;
 typedef struct surf_file *surf_file_t;
+typedef struct surf_stat *surf_stat_t;
 
 typedef struct lmm_element *lmm_element_t;
 typedef struct lmm_variable *lmm_variable_t;
index d5c7855..309e5ac 100644 (file)
@@ -11,6 +11,7 @@
 #include "xbt/dynar.h"
 #include "xbt/dict.h"
 #include "xbt/misc.h"
+#include "xbt/file_stat.h"
 #include "portable.h"
 #include "xbt/config.h"
 #include "surf/datatypes.h"
@@ -94,6 +95,7 @@ typedef struct surf_action {
   char *category;               /**< tracing category for categorized resource utilization monitoring */
 #endif
   surf_file_t file;        /**< surf_file_t for storage model */
+  s_file_stat_t stat;        /**< surf_file_t for storage model */
 } s_surf_action_t;
 
 typedef struct surf_action_lmm {
@@ -220,7 +222,7 @@ typedef struct surf_storage_model_extension_public {
   surf_action_t(*close) (void *storage, surf_file_t fp);
   surf_action_t(*read) (void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
   surf_action_t(*write) (void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
-  surf_action_t(*stat) (void *storage, int fd, void* buf);
+  surf_action_t(*stat) (void *storage, surf_file_t stream);
   void* (*create_resource) (const char* id, const char* model,const char* type_id);
 } s_surf_model_extension_storage_t;
 
@@ -253,7 +255,7 @@ typedef struct surf_workstation_model_extension_public {
   surf_action_t(*close) (void *workstation, const char* storage, surf_file_t fp);
   surf_action_t(*read) (void *workstation, const char* storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
   surf_action_t(*write) (void *workstation, const char* storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
-  surf_action_t(*stat) (void *workstation, const char* storage, int fd, void* buf);
+  surf_action_t(*stat) (void *workstation, const char* storage, surf_file_t stream);
   int (*link_shared) (const void *link);
    xbt_dict_t(*get_properties) (const void *resource);
   void* (*link_create_resource) (const char *name,
index 0d91bc3..c8b64de 100644 (file)
@@ -5,6 +5,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package.              */
 
 #include "msg_private.h"
+#include "xbt/log.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, simix,
+                                "Logging specific to MSG (io)");
 
 /** @addtogroup m_file_management
  *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="File" --> \endhtmlonly
@@ -87,11 +91,13 @@ int MSG_file_close(const char* storage, msg_file_t fp)
  * \brief Stats the file pointed by fd
  *
  * \param storage is the name where find the stream
- * \param fd is the file descriptor
+ * \param fd is the file descriptor (#msg_file_t)
  * \param buf is the return structure with informations
  * \return 0 on success or 1 on error
  */
-int MSG_file_stat(const char* storage, int fd, void* buf)
+int MSG_file_stat(const char* storage, msg_file_t fd, s_msg_stat_t *buf)
 {
-  return simcall_file_stat(storage, fd, buf);
+  int res;
+  res = simcall_file_stat(storage, fd->simdata->smx_file, buf);
+  return res;
 }
index 040495e..6c7868c 100644 (file)
@@ -184,11 +184,10 @@ void SIMIX_pre_file_stat(smx_simcall_t simcall)
   simcall->issuer->waiting_action = action;
 }
 
-smx_action_t SIMIX_file_stat(smx_process_t process ,const char* storage, int fd, void* buf)
+smx_action_t SIMIX_file_stat(smx_process_t process ,const char* storage, smx_file_t fd, s_file_stat_t buf)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
-
   /* check if the host is active */
   if (surf_workstation_model->extension.
       workstation.get_state(host->host) != SURF_RESOURCE_ON) {
@@ -204,7 +203,7 @@ smx_action_t SIMIX_file_stat(smx_process_t process ,const char* storage, int fd,
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_model->extension.workstation.stat(host->host, storage, fd, buf);
+  action->io.surf_io = surf_workstation_model->extension.workstation.stat(host->host, storage, fd->surf_file);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -233,7 +232,10 @@ void SIMIX_post_io(smx_action_t action)
       simcall->file_read.result = (action->io.surf_io)->cost;
       break;
     case SIMCALL_FILE_STAT:
-      simcall->file_read.result = 0;
+      simcall->file_stat.result = 0;
+      s_file_stat_t *dst = &(simcall->file_stat.buf);
+      s_file_stat_t *src = &((action->io.surf_io)->stat);
+      file_stat_copy(src,dst);
       break;
     default:
       break;
index 03847d9..f38cd9b 100644 (file)
@@ -20,7 +20,7 @@ smx_action_t SIMIX_file_read(smx_process_t process, const char* storage, void* p
 smx_action_t SIMIX_file_write(smx_process_t process, const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
 smx_action_t SIMIX_file_open(smx_process_t process, const char* storage, const char* path, const char* mode);
 smx_action_t SIMIX_file_close(smx_process_t process, const char* storage, smx_file_t fp);
-smx_action_t SIMIX_file_stat(smx_process_t process, const char* storage, int fd, void* buf);
+smx_action_t SIMIX_file_stat(smx_process_t process, const char* storage, smx_file_t fd, s_file_stat_t buf);
 
 void SIMIX_post_io(smx_action_t action);
 void SIMIX_io_destroy(smx_action_t action);
index bc4efc0..28cbd06 100644 (file)
@@ -62,6 +62,9 @@ typedef struct s_smx_file {
   surf_file_t surf_file;
 } s_smx_file_t;
 
+typedef struct s_smx_stat {
+  s_file_stat_t surf_stat;
+} s_smx_stat_t, *smx_stat_t;
 
 /*********************************** Time ************************************/
 
index 07385e9..a0888c1 100644 (file)
@@ -540,9 +540,8 @@ typedef struct s_smx_simcall {
 
     struct {
       const char* storage;
-      int fd;
-      //Next should be struct stat* buf
-      void* buf;
+      smx_file_t fd;
+      s_file_stat_t buf;
       int result;
     } file_stat;
 
index 9d90214..1f5f4b4 100644 (file)
@@ -1232,16 +1232,17 @@ int simcall_file_close(const char* storage, smx_file_t fp)
   return simcall->file_close.result;
 }
 
-int simcall_file_stat(const char* storage, int fd, void* buf)
+int simcall_file_stat(const char* storage, smx_file_t fd, s_file_stat_t *buf)
 {
   smx_simcall_t simcall = SIMIX_simcall_mine();
-
   simcall->call = SIMCALL_FILE_STAT;
   simcall->file_stat.storage = storage;
   simcall->file_stat.fd = fd;
-  simcall->file_stat.buf = buf;
+
   SIMIX_simcall_push(simcall->issuer);
 
+  *buf = simcall->file_stat.buf;
+
   return simcall->file_stat.result;
 }
 
index 640cf93..7ee05ee 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "xbt/ex.h"
 #include "xbt/dict.h"
+#include "xbt/file_stat.h"
 #include "portable.h"
 #include "surf_private.h"
 #include "storage_private.h"
@@ -32,12 +33,6 @@ static xbt_swag_t
 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
 
-typedef enum {
-  READ = 0,
-  WRITE = 1,
-  DEFAULT = 2
-} STORAGE_execute_type_t;
-
 typedef struct surf_storage {
   s_surf_resource_t generic_resource;
   const char* type;
@@ -45,8 +40,15 @@ typedef struct surf_storage {
 } s_surf_storage_t, *surf_storage_t;
 
 static void storage_action_state_set(surf_action_t action, e_surf_action_state_t state);
-static surf_action_t storage_action_sleep (void *storage, double duration);
-static surf_action_t storage_action_execute (void *storage, size_t size, STORAGE_execute_type_t type);
+static surf_action_t storage_action_execute (void *storage, size_t size, e_surf_action_storage_type_t type);
+
+static surf_action_t storage_action_stat(void *storage, surf_file_t stream)
+{
+  surf_action_t action = storage_action_execute(storage,0, STAT);
+  action->file = stream;
+  action->stat = stream->content->stat;
+  return action;
+}
 
 static surf_action_t storage_action_open(void *storage, const char* path, const char* mode)
 {
@@ -57,13 +59,13 @@ static surf_action_t storage_action_open(void *storage, const char* path, const
       ROUTING_STORAGE_LEVEL);
   storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, storage_type_id,ROUTING_STORAGE_TYPE_LEVEL);
   xbt_dict_t content_dict = storage_type->content;
-  content_t content = xbt_dict_get(content_dict,path);
+  surf_stat_t content = xbt_dict_get(content_dict,path);
 
   surf_file_t file = xbt_new0(s_surf_file_t,1);
   file->name = xbt_strdup(path);
   file->content = content;
 
-  surf_action_t action = storage_action_execute(storage,0, DEFAULT);
+  surf_action_t action = storage_action_execute(storage,0, OPEN);
   action->file = (void *)file;
   return action;
 }
@@ -74,7 +76,7 @@ static surf_action_t storage_action_close(void *storage, surf_file_t fp)
   free(fp->name);
   fp->content = NULL;
   xbt_free(fp);
-  surf_action_t action = storage_action_execute(storage,0, DEFAULT);
+  surf_action_t action = storage_action_execute(storage,0, CLOSE);
   XBT_DEBUG("\tClose file '%s'",filename);
   return action;
 }
@@ -82,10 +84,10 @@ static surf_action_t storage_action_close(void *storage, surf_file_t fp)
 static surf_action_t storage_action_read(void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   char *filename = stream->name;
-  content_t content = stream->content;
-  XBT_DEBUG("\tRead file '%s' size '%Zu/%Zu'",filename,size,content->size);
-  if(size > content->size)
-    size = content->size;
+  surf_stat_t content = stream->content;
+  XBT_DEBUG("\tRead file '%s' size '%Zu/%Zu'",filename,size,content->stat.size);
+  if(size > content->stat.size)
+    size = content->stat.size;
   surf_action_t action = storage_action_execute(storage,size,READ);
   return action;
 }
@@ -93,21 +95,15 @@ static surf_action_t storage_action_read(void *storage, void* ptr, size_t size,
 static surf_action_t storage_action_write(void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream)
 {
   char *filename = stream->name;
-  content_t content = stream->content;
-  XBT_DEBUG("\tWrite file '%s' size '%Zu/%Zu'",filename,size,content->size);
+  surf_stat_t content = stream->content;
+  XBT_DEBUG("\tWrite file '%s' size '%Zu/%Zu'",filename,size,content->stat.size);
 
   surf_action_t action = storage_action_execute(storage,size,WRITE);
-  content->size += size;
+  content->stat.size += size;
   return action;
 }
 
-static surf_action_t storage_action_stat(void *storage, int fd, void* buf)
-{
-  THROW_UNIMPLEMENTED;
-  return NULL;
-}
-
-static surf_action_t storage_action_execute (void *storage, size_t size, STORAGE_execute_type_t type)
+static surf_action_t storage_action_execute (void *storage, size_t size, e_surf_action_storage_type_t type)
 {
   surf_action_storage_t action = NULL;
   storage_t STORAGE = storage;
@@ -123,44 +119,23 @@ static surf_action_t storage_action_execute (void *storage, size_t size, STORAGE
   GENERIC_LMM_ACTION(action).variable =
       lmm_variable_new(storage_maxmin_system, action, 1.0, -1.0 , 3);
 
-  if(type == DEFAULT)
-  lmm_expand(storage_maxmin_system, STORAGE->constraint,
-             GENERIC_LMM_ACTION(action).variable, 1.0);
-  else if(type == READ)
+  switch(type) {
+  case OPEN:
+  case CLOSE:
+  case STAT:
+    lmm_expand(storage_maxmin_system, STORAGE->constraint,
+               GENERIC_LMM_ACTION(action).variable, 1.0);
+    break;
+  case READ:
     lmm_expand(storage_maxmin_system, STORAGE->constraint_read,
                GENERIC_LMM_ACTION(action).variable, 1.0);
-  else if(type == WRITE)
+    break;
+  case WRITE:
     lmm_expand(storage_maxmin_system, STORAGE->constraint_write,
                GENERIC_LMM_ACTION(action).variable, 1.0);
-  else xbt_die("storage_action_execute with type '%d'",(int) type);
-
-  XBT_OUT();
-  return (surf_action_t) action;
-}
-
-static surf_action_t storage_action_sleep (void *storage, double duration)
-{
-  surf_action_storage_t action = NULL;
-
-  if (duration > 0)
-    duration = MAX(duration, MAXMIN_PRECISION);
-
-  XBT_IN("(%s,%g)", surf_resource_name(storage), duration);
-  action = (surf_action_storage_t) storage_action_execute(storage, 1.0, DEFAULT);
-  GENERIC_ACTION(action).max_duration = duration;
-  GENERIC_LMM_ACTION(action).suspended = 2;
-  if (duration == NO_MAX_DURATION) {
-    /* Move to the *end* of the corresponding action set. This convention
-       is used to speed up update_resource_state  */
-    xbt_swag_remove(action, ((surf_action_t) action)->state_set);
-    ((surf_action_t) action)->state_set =
-        storage_running_action_set_that_does_not_need_being_checked;
-    xbt_swag_insert(action, ((surf_action_t) action)->state_set);
+    break;
   }
 
-  lmm_update_variable_weight(storage_maxmin_system,
-                             GENERIC_LMM_ACTION(action).variable, 0.0);
-
   XBT_OUT();
   return (surf_action_t) action;
 }
@@ -216,8 +191,8 @@ static void storage_update_actions_state(double now, double delta)
   surf_action_storage_t action = NULL;
   surf_action_storage_t next_action = NULL;
   xbt_swag_t running_actions = surf_storage_model->states.running_action_set;
-  xbt_swag_foreach_safe(action, next_action, running_actions) {
 
+  xbt_swag_foreach_safe(action, next_action, running_actions) {
     double_update(&(GENERIC_ACTION(action).remains),
                   lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable) * delta);
     if (GENERIC_LMM_ACTION(action).generic_action.max_duration != NO_MAX_DURATION)
@@ -430,12 +405,12 @@ static void storage_parse_storage(sg_platf_storage_cbarg_t storage)
 
 static void free_storage_content(void *p)
 {
-  content_t content = p;
-  free(content->date);
-  free(content->group);
-  free(content->time);
-  free(content->user);
-  free(content->user_rights);
+  surf_stat_t content = p;
+  free(content->stat.date);
+  free(content->stat.group);
+  free(content->stat.time);
+  free(content->stat.user);
+  free(content->stat.user_rights);
   free(content);
 }
 
@@ -462,17 +437,17 @@ static xbt_dict_t parse_storage_content(const char *filename)
   char path[1024];
   int nb, size;
 
-  content_t content;
+  surf_stat_t content;
 
   while ((read = getline(&line, &len, file)) != -1) {
-    content = xbt_new0(s_content_t,1);
+    content = xbt_new0(s_surf_stat_t,1);
     if(sscanf(line,"%s %d %s %s %d %s %s %s",user_rights,&nb,user,group,&size,date,time,path)==8) {
-      content->date = xbt_strdup(date);
-      content->group = xbt_strdup(group);
-      content->size = size;
-      content->time = xbt_strdup(time);
-      content->user = xbt_strdup(user);
-      content->user_rights = xbt_strdup(user_rights);
+      content->stat.date = xbt_strdup(date);
+      content->stat.group = xbt_strdup(group);
+      content->stat.size = size;
+      content->stat.time = xbt_strdup(time);
+      content->stat.user = xbt_strdup(user);
+      content->stat.user_rights = xbt_strdup(user_rights);
       xbt_dict_set(parse_content,path,content,NULL);
     } else {
       xbt_die("Be sure of passing a good format for content file.\n");
index 63e9d2c..c5ae4d2 100644 (file)
@@ -10,7 +10,7 @@
 
 typedef struct s_storage_type {
   char *model;
-  xbt_dict_t content;
+  xbt_dict_t content; /* char * -> s_surf_stat_t */
   char *type_id;
   xbt_dict_t properties;
 } s_storage_type_t, *storage_type_t;
@@ -20,19 +20,14 @@ typedef struct s_mount {
   char *name;
 } s_mount_t, *mount_t;
 
-typedef struct s_content {
-  char *user_rights;
-  char *user;
-  char *group;
-  char *date;
-  char *time;
-  size_t size;
-} s_content_t, *content_t;
-
+typedef struct surf_stat { /* file status structure */
+  s_file_stat_t stat;
+  /* possible additionnal fields (e.g., popularity, last access time to know whether the file is in cache, ...) */
+} s_surf_stat_t, *surf_stat_t;
 
 typedef struct surf_file {
   char *name;
-  content_t content;
+  surf_stat_t content;
 } s_surf_file_t;
 
 typedef struct storage {
@@ -43,9 +38,13 @@ typedef struct storage {
   lmm_constraint_t constraint_read;    /* Constraint for maximum write bandwidth*/
 } s_storage_t, *storage_t;
 
+typedef enum {
+  READ, WRITE, STAT, OPEN, CLOSE
+} e_surf_action_storage_type_t;
+
 typedef struct surf_action_storage {
   s_surf_action_lmm_t generic_lmm_action;
-  int index_heap;
+  e_surf_action_storage_type_t type;
 } s_surf_action_storage_t, *surf_action_storage_t;
 
 #endif /* STORAGE_PRIVATE_H_ */
index 9cc7163..1ff033d 100644 (file)
@@ -335,12 +335,12 @@ static surf_action_t ws_action_write(void *workstation, const char* storage, con
   return model->extension.storage.write(st,  ptr, size, nmemb, stream);
 }
 
-static surf_action_t ws_action_stat(void *workstation, const char* storage, int fd, void* buf)
+static surf_action_t ws_action_stat(void *workstation, const char* storage, surf_file_t stream)
 {
   storage_t st = find_storage_on_mount_list(workstation, storage);
   XBT_DEBUG("STAT on disk '%s'",st->generic_resource.name);
   surf_model_t model = st->generic_resource.model;
-  return model->extension.storage.stat(st,  fd, buf);
+  return model->extension.storage.stat(st,  stream);
 }
 
 static void surf_workstation_model_init_internal(void)