All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: linux-bcache@vger.kernel.org
Cc: linux-block@vger.kernel.org, Coly Li <colyli@suse.de>
Subject: [PATCH 2/3] bcache-tools: add is_zoned_device()
Date: Sat, 16 May 2020 22:09:39 +0800	[thread overview]
Message-ID: <20200516140940.101190-3-colyli@suse.de> (raw)
In-Reply-To: <20200516140940.101190-1-colyli@suse.de>

This is a wrapper of get_zone_size(), to check whether a device is
zoned device or not by checking its chunk_sectors.

Signed-off-by: Coly Li <colyli@suse.de>
---
 zoned.c | 5 +++++
 zoned.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/zoned.c b/zoned.c
index 31c9136..d078286 100644
--- a/zoned.c
+++ b/zoned.c
@@ -87,3 +87,8 @@ void check_data_offset_for_zoned_device(char *devname,
 
 	*data_offset = _data_offset;
 }
+
+int is_zoned_device(char *devname)
+{
+	return (get_zone_size(devname) != 0);
+}
diff --git a/zoned.h b/zoned.h
index 1c5cce8..25e5c91 100644
--- a/zoned.h
+++ b/zoned.h
@@ -9,5 +9,6 @@
 #define __ZONED_H
 
 void check_data_offset_for_zoned_device(char *devname, uint64_t *data_offset);
+int is_zoned_device(char *devname);
 
 #endif
-- 
2.25.0


  parent reply	other threads:[~2020-05-16 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 14:09 [PATCH 0/3] bcache-tools: suport zoned device as making backing evice Coly Li
2020-05-16 14:09 ` [PATCH 1/3] bcache-tools: set zoned size aligned data_offset on backing device for zoned devive Coly Li
2020-05-16 14:09 ` Coly Li [this message]
2020-05-16 14:09 ` [PATCH 3/3] bcache-tools: convert writeback to writethrough mode for zoned backing device Coly Li

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=20200516140940.101190-3-colyli@suse.de \
    --to=colyli@suse.de \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    /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.