From: David Disseldorp <ddiss@suse.de>
To: fstests@vger.kernel.org
Cc: Qu Wenruo <wqu@suse.com>, David Disseldorp <ddiss@suse.de>
Subject: [PATCH 1/5] common/dmdelay: remove DELAY_X enums
Date: Thu, 7 Dec 2023 18:20:52 +1100 [thread overview]
Message-ID: <20231207072056.14588-2-ddiss@suse.de> (raw)
In-Reply-To: <20231207072056.14588-1-ddiss@suse.de>
The DELAY_NONE and DELAY_READ enums map directly to DELAY_TABLE globals,
so remove the indirection and use the DELAY_TABLE variables instead.
Rename DELAY_TABLE to DELAY_TABLE_NODELAY to better reflect that the
table doesn't specify any IO delays.
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
common/dmdelay | 13 ++++---------
tests/xfs/311 | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/common/dmdelay b/common/dmdelay
index 66cac1a7..e85d8d62 100644
--- a/common/dmdelay
+++ b/common/dmdelay
@@ -4,16 +4,13 @@
#
# common functions for setting up and tearing down a dmdelay device
-DELAY_NONE=0
-DELAY_READ=1
-
_init_delay()
{
local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
DELAY_DEV=/dev/mapper/delay-test
- DELAY_TABLE="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 0"
+ DELAY_TABLE_NODELAY="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 0"
DELAY_TABLE_RDELAY="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 10000 $SCRATCH_DEV 0 0"
- _dmsetup_create delay-test --table "$DELAY_TABLE" || \
+ _dmsetup_create delay-test --table "$DELAY_TABLE_NODELAY" || \
_fatal "failed to create delay device"
}
@@ -44,10 +41,8 @@ _cleanup_delay()
# table
_load_delay_table()
{
- table="$DELAY_TABLE"
- [ $1 -eq $DELAY_READ ] && table="$DELAY_TABLE_RDELAY"
-
- suspend_opt="--nolockfs"
+ local table="$1"
+ local suspend_opt="--nolockfs"
[ $# -gt 1 ] && [ $2 -eq 1 ] && suspend_opt=""
# run a suspend/resume cycle to avoid excessive resume delays once a
diff --git a/tests/xfs/311 b/tests/xfs/311
index d5e3afbf..04161750 100755
--- a/tests/xfs/311
+++ b/tests/xfs/311
@@ -50,7 +50,7 @@ _unmount_delay
_mount_delay
# introduce a read I/O delay
-_load_delay_table $DELAY_READ
+_load_delay_table "$DELAY_TABLE_RDELAY"
# Map the directory and immediately unmount. This should invoke an asynchronous
# readahead on the first block of the directory. The readahead is delayed by
--
2.35.3
next prev parent reply other threads:[~2023-12-07 7:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 7:20 [PATCH 0/5] btrfs/282: resolve intermittent failures David Disseldorp
2023-12-07 7:20 ` David Disseldorp [this message]
2023-12-07 7:20 ` [PATCH 2/5] btrfs/282: append scrub status output to 282.full David Disseldorp
2023-12-07 9:46 ` Qu Wenruo
2023-12-07 7:20 ` [PATCH 3/5] btrfs/282: dmdelay scrub I/O to fix intermittent failures David Disseldorp
2023-12-07 7:20 ` [PATCH 4/5] btrfs/282: reduce scrub dataset size David Disseldorp
2023-12-07 7:20 ` [PATCH 5/5] btrfs/282: increase throttled scrub rate tolerance David Disseldorp
2023-12-07 9:49 ` [PATCH 0/5] btrfs/282: resolve intermittent failures Qu Wenruo
2023-12-07 13:49 ` David Disseldorp
2023-12-07 20:02 ` Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231207072056.14588-2-ddiss@suse.de \
--to=ddiss@suse.de \
--cc=fstests@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox