From: Martin Quinson Date: Wed, 22 Nov 2017 09:26:53 +0000 (+0100) Subject: rename a field for clarity: that's not a signal X-Git-Tag: v3.18~259 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/def26f4b4bce4809f6708780a57a675ee382d6e4?hp=e7ed2d7de564fc46a1e0885e997900370bb811cf rename a field for clarity: that's not a signal --- diff --git a/include/simgrid/s4u/File.hpp b/include/simgrid/s4u/File.hpp index 1429d2cf37..dca7d832e9 100644 --- a/include/simgrid/s4u/File.hpp +++ b/include/simgrid/s4u/File.hpp @@ -60,7 +60,7 @@ public: int unlink(); std::string mount_point; - Storage* onStorage; + Storage* localStorage; int desc_id = 0; private: diff --git a/src/msg/msg_io.cpp b/src/msg/msg_io.cpp index fffbd34476..18390a6401 100644 --- a/src/msg/msg_io.cpp +++ b/src/msg/msg_io.cpp @@ -73,8 +73,8 @@ void MSG_file_dump (msg_file_t fd){ "\t\tStorage Id: '%s'\n" "\t\tStorage Type: '%s'\n" "\t\tFile Descriptor Id: %d", - fd->getPath(), fd->size(), fd->mount_point.c_str(), fd->onStorage->getCname(), fd->onStorage->getType(), - fd->desc_id); + fd->getPath(), fd->size(), fd->mount_point.c_str(), fd->localStorage->getCname(), + fd->localStorage->getType(), fd->desc_id); } /** \ingroup msg_file @@ -92,7 +92,7 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size) return 0; /* Find the host where the file is physically located and read it */ - msg_storage_t storage_src = fd->onStorage; + msg_storage_t storage_src = fd->localStorage; msg_host_t attached_host = storage_src->getHost(); read_size = fd->read(size); @@ -133,7 +133,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size) return 0; /* Find the host where the file is physically located (remote or local)*/ - msg_storage_t storage_src = fd->onStorage; + msg_storage_t storage_src = fd->localStorage; msg_host_t attached_host = storage_src->getHost(); if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) { @@ -275,7 +275,7 @@ msg_error_t MSG_file_move (msg_file_t fd, const char* fullpath) msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpath) { /* Find the host where the file is physically located and read it */ - msg_storage_t storage_src = file->onStorage; + msg_storage_t storage_src = file->localStorage; msg_host_t src_host = storage_src->getHost(); MSG_file_seek(file, 0, SEEK_SET); sg_size_t read_size = file->read(file->size()); diff --git a/src/s4u/s4u_file.cpp b/src/s4u/s4u_file.cpp index 8c90137942..af4a32d907 100644 --- a/src/s4u/s4u_file.cpp +++ b/src/s4u/s4u_file.cpp @@ -45,7 +45,7 @@ File::File(std::string fullpath, sg_host_t host, void* userdata) : path_(fullpat pimpl_ = simgrid::simix::kernelImmediate([this, st, path] { return new simgrid::surf::FileImpl(st, path, mount_point); }); - onStorage = st; + localStorage = st; } File::~File() @@ -55,28 +55,28 @@ File::~File() sg_size_t File::read(sg_size_t size) { - XBT_DEBUG("READ %s on disk '%s'", getPath(), onStorage->getCname()); + XBT_DEBUG("READ %s on disk '%s'", getPath(), localStorage->getCname()); // if the current position is close to the end of the file, we may not be able to read the requested size - sg_size_t read_size = onStorage->read(std::min(size, this->size() - this->tell())); + sg_size_t read_size = localStorage->read(std::min(size, this->size() - this->tell())); pimpl_->incrPosition(read_size); return read_size; } sg_size_t File::write(sg_size_t size) { - XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", getPath(), onStorage->getCname(), size, this->size()); + XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", getPath(), localStorage->getCname(), size, this->size()); // If the storage is full before even starting to write - if (onStorage->getSizeUsed() >= onStorage->getSize()) + if (localStorage->getSizeUsed() >= localStorage->getSize()) return 0; /* Substract the part of the file that might disappear from the used sized on the storage element */ - onStorage->decrUsedSize(this->size() - this->tell()); + localStorage->decrUsedSize(this->size() - this->tell()); - sg_size_t write_size = onStorage->write(size); + sg_size_t write_size = localStorage->write(size); pimpl_->incrPosition(write_size); pimpl_->setSize(this->tell()); - onStorage->getContent()->erase(pimpl_->getName()); - onStorage->getContent()->insert({pimpl_->getName(), this->size()}); + localStorage->getContent()->erase(pimpl_->getName()); + localStorage->getContent()->insert({pimpl_->getName(), this->size()}); return write_size; }