[PATCH 2/3] bcache-tools: add is_zoned_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux