diff options
author | Coly Li <colyli@suse.de> | 2020-05-16 21:46:29 +0800 |
---|---|---|
committer | Coly Li <colyli@suse.de> | 2020-05-16 21:46:29 +0800 |
commit | 0898a6c8899355b75a13bf490c09e21289d28478 (patch) | |
tree | 3cb8f6bc73c7f370ab62c3ca42c7645d53f42dc7 | |
parent | 5042df018d651677e8a315bbf6b3bc654fdde5f2 (diff) | |
download | bcache-tools-0898a6c8899355b75a13bf490c09e21289d28478.tar.gz |
bcache-tools: add is_zoned_device()
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>
-rw-r--r-- | zoned.c | 5 | ||||
-rw-r--r-- | zoned.h | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -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); +} @@ -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 |