X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-btrfs.c;h=9e6538e7352972f65c5135ec26d1fb7f8e36e241;hb=e0952d9d021234e79f3a70f33a9e5d201872a417;hp=43b445d8312a3e7249cffeae3b9af8c84535040a;hpb=c75f27ea2b483f91d437ebaf8494457dc76f3fd6;p=elogind.git diff --git a/src/test/test-btrfs.c b/src/test/test-btrfs.c index 43b445d83..9e6538e73 100644 --- a/src/test/test-btrfs.c +++ b/src/test/test-btrfs.c @@ -19,7 +19,6 @@ along with systemd; If not, see . ***/ -#include #include #include "log.h" @@ -36,7 +35,8 @@ int main(int argc, char *argv[]) { log_error_errno(errno, "Failed to open root directory: %m"); else { BtrfsSubvolInfo info; - char ts[FORMAT_TIMESTAMP_MAX]; + BtrfsQuotaInfo quota; + char ts[FORMAT_TIMESTAMP_MAX], bs[FORMAT_BYTES_MAX]; r = btrfs_subvol_get_info_fd(fd, &info); if (r < 0) @@ -46,6 +46,16 @@ int main(int argc, char *argv[]) { log_info("read-only (search): %s", yes_no(info.read_only)); } + r = btrfs_subvol_get_quota_fd(fd, "a); + if (r < 0) + log_error_errno(r, "Failed to get quota info: %m"); + else { + log_info("referenced: %s", strna(format_bytes(bs, sizeof(bs), quota.referenced))); + log_info("exclusive: %s", strna(format_bytes(bs, sizeof(bs), quota.exclusive))); + log_info("referenced_max: %s", strna(format_bytes(bs, sizeof(bs), quota.referenced_max))); + log_info("exclusive_max: %s", strna(format_bytes(bs, sizeof(bs), quota.exclusive_max))); + } + r = btrfs_subvol_get_read_only_fd(fd); if (r < 0) log_error_errno(r, "Failed to get read only flag: %m");