btrfs-progs/common
David Sterba 6ecaa3ee4f btrfs-progs: qgroup show: add json output
Support json for 'qgroup show' with values printed by "btrfs qgroup
-pcre", the accounted size and the limits.  It's implemented as a
separate call and not sharing the printing routines so any visible
changes need to by synchronized.

Formatter updates: don't print key name if .out_json is NULL.

Example output:

 # btrfs --format json qgroup show /mnt/path
{
  "__header": {
    "version": "1"
  },
  "qgroup-show": [
    {
      "qgroupid": "0/5",
      "referenced": "8831393792",
      "max_referenced": "none",
      "exclusive": "8224075776",
      "max_exclusive": "none",
      "path": "",
      "parents": [
      ],
      "children": [
      ]
    },
    {
      "qgroupid": "0/361",
      "referenced": "611459072",
      "max_referenced": "none",
      "exclusive": "65536",
      "max_exclusive": "none",
      "path": "subv1",
      "parents": [
        "1/1"
      ],
      "children": [
      ]
    },
    {
      "qgroupid": "0/362",
      "referenced": "611459072",
      "max_referenced": "none",
      "exclusive": "65536",
      "max_exclusive": "none",
      "path": "snap1-r",
      "parents": [
      ],
      "children": [
      ]
    },
    {
      "qgroupid": "1/1",
      "referenced": "611459072",
      "max_referenced": "none",
      "exclusive": "65536",
      "max_exclusive": "none",
      "path": "",
      "parents": [
      ],
      "children": [
        "0/361"
      ]
    }
  ]
}

Issue: #555
Signed-off-by: David Sterba <dsterba@suse.com>
2022-12-14 23:42:03 +01:00
..
box.h btrfs-progs: build most common tools into one binary (busybox style) 2019-07-04 15:30:40 +02:00
defs.h btrfs-progs: move common-defs to common/ 2020-03-31 18:37:35 +02:00
device-scan.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
device-scan.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
device-utils.c btrfs-progs: device-utils: rename btrfs_device_size 2022-10-11 09:08:10 +02:00
device-utils.h btrfs-progs: device-utils: rename btrfs_device_size 2022-10-11 09:08:10 +02:00
extent-cache.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
extent-cache.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
filesystem-utils.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
filesystem-utils.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
format-output.c btrfs-progs: qgroup show: add json output 2022-12-14 23:42:03 +01:00
format-output.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
fsfeatures.c btrfs-progs: mkfs: fix compat version of block-group-tree 2022-10-17 15:46:37 +02:00
fsfeatures.h btrfs-progs: mkfs: fix a stack over-flow when features string are too long 2022-10-11 09:08:12 +02:00
help.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
help.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
internal.h btrfs-progs: move internal.h to common/ 2019-07-03 20:49:03 +02:00
messages.c btrfs-progs: add helper to print messages to stderr 2022-10-11 09:08:11 +02:00
messages.h btrfs-progs: add helper to print messages to stderr 2022-10-11 09:08:11 +02:00
open-utils.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
open-utils.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
parse-utils.c btrfs-progs: sync compression.h from the kernel 2022-11-30 19:14:29 +01:00
parse-utils.h btrfs-progs: move parse_qgroupid_or_path to parse-utils 2022-10-11 09:06:13 +02:00
path-utils.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
path-utils.h btrfs-progs: remove unnecessary linux/*.h includes 2021-05-06 16:41:47 +02:00
rbtree-utils.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
rbtree-utils.h btrfs-progs: remove c++ protection from internal headers 2021-10-08 20:47:04 +02:00
send-stream.c btrfs-progs: receive: fix parsing of attributes field from the fileattr command 2022-11-24 17:29:11 +01:00
send-stream.h btrfs-progs: receive: add support for fs-verity 2022-10-11 09:08:08 +02:00
send-utils.c btrfs-progs: use error helper for messages in non-kernel code 2022-10-11 09:08:07 +02:00
send-utils.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
string-table.c btrfs-progs: string-table: add ranged API for printing and clearing 2022-12-05 20:32:02 +01:00
string-table.h btrfs-progs: string-table: add ranged API for printing and clearing 2022-12-05 20:32:02 +01:00
string-utils.c btrfs-progs: use error helper for messages in non-kernel code 2022-10-11 09:08:07 +02:00
string-utils.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
task-utils.c btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
task-utils.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
units.c btrfs-progs: use our ASSERT macro everywhere 2022-10-11 09:08:10 +02:00
units.h btrfs-progs: common: update include lists, part 1 2022-10-11 09:08:07 +02:00
utils.c btrfs-progs: add warning helper for experimental build 2022-10-20 16:29:13 +02:00
utils.h btrfs-progs: ioctl: move btrfs_err_str into common/utils.h 2022-11-28 18:57:43 +01:00