}
// read the whole mountinfo into a linked list
-struct mountinfo *mountinfo_read() {
+struct mountinfo *mountinfo_read(int do_statvfs) {
char filename[FILENAME_MAX + 1];
snprintfz(filename, FILENAME_MAX, "%s/proc/self/mountinfo", global_host_prefix);
procfile *ff = procfile_open(filename, " \t", PROCFILE_FLAG_DEFAULT);
mi->flags |= MOUNTINFO_IS_REMOTE;
// mark as BIND the duplicates (i.e. same filesystem + same source)
- {
+ if(do_statvfs) {
struct stat buf;
if(unlikely(stat(mi->mount_point, &buf) == -1)) {
mi->st_dev = 0;
}
}
}
+ else {
+ mi->st_dev = 0;
+ }
}
else {
mi->filesystem = NULL;
}
// check if it has size
- {
+ if(do_statvfs) {
struct statvfs buff_statvfs;
if(unlikely(statvfs(mi->mount_point, &buff_statvfs) < 0)) {
mi->flags |= MOUNTINFO_NO_STAT;