-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs-progs: fix btrfs-progs not provide blk_zone
- Loading branch information
1 parent
00972ca
commit faa4a71
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
utils/btrfs-progs/patches/0001-improve-autodetection-of-zoned-mode.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
From a065c28f8d6c5785d9c3730cb62078b8dbb4dc91 Mon Sep 17 00:00:00 2001 | ||
From: W_Y_CPP <383152993@qq.com> | ||
Date: Tue, 15 Feb 2022 22:40:18 -0500 | ||
Subject: [PATCH] improve autodetection of zoned mode | ||
|
||
--- | ||
configure.ac | 26 ++++++++++++++++++++++++-- | ||
1 file changed, 24 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 26d8510..2b16249 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -282,10 +282,32 @@ AC_CHECK_HEADER(linux/blkzoned.h, [blkzoned_found=yes], [blkzoned_found=no]) | ||
AC_CHECK_MEMBER([struct blk_zone.capacity], [blkzoned_capacity=yes], [blkzoned_capacity=no], [[#include <linux/blkzoned.h>]]) | ||
AX_CHECK_DEFINE([linux/blkzoned.h], [BLKGETZONESZ], [blkzoned_getzonesz=yes], [blkzoned_getzonesz=no]) | ||
AC_ARG_ENABLE([zoned], | ||
- AS_HELP_STRING([--disable-zoned], [disable zoned block device support]), | ||
- [], [enable_zoned=$blkzoned_found] | ||
+ AS_HELP_STRING([--disable-zoned], [disable zoned block device support (default: detect)]), | ||
+ [], [enable_zoned=$blkzoned_capacity] | ||
) | ||
|
||
+# Autodetect zoned support | ||
+AS_IF([test "x$enableval" = "x"], [ | ||
+ cansupportzoned=yes | ||
+ if test "x$blkzoned_found" = xno; then | ||
+ cansupportzoned=no | ||
+ fi | ||
+ if test "x$blkzoned_capacity" = xno; then | ||
+ cansupportzoned=no | ||
+ fi | ||
+ if test "x$blkzoned_getzonesz" = xno; then | ||
+ cansupportzoned=no | ||
+ fi | ||
+ if test "x$cansupportzoned" = xno; then | ||
+ AC_MSG_NOTICE([insufficient support for zoned mode, cannot enable]) | ||
+ enable_zoned=no | ||
+ else | ||
+ enable_zoned=yes | ||
+ fi | ||
+]) | ||
+ | ||
+# Explicitly requested by --enable-zoned | ||
+ | ||
AS_IF([test "x$enable_zoned" = xyes], [ | ||
if test "x$blkzoned_found" = xno; then | ||
AC_MSG_ERROR([Couldn't find linux/blkzoned.h]) | ||
-- | ||
2.17.1 | ||
|
14 changes: 14 additions & 0 deletions
14
utils/btrfs-progs/patches/0002-btrfs-progs-v5.16.1-add-missing-definition.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- btrfs-progs-v5.16.1/kernel-shared/zoned.h.orig 2022-02-06 11:09:39.728318915 +0000 | ||
+++ btrfs-progs-v5.16.1/kernel-shared/zoned.h 2022-02-06 11:11:21.772323202 +0000 | ||
@@ -145,6 +145,11 @@ static inline int btrfs_reset_dev_zone(i | ||
return 0; | ||
} | ||
|
||
+static inline bool zoned_profile_supported(u64 flags) | ||
+{ | ||
+ return false; | ||
+} | ||
+ | ||
static inline bool zone_is_sequential(struct btrfs_zoned_device_info *zinfo, | ||
u64 bytenr) | ||
{ |