diff options
author | Matthew Macy <[email protected]> | 2020-09-23 16:43:51 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-23 16:43:51 -0700 |
commit | 7b8363d7f0ca85a2dde7473d6079147387f2f1fc (patch) | |
tree | 9a2c7e3cc8822be6b150e7de3c068e5d9e6793ae /module/zfs | |
parent | 3dad29fb4b085a159d26e2322dc07b46950ff72e (diff) |
FreeBSD: Add support for procfs_list
The procfs_list interface is required by several kstats. Implement
this functionality for FreeBSD to provide access to these kstats.
Reviewed-by: Allan Jude <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #10890
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/spa_misc.c | 1 | ||||
-rw-r--r-- | module/zfs/spa_stats.c | 26 |
2 files changed, 7 insertions, 20 deletions
diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c index 41f0ddbde..042104728 100644 --- a/module/zfs/spa_misc.c +++ b/module/zfs/spa_misc.c @@ -2169,6 +2169,7 @@ spa_import_progress_init(void) spa_import_progress_list; procfs_list_install("zfs", + NULL, "import_progress", 0644, &spa_import_progress_list->procfs_list, diff --git a/module/zfs/spa_stats.c b/module/zfs/spa_stats.c index cf0be3c45..c3eacc142 100644 --- a/module/zfs/spa_stats.c +++ b/module/zfs/spa_stats.c @@ -122,14 +122,11 @@ static void spa_read_history_init(spa_t *spa) { spa_history_list_t *shl = &spa->spa_stats.read_history; - char *module; shl->size = 0; - - module = kmem_asprintf("zfs/%s", spa_name(spa)); - shl->procfs_list.pl_private = shl; - procfs_list_install(module, + procfs_list_install("zfs", + spa_name(spa), "reads", 0600, &shl->procfs_list, @@ -137,8 +134,6 @@ spa_read_history_init(spa_t *spa) spa_read_history_show_header, spa_read_history_clear, offsetof(spa_read_history_t, srh_node)); - - kmem_strfree(module); } static void @@ -293,14 +288,11 @@ static void spa_txg_history_init(spa_t *spa) { spa_history_list_t *shl = &spa->spa_stats.txg_history; - char *module; shl->size = 0; - - module = kmem_asprintf("zfs/%s", spa_name(spa)); - shl->procfs_list.pl_private = shl; - procfs_list_install(module, + procfs_list_install("zfs", + spa_name(spa), "txgs", 0644, &shl->procfs_list, @@ -308,8 +300,6 @@ spa_txg_history_init(spa_t *spa) spa_txg_history_show_header, spa_txg_history_clear, offsetof(spa_txg_history_t, sth_node)); - - kmem_strfree(module); } static void @@ -699,14 +689,12 @@ static void spa_mmp_history_init(spa_t *spa) { spa_history_list_t *shl = &spa->spa_stats.mmp_history; - char *module; shl->size = 0; - module = kmem_asprintf("zfs/%s", spa_name(spa)); - shl->procfs_list.pl_private = shl; - procfs_list_install(module, + procfs_list_install("zfs", + spa_name(spa), "multihost", 0644, &shl->procfs_list, @@ -714,8 +702,6 @@ spa_mmp_history_init(spa_t *spa) spa_mmp_history_show_header, spa_mmp_history_clear, offsetof(spa_mmp_history_t, smh_node)); - - kmem_strfree(module); } static void |