Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't call things storage when it's mount
authorsuter <frederic.suter@cc.in2p3.fr>
Tue, 18 Jun 2013 13:15:57 +0000 (15:15 +0200)
committersuter <frederic.suter@cc.in2p3.fr>
Tue, 18 Jun 2013 13:28:49 +0000 (15:28 +0200)
src/surf/storage.c
src/surf/storage_private.h
src/surf/workstation.c

index 7d3fed6..d399fdb 100644 (file)
@@ -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;
index 1d896f5..41b94c4 100644 (file)
@@ -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;
 
index ff6564d..1d0fcca 100644 (file)
@@ -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;
     }