Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More coding style updates for sg_disk.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 23 Oct 2020 21:27:13 +0000 (23:27 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 23 Oct 2020 21:54:49 +0000 (23:54 +0200)
examples/c/io-disk-raw/io-disk-raw.c
examples/c/io-file-remote/io-file-remote.c
examples/c/io-file-system/io-file-system.c
include/simgrid/disk.h
src/s4u/s4u_Disk.cpp

index 269a4b0..6520d83 100644 (file)
@@ -30,17 +30,17 @@ static void host(int argc, char* argv[])
   sg_host_disks(sg_host_self(), &disk_count, &disk_list);
 
   for (unsigned int i = 0; i < disk_count; i++)
-    XBT_INFO("Disk name: %s (read: %.0f B/s -- write: %.0f B/s ", sg_disk_name(disk_list[i]),
+    XBT_INFO("Disk name: %s (read: %.0f B/s -- write: %.0f B/s ", sg_disk_get_name(disk_list[i]),
              sg_disk_read_bandwidth(disk_list[i]), sg_disk_write_bandwidth(disk_list[i]));
 
   /* - Write 400,000 bytes on Disk1 */
   sg_disk_t disk  = disk_list[0];
   sg_size_t write = sg_disk_write(disk, 400000);
-  XBT_INFO("Wrote %llu bytes on '%s'", write, sg_disk_name(disk));
+  XBT_INFO("Wrote %llu bytes on '%s'", write, sg_disk_get_name(disk));
 
   /*  - Now read 200,000 bytes */
   sg_size_t read = sg_disk_read(disk, 200000);
-  XBT_INFO("Read %llu bytes on '%s'", read, sg_disk_name(disk));
+  XBT_INFO("Read %llu bytes on '%s'", read, sg_disk_get_name(disk));
 
   /* - Attach some user data to disk1 */
   XBT_INFO("*** Get/set data for storage element: Disk1 ***");
index 7c8d412..7a3a38f 100644 (file)
@@ -60,7 +60,7 @@ int main(int argc, char** argv)
     for (unsigned int j = 0; j < disk_count; j++)
       XBT_INFO("Init: %s: %llu/%llu MiB used/free on '%s@%s'", sg_host_get_name(hosts[i]),
                sg_disk_get_size_used(disks[j]) / INMEGA, sg_disk_get_size_free(disks[j]) / INMEGA,
-               sg_disk_name(disks[j]), sg_host_get_name(sg_disk_get_host(disks[j])));
+               sg_disk_get_name(disks[j]), sg_host_get_name(sg_disk_get_host(disks[j])));
     free(disks);
   }
 
@@ -72,7 +72,7 @@ int main(int argc, char** argv)
     sg_host_disks(hosts[i], &disk_count, &disks);
     for (unsigned int j = 0; j < disk_count; j++)
       XBT_INFO("End: %llu/%llu MiB used/free on '%s@%s'", sg_disk_get_size_used(disks[j]) / INMEGA,
-               sg_disk_get_size_free(disks[j]) / INMEGA, sg_disk_name(disks[j]), sg_host_get_name(hosts[i]));
+               sg_disk_get_size_free(disks[j]) / INMEGA, sg_disk_get_name(disks[j]), sg_host_get_name(hosts[i]));
     free(disks);
   }
 
index c266708..988253b 100644 (file)
@@ -24,7 +24,7 @@ static void show_info(unsigned int disk_count, const sg_disk_t* disks)
   for (unsigned int i = 0; i < disk_count; i++) {
     const_sg_disk_t d = disks[i];
     // Retrieve disk's information
-    XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", sg_disk_name(d), sg_disk_get_mount_point(d),
+    XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", sg_disk_get_name(d), sg_disk_get_mount_point(d),
              sg_disk_get_size_used(d), sg_disk_get_size_free(d), sg_disk_get_size(d));
   }
 }
index e0c8874..65b6b52 100644 (file)
@@ -11,7 +11,8 @@
 
 /* C interface */
 SG_BEGIN_DECL
-XBT_PUBLIC const char* sg_disk_name(const_sg_disk_t disk);
+XBT_PUBLIC const char* sg_disk_get_name(const_sg_disk_t disk);
+XBT_ATTRIB_DEPRECATED_v330("Please use sg_disk_get_name()") XBT_PUBLIC const char* sg_disk_name(const_sg_disk_t disk);
 XBT_PUBLIC sg_host_t sg_disk_get_host(const_sg_disk_t disk);
 XBT_PUBLIC double sg_disk_read_bandwidth(const_sg_disk_t disk);
 XBT_PUBLIC double sg_disk_write_bandwidth(const_sg_disk_t disk);
index 100dc6e..f79b6d0 100644 (file)
@@ -80,11 +80,16 @@ sg_size_t Disk::write(sg_size_t size)
 
 /* **************************** Public C interface *************************** */
 
-const char* sg_disk_name(const_sg_disk_t disk)
+const char* sg_disk_get_name(const_sg_disk_t disk)
 {
   return disk->get_cname();
 }
 
+const char* sg_disk_name(const_sg_disk_t disk) // XBT_ATTRIB_DEPRECATED_v330
+{
+  return sg_disk_get_name(disk);
+}
+
 sg_host_t sg_disk_get_host(const_sg_disk_t disk)
 {
   return disk->get_host();