6beb01c50d
- update to upstream 3.14.1 - mkfs: - fix TRIM detection - do not zero-out end of device unconditionally - no crash with --features option - fsck: - clear log tree in repair mode - check reloc roots - btrfs - reworked space reporting (bnc#873106) - btrfs fi usage - new command - btrfs dev usage - new command - btrfs fi df - enhanced output with GlobalReserve - Removed patches: * 0001-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch - Added patches: * 0001-Btrfs-progs-fix-check-to-test-trim-support.patch * 0002-Btrfs-progs-fsck-fix-double-free-memory-crash.patch * 0003-Btrfs-progs-mkfs-Remove-zero_end-1-since-it-has-been.patch * 0004-btrfs-progs-fix-wrong-max-system-array-size-check-in.patch * 0005-btrfs-progs-move-arg_strtou64-to-a-separate-file-for.patch * 0006-Btrfs-progs-fsck-clear-out-log-tree-in-repair-mode.patch * 0007-Btrfs-progs-fsck-avoid-pinning-same-block-several-ti.patch * 0008-Btrfs-progs-fsck-add-ability-to-check-reloc-roots.patch * 0009-btrfs-progs-prevent-close_root-if-the-root-to-close-.patch * 0010-btrfs-progs-fix-mkfs.btrfs-segfault-with-features-op.patch * 0011-btrfs-progs-Enhance-the-command-btrfs-filesystem-df.patch * 0012-btrfs-progs-Add-helpers-functions-to-handle-the-prin.patch * 0013-btrfs-progs-Add-command-btrfs-filesystem-disk-usage.patch * 0014-btrfs-progs-Add-btrfs-device-disk-usage-command.patch * 0015-btrfs-progs-cleanup-dead-return-after-usage-for-fi-d.patch * 0016-btrfs-progs-Fix-memleak-in-get_raid56_used.patch * 0017-Btrfs-progs-fi-usage-free-memory-if-realloc-fails.patch * 0018-btrfs-progs-read-global-reserve-size-from-space-info.patch * 0019-btrfs-progs-add-original-df-and-rename-disk_usage-to.patch * 0020-btrfs-progs-move-device-usage-to-cmds-device-more-cl.patch * 0021-btrfs-progs-check-if-we-can-t-get-info-from-ioctls-d.patch * 0022-btrfs-progs-zero-out-structures-before-calling-ioctl.patch * 0023-btrfs-progs-print-B-for-bytes.patch * 0024-btrfs-progs-Print-more-info-about-device-sizes.patch * 0025-btrfs-progs-compare-unallocated-space-against-the-co.patch * 0026-btrfs-progs-add-section-of-overall-filesystem-usage.patch * 0027-btrfs-progs-cleanup-filesystem-device-usage-code.patch * 0028-btrfs-progs-extend-pretty-printers-with-unit-mode.patch * 0029-btrfs-progs-replace-df_pretty_sizes-with-pretty_size.patch * 0030-btrfs-progs-clean-up-return-codes-and-paths.patch * 0031-btrfs-progs-move-global-reserve-to-overall-summary.patch OBS-URL: https://build.opensuse.org/request/show/232435 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=156
61 lines
1.8 KiB
Diff
61 lines
1.8 KiB
Diff
From 28c2061817b8cb266458249cc7bdd770eb2b407b Mon Sep 17 00:00:00 2001
|
|
From: David Sterba <dsterba@suse.cz>
|
|
Date: Thu, 16 Jan 2014 14:18:37 +0100
|
|
Subject: [PATCH 29/42] btrfs-progs: read global reserve size from space infos
|
|
|
|
Kernels >= 3.15 export the global block reserve as a space info presented
|
|
by 'btrfs fi df' but would display 'unknown' instead of some meaningful
|
|
string.
|
|
|
|
Signed-off-by: David Sterba <dsterba@suse.cz>
|
|
---
|
|
ctree.h | 6 ++++++
|
|
utils.c | 7 ++++++-
|
|
2 files changed, 12 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/ctree.h b/ctree.h
|
|
index 8ac17619b9dc..5c43fc5f5f6e 100644
|
|
--- a/ctree.h
|
|
+++ b/ctree.h
|
|
@@ -862,6 +862,12 @@ struct btrfs_csum_item {
|
|
/* used in struct btrfs_balance_args fields */
|
|
#define BTRFS_AVAIL_ALLOC_BIT_SINGLE (1ULL << 48)
|
|
|
|
+/*
|
|
+ * GLOBAL_RSV does not exist as a on-disk block group type and is used
|
|
+ * internally for exporting info about global block reserve from space infos
|
|
+ */
|
|
+#define BTRFS_SPACE_INFO_GLOBAL_RSV (1ULL << 49)
|
|
+
|
|
#define BTRFS_QGROUP_STATUS_OFF 0
|
|
#define BTRFS_QGROUP_STATUS_ON 1
|
|
#define BTRFS_QGROUP_STATUS_SCANNING 2
|
|
diff --git a/utils.c b/utils.c
|
|
index f2ab416c28b2..ca150404ea6f 100644
|
|
--- a/utils.c
|
|
+++ b/utils.c
|
|
@@ -2240,7 +2240,10 @@ u64 get_partition_size(char *dev)
|
|
*/
|
|
const char *group_type_str(u64 flag)
|
|
{
|
|
- switch (flag & BTRFS_BLOCK_GROUP_TYPE_MASK) {
|
|
+ u64 mask = BTRFS_BLOCK_GROUP_TYPE_MASK |
|
|
+ BTRFS_SPACE_INFO_GLOBAL_RSV;
|
|
+
|
|
+ switch (flag & mask) {
|
|
case BTRFS_BLOCK_GROUP_DATA:
|
|
return "Data";
|
|
case BTRFS_BLOCK_GROUP_SYSTEM:
|
|
@@ -2249,6 +2252,8 @@ const char *group_type_str(u64 flag)
|
|
return "Metadata";
|
|
case BTRFS_BLOCK_GROUP_DATA|BTRFS_BLOCK_GROUP_METADATA:
|
|
return "Data+Metadata";
|
|
+ case BTRFS_SPACE_INFO_GLOBAL_RSV:
|
|
+ return "GlobalReserve";
|
|
default:
|
|
return "unknown";
|
|
}
|
|
--
|
|
1.9.0
|
|
|