All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: fio@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Vincent Fu <vincentfu@gmail.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
	Dmitry Fomichev <Dmitry.Fomichev@wdc.com>,
	Niklas Cassel <niklas.cassel@wdc.com>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: [PATCH v2 05/13] t/zbd: add close_zone helper function
Date: Wed, 19 Jul 2023 19:57:48 +0900	[thread overview]
Message-ID: <20230719105756.553146-6-shinichiro.kawasaki@wdc.com> (raw)
In-Reply-To: <20230719105756.553146-1-shinichiro.kawasaki@wdc.com>

Add a helper function which sets the specified zone in closed condition.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 t/zbd/functions | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/t/zbd/functions b/t/zbd/functions
index 9a6d6999..fe5b3397 100644
--- a/t/zbd/functions
+++ b/t/zbd/functions
@@ -4,6 +4,7 @@ blkzone=$(type -p blkzone 2>/dev/null)
 sg_inq=$(type -p sg_inq 2>/dev/null)
 zbc_report_zones=$(type -p zbc_report_zones 2>/dev/null)
 zbc_reset_zone=$(type -p zbc_reset_zone 2>/dev/null)
+zbc_close_zone=$(type -p zbc_close_zone 2>/dev/null)
 zbc_info=$(type -p zbc_info 2>/dev/null)
 if [ -z "${blkzone}" ] &&
        { [ -z "${zbc_report_zones}" ] || [ -z "${zbc_reset_zone}" ]; }; then
@@ -304,6 +305,18 @@ reset_zone() {
     fi
 }
 
+# Close the zone on device $1 at offset $2. The offset must be specified in
+# units of 512 byte sectors.
+close_zone() {
+	local dev=$1 offset=$2
+
+	if [ -n "${blkzone}" ] && [ -z "${use_libzbc}" ]; then
+		${blkzone} close -o "${offset}" -c 1 "$dev"
+	else
+		${zbc_close_zone} -sector "$dev" "${offset}" >/dev/null
+	fi
+}
+
 # Extract the number of bytes that have been transferred from a line like
 # READ: bw=6847KiB/s (7011kB/s), 6847KiB/s-6847KiB/s (7011kB/s-7011kB/s), io=257MiB (269MB), run=38406-38406msec
 fio_io() {
-- 
2.40.1


  parent reply	other threads:[~2023-07-19 10:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 10:57 [PATCH v2 00/13] zbd: improve max_active_zones limit handling Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 01/13] zbd: get max_active_zones limit value from zoned devices Shin'ichiro Kawasaki
2023-07-19 11:08   ` Niklas Cassel
2023-07-19 10:57 ` [PATCH v2 02/13] zbd: write to closed zones on the devices with max_active_zones limit Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 03/13] zbd: print max_active_zones limit error message Shin'ichiro Kawasaki
2023-07-19 11:09   ` Niklas Cassel
2023-07-19 10:57 ` [PATCH v2 04/13] docs: modify max_open_zones option description Shin'ichiro Kawasaki
2023-07-19 10:57 ` Shin'ichiro Kawasaki [this message]
2023-07-19 10:57 ` [PATCH v2 06/13] t/zbd: add max_active_zone variable Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 07/13] t/zbd: add test case to check zones in closed condition Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 08/13] t/zbd: add test case to check max_active_zones limit error message Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 09/13] t/zbd: get max_open_zones from sysfs Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 10/13] t/zbd: fix fio failure check and SG node failure in test case 31 Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 11/13] t/zbd: add missing prep_write for test cases with write workloads Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 12/13] t/zbd: fix null_blk configuration in run-tests-against-nullb Shin'ichiro Kawasaki
2023-07-19 10:57 ` [PATCH v2 13/13] t/zbd: add max_active configs to run-tests-against-nullb Shin'ichiro Kawasaki
2023-07-20 14:50 ` [PATCH v2 00/13] zbd: improve max_active_zones limit handling Vincent Fu

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=20230719105756.553146-6-shinichiro.kawasaki@wdc.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=Dmitry.Fomichev@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=fio@vger.kernel.org \
    --cc=niklas.cassel@wdc.com \
    --cc=vincentfu@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.