json_stats.c: Rename the stats file to "status.json"

This commit is contained in:
Mateusz Piotrowski 2023-05-10 18:06:16 +02:00 committed by Geoff Amey
parent 2724bcb3d6
commit 3828f754f1
1 changed files with 2 additions and 2 deletions

View File

@ -351,7 +351,7 @@ static int json_data(char *buf, size_t size, void *data) {
jp_open(&jp, buf, size);
jp_printf(&jp, "{");
jp_printf(&jp, "stats_version: %d", 1);
jp_printf(&jp, "status_json_version: %d", 1);
jp_printf(&jp, "scan_error: %d", ps_error);
if (ps_error == 0) {
jp_printf(&jp, "scan_stats: {");
@ -454,7 +454,7 @@ void json_stats_init(spa_t *spa)
mutex_init(&shk->lock, NULL, MUTEX_DEFAULT, NULL);
name = kmem_asprintf("zfs/%s", spa_name(spa));
ksp = kstat_create(name, 0, "stats", "misc",
ksp = kstat_create(name, 0, "status.json", "misc",
KSTAT_TYPE_RAW, 0, KSTAT_FLAG_VIRTUAL);
shk->kstat = ksp;
if (ksp) {