Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove MSG_file_ls()
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Tue, 1 Apr 2014 08:52:04 +0000 (10:52 +0200)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Tue, 1 Apr 2014 08:52:04 +0000 (10:52 +0200)
18 files changed:
examples/msg/io/file_unlink.c
include/msg/msg.h
include/simgrid/simix.h
src/include/surf/surf.h
src/msg/msg_io.c
src/simix/simcalls.in
src/simix/simcalls_generated_args_getter_setter.h
src/simix/simcalls_generated_body.c
src/simix/simcalls_generated_case.c
src/simix/simcalls_generated_enum.h
src/simix/simcalls_generated_res_getter_setter.h
src/simix/simcalls_generated_string.c
src/simix/smx_io.c
src/simix/smx_io_private.h
src/simix/smx_user.c
src/surf/surf_c_bindings.cpp
src/surf/workstation_interface.cpp
src/surf/workstation_interface.hpp

index 66db927..04e7bdd 100644 (file)
@@ -52,35 +52,6 @@ int host(int argc, char *argv[])
   XBT_INFO("\tClose file '%s'",MSG_file_get_name(file));
   MSG_file_close(file);
 
-//  xbt_dict_t dict_ls;
-//  char* key;
-//  surf_stat_t data = NULL;
-//  xbt_dict_cursor_t cursor = NULL;
-//
-//  dict_ls = MSG_file_ls(mount,"./");
-//  XBT_INFO(" ");XBT_INFO("ls ./");
-//  xbt_dict_foreach(dict_ls,cursor,key,data){
-//    if(data) XBT_INFO("FILE : %s",key);
-//    else     XBT_INFO("DIR  : %s",key);
-//  }
-//  xbt_dict_free(&dict_ls);
-//
-//  dict_ls = MSG_file_ls(mount,"./doc/simgrid/examples/platforms/");
-//  XBT_INFO(" ");XBT_INFO("ls ./doc/simgrid/examples/platforms/");
-//  xbt_dict_foreach(dict_ls,cursor,key,data){
-//    if(data) XBT_INFO("FILE : %s",key);
-//    else     XBT_INFO("DIR  : %s",key);
-//  }
-//  xbt_dict_free(&dict_ls);
-//
-//  dict_ls = MSG_file_ls(mount,"./doc/simgrid/examples/msg/");
-//  XBT_INFO(" ");XBT_INFO("ls ./doc/simgrid/examples/msg/");
-//  xbt_dict_foreach(dict_ls,cursor,key,data){
-//    if(data) XBT_INFO("FILE : %s",key);
-//    else     XBT_INFO("DIR  : %s",key);
-//  }
-//  xbt_dict_free(&dict_ls);
-
   return 0;
 }
 
index ec4eca8..04e23b2 100644 (file)
@@ -90,7 +90,6 @@ XBT_PUBLIC(int) MSG_file_close(msg_file_t fd);
 XBT_PUBLIC(sg_size_t) MSG_file_get_size(msg_file_t fd);
 XBT_PUBLIC(void) MSG_file_dump(msg_file_t fd);
 XBT_PUBLIC(int) MSG_file_unlink(msg_file_t fd);
-XBT_PUBLIC(xbt_dict_t) MSG_file_ls(const char *mount, const char *path);
 XBT_PUBLIC(msg_error_t) MSG_file_seek(msg_file_t fd, sg_size_t offset, int origin);
 XBT_PUBLIC(sg_size_t) MSG_file_tell (msg_file_t fd);
 XBT_PUBLIC(void) __MSG_file_get_info(msg_file_t fd);
index 2013686..c5f8f4c 100644 (file)
@@ -493,7 +493,6 @@ XBT_PUBLIC(sg_size_t) simcall_file_write(smx_file_t fd, sg_size_t size, smx_host
 XBT_PUBLIC(smx_file_t) simcall_file_open(const char* fullpath);
 XBT_PUBLIC(int) simcall_file_close(smx_file_t fd);
 XBT_PUBLIC(int) simcall_file_unlink(smx_file_t fd);
-XBT_PUBLIC(xbt_dict_t) simcall_file_ls(const char* mount, const char* path);
 XBT_PUBLIC(sg_size_t) simcall_file_get_size(smx_file_t fd);
 XBT_PUBLIC(xbt_dynar_t) simcall_file_get_info(smx_file_t fd);
 XBT_PUBLIC(sg_size_t) simcall_file_tell(smx_file_t fd);
index 16da53a..fdcbf87 100644 (file)
@@ -664,17 +664,6 @@ XBT_PUBLIC(xbt_dynar_t) surf_workstation_get_attached_storage_list(surf_resource
  */
 XBT_PUBLIC(int) surf_workstation_unlink(surf_resource_t workstation, surf_file_t fd);
 
-/**
- * @brief List directory contents of a path
- * @details [long description]
- * 
- * @param workstation The surf workstation
- * @param mount The mount point
- * @param path The path to the directory
- * @return The surf action corresponding to the ls action
- */
-XBT_PUBLIC(surf_action_t) surf_workstation_ls(surf_resource_t workstation, const char* mount, const char *path);
-
 /**
  * @brief Get the size of a file on a workstation
  * 
index 9a8b5c4..5ab29a3 100644 (file)
@@ -246,30 +246,6 @@ sg_size_t MSG_file_get_size(msg_file_t fd){
   return simcall_file_get_size(priv->simdata->smx_file);
 }
 
-/** \ingroup msg_file_management
- * \brief Search for file
- *
- * \param mount is the mount point where find the file is located
- * \param path the file regex to find
- * \return a xbt_dict_t of file where key is the name of file and the
- * value the msg_stat_t corresponding to the key
- */
-xbt_dict_t MSG_file_ls(const char *mount, const char *path)
-{
-  xbt_assert(path,"You must set path");
-  int size = strlen(path);
-  if(size && path[size-1] != '/')
-  {
-    char *new_path = bprintf("%s/",path);
-    XBT_DEBUG("Change '%s' for '%s'",path,new_path);
-    xbt_dict_t dict = simcall_file_ls(mount, new_path);
-    xbt_free(new_path);
-    return dict;
-  }
-
-  return simcall_file_ls(mount, path);
-}
-
 /**
  * \ingroup msg_file_management
  * \brief Set the file position indicator in the msg_file_t by adding offset bytes
index 95711bd..a2737cf 100644 (file)
@@ -113,7 +113,6 @@ file_write False (sg_size_t) (fd, void*, smx_file_t) (size, sg_size_t) (host, vo
 file_open False (void*, smx_file_t) (fullpath, const char*)
 file_close False (int) (fd, void*, smx_file_t)
 file_unlink True (int) (fd, void*, smx_file_t)
-file_ls False (void*, xbt_dict_t) (mount, const char*) (path, const char*)
 file_get_size True (sg_size_t) (fd, void*, smx_file_t)
 file_tell True (sg_size_t) (fd, void*, smx_file_t)
 file_seek True (int) (fd, void*, smx_file_t) (offset, sg_size_t) (origin, int)
index b55da63..b741de7 100644 (file)
@@ -1106,18 +1106,6 @@ static inline smx_file_t simcall_file_unlink__get__fd(smx_simcall_t simcall){
 static inline void simcall_file_unlink__set__fd(smx_simcall_t simcall, void* arg){
     simcall->args[0].dp = arg;
 }
-static inline const char* simcall_file_ls__get__mount(smx_simcall_t simcall){
-  return  simcall->args[0].cc;
-}
-static inline void simcall_file_ls__set__mount(smx_simcall_t simcall, const char* arg){
-    simcall->args[0].cc = arg;
-}
-static inline const char* simcall_file_ls__get__path(smx_simcall_t simcall){
-  return  simcall->args[1].cc;
-}
-static inline void simcall_file_ls__set__path(smx_simcall_t simcall, const char* arg){
-    simcall->args[1].cc = arg;
-}
 static inline smx_file_t simcall_file_get_size__get__fd(smx_simcall_t simcall){
   return (smx_file_t) simcall->args[0].dp;
 }
index f6f4fdb..82201b6 100644 (file)
     }    
     return self->simcall.result.i;
   }
-  inline static xbt_dict_t simcall_BODY_file_ls(const char* mount, const char* path) {
-    smx_process_t self = SIMIX_process_self();
-    self->simcall.call = SIMCALL_FILE_LS;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].cc = (const char*) mount;
-    self->simcall.args[1].cc = (const char*) path;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_pre(&self->simcall, 0);
-    }    
-    return self->simcall.result.dp;
-  }
   inline static sg_size_t simcall_BODY_file_get_size(smx_file_t fd) {
     smx_process_t self = SIMIX_process_self();
     self->simcall.call = SIMCALL_FILE_GET_SIZE;
index 01ebce1..61fb599 100644 (file)
@@ -522,10 +522,6 @@ case SIMCALL_FILE_UNLINK:
       SIMIX_simcall_answer(simcall);
       break;  
 
-case SIMCALL_FILE_LS:
-       SIMIX_pre_file_ls(simcall ,  simcall->args[0].cc,  simcall->args[1].cc);
-       break;  
-
 case SIMCALL_FILE_GET_SIZE:
       simcall->result.sgsz = SIMIX_pre_file_get_size(simcall , (smx_file_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
index 5130bb2..9667890 100644 (file)
@@ -112,7 +112,6 @@ SIMCALL_FILE_WRITE,
 SIMCALL_FILE_OPEN,
 SIMCALL_FILE_CLOSE,
 SIMCALL_FILE_UNLINK,
-SIMCALL_FILE_LS,
 SIMCALL_FILE_GET_SIZE,
 SIMCALL_FILE_TELL,
 SIMCALL_FILE_SEEK,
index d339060..a20e7ad 100644 (file)
@@ -455,12 +455,6 @@ static inline int simcall_file_unlink__get__result(smx_simcall_t simcall){
 static inline void simcall_file_unlink__set__result(smx_simcall_t simcall, int result){
     simcall->result.i = result;
 }
-static inline xbt_dict_t simcall_file_ls__get__result(smx_simcall_t simcall){
-  return (xbt_dict_t) simcall->result.dp;
-}
-static inline void simcall_file_ls__set__result(smx_simcall_t simcall, void* result){
-    simcall->result.dp = result;
-}
 static inline sg_size_t simcall_file_get_size__get__result(smx_simcall_t simcall){
   return  simcall->result.sgsz;
 }
index 8ef57be..c75900e 100644 (file)
 [SIMCALL_FILE_OPEN] = "SIMCALL_FILE_OPEN",
 [SIMCALL_FILE_CLOSE] = "SIMCALL_FILE_CLOSE",
 [SIMCALL_FILE_UNLINK] = "SIMCALL_FILE_UNLINK",
-[SIMCALL_FILE_LS] = "SIMCALL_FILE_LS",
 [SIMCALL_FILE_GET_SIZE] = "SIMCALL_FILE_GET_SIZE",
 [SIMCALL_FILE_TELL] = "SIMCALL_FILE_TELL",
 [SIMCALL_FILE_SEEK] = "SIMCALL_FILE_SEEK",
index 4b5b1f2..8abeb2b 100644 (file)
@@ -210,39 +210,6 @@ int SIMIX_file_unlink(smx_process_t process, smx_file_t fd)
     return 0;
 }
 
-//SIMIX FILE LS
-void SIMIX_pre_file_ls(smx_simcall_t simcall,
-                       const char* mount, const char* path)
-{
-  smx_action_t action = SIMIX_file_ls(simcall->issuer, mount, path);
-  xbt_fifo_push(action->simcalls, simcall);
-  simcall->issuer->waiting_action = action;
-}
-smx_action_t SIMIX_file_ls(smx_process_t process, const char* mount, const char *path)
-{
-  smx_action_t action;
-  smx_host_t host = process->smx_host;
-  /* check if the host is active */
-  if (surf_resource_get_state(surf_workstation_resource_priv(host)) != SURF_RESOURCE_ON) {
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function",
-           sg_host_name(host));
-  }
-
-  action = xbt_mallocator_get(simix_global->action_mallocator);
-  action->type = SIMIX_ACTION_IO;
-  action->name = NULL;
-#ifdef HAVE_TRACING
-  action->category = NULL;
-#endif
-
-  action->io.host = host;
-  action->io.surf_io = surf_workstation_ls(host,mount,path);
-
-  surf_action_set_data(action->io.surf_io, action);
-  XBT_DEBUG("Create io action %p", action);
-  return action;
-}
-
 sg_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd)
 {
   return SIMIX_file_get_size(simcall->issuer, fd);
@@ -401,17 +368,6 @@ void SIMIX_post_io(smx_action_t action)
       simcall_file_read__set__result(simcall, surf_action_get_cost(action->io.surf_io));
       break;
 
-    case SIMCALL_FILE_LS:
-//      xbt_dict_foreach((action->io.surf_io)->ls_dict,cursor,key, src){
-//        // if there is a stat we have to duplicate it
-//        if(src){
-//          dst = xbt_new0(s_file_stat_t,1);
-//          file_stat_copy(src, dst);
-//          xbt_dict_set((action->io.surf_io)->ls_dict,key,dst,xbt_free);
-//        }
-//      }
-      simcall_file_ls__set__result(simcall, surf_storage_action_get_ls_dict(action->io.surf_io));
-      break;
     default:
       break;
     }
index 4ab6974..831d4a1 100644 (file)
@@ -27,8 +27,6 @@ void SIMIX_pre_file_write(smx_simcall_t simcall,smx_file_t fd, sg_size_t size, s
 void SIMIX_pre_file_open(smx_simcall_t simcall, const char* fullpath);
 void SIMIX_pre_file_close(smx_simcall_t simcall, smx_file_t fd);
 int SIMIX_pre_file_unlink(smx_simcall_t simcall, smx_file_t fd);
-void SIMIX_pre_file_ls(smx_simcall_t simcall,
-                       const char* mount, const char* path);
 sg_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd);
 sg_size_t SIMIX_pre_file_tell(smx_simcall_t simcall, smx_file_t fd);
 xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd);
@@ -40,8 +38,6 @@ smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t si
 smx_action_t SIMIX_file_open(smx_process_t process, const char* fullpath);
 smx_action_t SIMIX_file_close(smx_process_t process, smx_file_t fd);
 int SIMIX_file_unlink(smx_process_t process, smx_file_t fd);
-smx_action_t SIMIX_file_ls(smx_process_t process, const char *mount,
-                           const char *path);
 sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
 sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
 xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
index c6da787..6eb5338 100644 (file)
@@ -1359,14 +1359,6 @@ int simcall_file_unlink(smx_file_t fd)
   return simcall_BODY_file_unlink(fd);
 }
 
-/**
- * \ingroup simix_file_management
- *
- */
-xbt_dict_t simcall_file_ls(const char* mount, const char* path)
-{
-  return simcall_BODY_file_ls(mount, path);
-}
 /**
  * \ingroup simix_file_management
  *
index b34f4ee..8a0fea3 100644 (file)
@@ -372,10 +372,6 @@ int surf_workstation_unlink(surf_resource_t workstation, surf_file_t fd){
   return get_casted_workstation(workstation)->unlink(fd);
 }
 
-surf_action_t surf_workstation_ls(surf_resource_t workstation, const char* mount, const char *path){
-  return get_casted_workstation(workstation)->ls(mount, path);
-}
-
 size_t surf_workstation_get_size(surf_resource_t workstation, surf_file_t fd){
   return get_casted_workstation(workstation)->getSize(fd);
 }
index dae99c9..cc7fb44 100644 (file)
@@ -292,12 +292,6 @@ int Workstation::unlink(surf_file_t fd) {
   }
 }
 
-ActionPtr Workstation::ls(const char* mount, const char *path){
-  XBT_DEBUG("LS on mount '%s' and file '%s'", mount, path);
-  StoragePtr st = findStorageOnMountList(mount);
-  return st->ls(path);
-}
-
 sg_size_t Workstation::getSize(surf_file_t fd){
   return fd->size;
 }
index 799ee13..da9e455 100644 (file)
@@ -281,16 +281,6 @@ public:
    */
   virtual int unlink(surf_file_t fd);
 
-  /**
-   * @brief List directory contents of a path
-   * @details [long description]
-   *
-   * @param mount [description]
-   * @param path The path to the directory
-   * @return The StorageAction corresponding to the ls action
-   */
-  virtual ActionPtr ls(const char* mount, const char *path);
-
   /**
    * @brief Get the size in bytes of the file
    *