ZFS: Changes.
This commit is contained in:
parent
f5e8d5e6de
commit
b8e8164f85
|
@ -87,30 +87,6 @@ _cmp_cb(const void *p1, const void *p2)
|
||||||
return strcmp(s1, s2);
|
return strcmp(s1, s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
|
||||||
disk_zfs_mounted_get(void)
|
|
||||||
{
|
|
||||||
Eina_List *disks;
|
|
||||||
char *path;
|
|
||||||
Eina_Bool zfs_mounted = EINA_FALSE;
|
|
||||||
|
|
||||||
disks = disks_get();
|
|
||||||
EINA_LIST_FREE(disks, path)
|
|
||||||
{
|
|
||||||
Filesystem_Info *fs = filesystem_info_get(path);
|
|
||||||
if (fs)
|
|
||||||
{
|
|
||||||
if (fs->type == filesystem_id_by_name("ZFS"))
|
|
||||||
zfs_mounted = EINA_TRUE;
|
|
||||||
|
|
||||||
filesystem_info_free(fs);
|
|
||||||
}
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
return zfs_mounted;
|
|
||||||
}
|
|
||||||
|
|
||||||
Eina_List *
|
Eina_List *
|
||||||
disks_get(void)
|
disks_get(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,11 +2,6 @@
|
||||||
#define __DISKS_H__
|
#define __DISKS_H__
|
||||||
|
|
||||||
#include "filesystems.h"
|
#include "filesystems.h"
|
||||||
#include <Eina.h>
|
|
||||||
#include <Ecore.h>
|
|
||||||
|
|
||||||
Eina_Bool
|
|
||||||
disk_zfs_mounted_get(void);
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
disk_mount_point_get(const char *path);
|
disk_mount_point_get(const char *path);
|
||||||
|
|
|
@ -158,3 +158,28 @@ filesystem_info_free(Filesystem_Info *fs)
|
||||||
free(fs);
|
free(fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Eina_Bool
|
||||||
|
filesystem_in_use(const char *name)
|
||||||
|
{
|
||||||
|
Eina_List *disks;
|
||||||
|
char *path;
|
||||||
|
Eina_Bool fs_mounted = EINA_FALSE;
|
||||||
|
if (!name) return EINA_FALSE;
|
||||||
|
|
||||||
|
disks = disks_get();
|
||||||
|
EINA_LIST_FREE(disks, path)
|
||||||
|
{
|
||||||
|
Filesystem_Info *fs = filesystem_info_get(path);
|
||||||
|
if (fs)
|
||||||
|
{
|
||||||
|
if (fs->type == filesystem_id_by_name(name))
|
||||||
|
fs_mounted = EINA_TRUE;
|
||||||
|
|
||||||
|
filesystem_info_free(fs);
|
||||||
|
}
|
||||||
|
free(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return fs_mounted;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef __FILESYSTEMS_H__
|
#ifndef __FILESYSTEMS_H__
|
||||||
#define __FILESYSTEMS_H__
|
#define __FILESYSTEMS_H__
|
||||||
|
|
||||||
|
#include <Eina.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned long long total;
|
unsigned long long total;
|
||||||
unsigned long long used;
|
unsigned long long used;
|
||||||
|
@ -25,4 +27,7 @@ filesystem_info_get(const char *path);
|
||||||
void
|
void
|
||||||
filesystem_info_free(Filesystem_Info *fs);
|
filesystem_info_free(Filesystem_Info *fs);
|
||||||
|
|
||||||
|
Eina_Bool
|
||||||
|
filesystem_in_use(const char *name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1684,7 +1684,8 @@ _ui_init(Evas_Object *parent)
|
||||||
ui->cpu_times = NULL;
|
ui->cpu_times = NULL;
|
||||||
ui->cpu_list = NULL;
|
ui->cpu_list = NULL;
|
||||||
|
|
||||||
ui->zfs_mounted = disk_zfs_mounted_get();
|
// Only take account of the ZFS ARC if there is an active mount.
|
||||||
|
ui->zfs_mounted = filesystem_in_use("ZFS");
|
||||||
|
|
||||||
_ui = NULL;
|
_ui = NULL;
|
||||||
_evisum_config = NULL;
|
_evisum_config = NULL;
|
||||||
|
|
|
@ -96,6 +96,7 @@ ui_tab_disk_update(Ui *ui)
|
||||||
if (!ui->disk_visible)
|
if (!ui->disk_visible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// FIXME
|
||||||
elm_box_clear(ui->disk_activity);
|
elm_box_clear(ui->disk_activity);
|
||||||
|
|
||||||
disks = disks_get();
|
disks = disks_get();
|
||||||
|
@ -104,6 +105,9 @@ ui_tab_disk_update(Ui *ui)
|
||||||
Filesystem_Info *fs = filesystem_info_get(path);
|
Filesystem_Info *fs = filesystem_info_get(path);
|
||||||
if (fs)
|
if (fs)
|
||||||
{
|
{
|
||||||
|
// ZFS usage may have changed during application's lifetime.
|
||||||
|
// Keep track of ZFS mounts else we may report bogus use
|
||||||
|
// of memory.
|
||||||
if (fs->type == filesystem_id_by_name("ZFS"))
|
if (fs->type == filesystem_id_by_name("ZFS"))
|
||||||
zfs_mounted = EINA_TRUE;
|
zfs_mounted = EINA_TRUE;
|
||||||
|
|
||||||
|
@ -115,6 +119,9 @@ ui_tab_disk_update(Ui *ui)
|
||||||
if (disks)
|
if (disks)
|
||||||
eina_list_free(disks);
|
eina_list_free(disks);
|
||||||
|
|
||||||
|
// Need to keep track of ZFS mounts. If we have no mounts
|
||||||
|
// then memory usage should not take into account the ZFS
|
||||||
|
// ARC memory allocation.
|
||||||
if (!zfs_mounted) ui->zfs_mounted = EINA_FALSE;
|
if (!zfs_mounted) ui->zfs_mounted = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue