< prev index next >
src/hotspot/os/linux/gc/z/zMountPoint_linux.cpp
Print this page
@@ -21,36 +21,36 @@
* questions.
*/
#include "precompiled.hpp"
#include "gc/z/zArray.inline.hpp"
-#include "gc/z/zBackingPath_linux.hpp"
#include "gc/z/zErrno.hpp"
+#include "gc/z/zMountPoint_linux.hpp"
#include "logging/log.hpp"
#include <stdio.h>
#include <unistd.h>
// Mount information, see proc(5) for more details.
#define PROC_SELF_MOUNTINFO "/proc/self/mountinfo"
-ZBackingPath::ZBackingPath(const char* filesystem, const char** preferred_mountpoints) {
+ZMountPoint::ZMountPoint(const char* filesystem, const char** preferred_mountpoints) {
if (ZPath != NULL) {
// Use specified path
_path = strdup(ZPath);
} else {
// Find suitable path
_path = find_mountpoint(filesystem, preferred_mountpoints);
}
}
-ZBackingPath::~ZBackingPath() {
+ZMountPoint::~ZMountPoint() {
free(_path);
_path = NULL;
}
-char* ZBackingPath::get_mountpoint(const char* line, const char* filesystem) const {
+char* ZMountPoint::get_mountpoint(const char* line, const char* filesystem) const {
char* line_mountpoint = NULL;
char* line_filesystem = NULL;
// Parse line and return a newly allocated string containing the mount point if
// the line contains a matching filesystem and the mount point is accessible by
@@ -66,11 +66,11 @@
free(line_filesystem);
return line_mountpoint;
}
-void ZBackingPath::get_mountpoints(const char* filesystem, ZArray<char*>* mountpoints) const {
+void ZMountPoint::get_mountpoints(const char* filesystem, ZArray<char*>* mountpoints) const {
FILE* fd = fopen(PROC_SELF_MOUNTINFO, "r");
if (fd == NULL) {
ZErrno err;
log_error(gc)("Failed to open %s: %s", PROC_SELF_MOUNTINFO, err.to_string());
return;
@@ -88,19 +88,19 @@
free(line);
fclose(fd);
}
-void ZBackingPath::free_mountpoints(ZArray<char*>* mountpoints) const {
+void ZMountPoint::free_mountpoints(ZArray<char*>* mountpoints) const {
ZArrayIterator<char*> iter(mountpoints);
for (char* mountpoint; iter.next(&mountpoint);) {
free(mountpoint);
}
mountpoints->clear();
}
-char* ZBackingPath::find_preferred_mountpoint(const char* filesystem,
+char* ZMountPoint::find_preferred_mountpoint(const char* filesystem,
ZArray<char*>* mountpoints,
const char** preferred_mountpoints) const {
// Find preferred mount point
ZArrayIterator<char*> iter1(mountpoints);
for (char* mountpoint; iter1.next(&mountpoint);) {
@@ -120,11 +120,11 @@
}
return NULL;
}
-char* ZBackingPath::find_mountpoint(const char* filesystem, const char** preferred_mountpoints) const {
+char* ZMountPoint::find_mountpoint(const char* filesystem, const char** preferred_mountpoints) const {
char* path = NULL;
ZArray<char*> mountpoints;
get_mountpoints(filesystem, &mountpoints);
@@ -142,8 +142,8 @@
free_mountpoints(&mountpoints);
return path;
}
-const char* ZBackingPath::get() const {
+const char* ZMountPoint::get() const {
return _path;
}
< prev index next >