A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
s4u
/
s4u_file.cpp
diff --git
a/src/s4u/s4u_file.cpp
b/src/s4u/s4u_file.cpp
index
25595a9
..
37b4f3a
100644
(file)
--- a/
src/s4u/s4u_file.cpp
+++ b/
src/s4u/s4u_file.cpp
@@
-25,9
+25,9
@@
File::File(const char* fullpath, sg_host_t host, void* userdata) : path_(fullpat
Storage* st = nullptr;
size_t longest_prefix_length = 0;
std::string path;
Storage* st = nullptr;
size_t longest_prefix_length = 0;
std::string path;
- XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath, host->
c
name());
+ XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath, host->
getC
name());
- for (auto mnt : host->
m
ountedStorages()) {
+ for (auto mnt : host->
getM
ountedStorages()) {
XBT_DEBUG("See '%s'", mnt.first.c_str());
mount_point = std::string(fullpath).substr(0, mnt.first.size());
XBT_DEBUG("See '%s'", mnt.first.c_str());
mount_point = std::string(fullpath).substr(0, mnt.first.size());
@@
-41,11
+41,11
@@
File::File(const char* fullpath, sg_host_t host, void* userdata) : path_(fullpat
mount_point = std::string(fullpath).substr(0, longest_prefix_length);
path = std::string(fullpath).substr(longest_prefix_length, strlen(fullpath));
} else
mount_point = std::string(fullpath).substr(0, longest_prefix_length);
path = std::string(fullpath).substr(longest_prefix_length, strlen(fullpath));
} else
- xbt_die("Can't find mount point for '%s' on '%s'", fullpath, host->
c
name());
+ xbt_die("Can't find mount point for '%s' on '%s'", fullpath, host->
getC
name());
pimpl_ = simcall_file_open(mount_point.c_str(), path.c_str(), st);
pimpl_ = simcall_file_open(mount_point.c_str(), path.c_str(), st);
- storage_type = st->
t
ype();
- storageId = st->
n
ame();
+ storage_type = st->
getT
ype();
+ storageId = st->
getN
ame();
}
File::~File()
}
File::~File()
@@
-90,17
+90,18
@@
sg_size_t File::tell()
void File::move(const char* fullpath)
{
void File::move(const char* fullpath)
{
- simcall_file_move(pimpl_,fullpath);
+ sg_host_t host = Host::current();
+ simgrid::simix::kernelImmediate([this, host, fullpath] { pimpl_->move(host, fullpath); });
}
}
-
void
File::unlink()
+
int
File::unlink()
{
{
-
simcall_file_unlink(pimpl_,
Host::current());
+
return unlink(
Host::current());
}
}
-
void
File::unlink(sg_host_t host)
+
int
File::unlink(sg_host_t host)
{
{
-
simcall_file_unlink(pimpl_, host
);
+
return simgrid::simix::kernelImmediate([this, host] { return pimpl_->unlink(host); }
);
}
}} // namespace simgrid::s4u
}
}} // namespace simgrid::s4u