mountinfo_free(disk_mountinfo_root);
// re-read mountinfo in case something changed
- disk_mountinfo_root = mountinfo_read();
+ disk_mountinfo_root = mountinfo_read(1);
last_loaded = now;
}
mountinfo_free(disk_mountinfo_root);
// re-read mountinfo in case something changed
- disk_mountinfo_root = mountinfo_read();
+ disk_mountinfo_root = mountinfo_read(0);
last_loaded = now;
}
}
// 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);
}
// 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;
extern struct mountinfo *mountinfo_find_by_filesystem_super_option(struct mountinfo *root, const char *filesystem, const char *super_options);
extern void mountinfo_free(struct mountinfo *mi);
-extern struct mountinfo *mountinfo_read();
+extern struct mountinfo *mountinfo_read(int do_statvfs);
#endif /* NETDATA_PROC_SELF_MOUNTINFO_H */
\ No newline at end of file
cgroup_enable_blkio = config_get_boolean_ondemand("plugin:cgroups", "enable blkio", cgroup_enable_blkio);
char filename[FILENAME_MAX + 1], *s;
- struct mountinfo *mi, *root = mountinfo_read();
+ struct mountinfo *mi, *root = mountinfo_read(0);
mi = mountinfo_find_by_filesystem_super_option(root, "cgroup", "cpuacct");
if(!mi) mi = mountinfo_find_by_filesystem_mount_source(root, "cgroup", "cpuacct");