forked from pool/bcache-tools
Jan Engelhardt
78695432ff
- bcache.h: fix typo from SUUP to SUPP (jsc#SLE-9807) 0019-bcache.h-fix-typo-from-SUUP-to-SUPP.patch - bcache-tools: only call set_bucket_size() for cache device (jsc#SLE-9807) 0020-bcache-tools-only-call-set_bucket_size-for-cache-dev.patch - bcache.h: add BCH_FEATURE_INCOMPAT_LARGE_BUCKET to BCH_FEATURE_INCOMPAT_SUPP (jsc#SLE-9807) 0021-bcache.h-add-BCH_FEATURE_INCOMPAT_LARGE_BUCKET-to-BC.patch - bcache-tools: check incompatible feature set (jsc#SLE-9807) 0022-bcache-tools-check-incompatible-feature-set.patch - bcache-tools: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucket (jsc#SLE-9807) 0023-bcache-tools-introduce-BCH_FEATURE_INCOMPAT_LOG_LARG.patch - bcache-tools: display obsoleted bucket size configuration (jsc#SLE-9807) 0024-bcache-tools-display-obsoleted-bucket-size-configura.patch - bcache-tools: recover the missing sb.csum for showing bcache device super block (jsc#SLE-9807) 0025-bcache-tools-recover-the-missing-sb.csum-for-showing.patch - bcache-tools: only call to_cache_sb() for bcache device in may_add_item() (jsc#SLE-9807) 0026-bcache-tools-only-call-to_cache_sb-for-bcache-device.patch - bcache-tools: improve column alignment for "bcache show -m" output (jsc#SLE-9807) 0027-bcache-tools-improve-column-alignment-for-bcache-sho.patch OBS-URL: https://build.opensuse.org/request/show/860492 OBS-URL: https://build.opensuse.org/package/show/filesystems/bcache-tools?expand=0&rev=31
48 lines
1.5 KiB
Diff
48 lines
1.5 KiB
Diff
From 40cf747541aea3905c328ff351e88cc6ad9a66bf Mon Sep 17 00:00:00 2001
|
|
From: Coly Li <colyli@suse.de>
|
|
Date: Fri, 1 Jan 2021 14:38:27 +0800
|
|
Subject: [PATCH 6/9] bcache-tools: display obsoleted bucket size configuration
|
|
Git-commit: 40cf747541aea3905c328ff351e88cc6ad9a66bf
|
|
References: jsc#SLE-9807
|
|
|
|
Although BCH_FEATURE_INCOMPAT_LARGE_BUCKET is obsoleted and we don't
|
|
support it anymore, we still need to display the obsoleted bucket
|
|
size combines by,
|
|
bucket_size + (obso_bucket_size_hi << 16)
|
|
for the legancy consistency purpose.
|
|
|
|
This patch checks bch_has_feature_obso_large_bucket() in to_cache_sb(),
|
|
if it is true, still try to combine and display the bucket size from
|
|
obso_bucket_size_hi.
|
|
|
|
Signed-off-by: Coly Li <colyli@suse.de>
|
|
|
|
---
|
|
lib.c | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/lib.c b/lib.c
|
|
index 8e7da8b..b005eb5 100644
|
|
--- a/lib.c
|
|
+++ b/lib.c
|
|
@@ -783,9 +783,13 @@ struct cache_sb *to_cache_sb(struct cache_sb *sb,
|
|
sb->feature_ro_compat = le64_to_cpu(sb_disk->feature_ro_compat);
|
|
}
|
|
|
|
- if (sb->version >= BCACHE_SB_VERSION_CDEV_WITH_FEATURES &&
|
|
- bch_has_feature_large_bucket(sb))
|
|
- sb->bucket_size = 1 << le16_to_cpu(sb_disk->bucket_size);
|
|
+ if (sb->version >= BCACHE_SB_VERSION_CDEV_WITH_FEATURES) {
|
|
+ if (bch_has_feature_large_bucket(sb))
|
|
+ sb->bucket_size = 1 << le16_to_cpu(sb_disk->bucket_size);
|
|
+ else if (bch_has_feature_obso_large_bucket(sb))
|
|
+ sb->bucket_size +=
|
|
+ le16_to_cpu(sb_disk->obso_bucket_size_hi) << 16;
|
|
+ }
|
|
|
|
return sb;
|
|
}
|
|
--
|
|
2.26.2
|
|
|