struct libzbc_data **p_ld)
{
struct libzbc_data *ld = td->io_ops_data;
- int ret, flags = OS_O_DIRECT;
+ int ret, flags = OS_O_DIRECT;
if (ld) {
/* Already open */
return -EINVAL;
}
- if (td_write(td)) {
+ if (td_write(td)) {
if (!read_only)
flags |= O_RDWR;
} else if (td_read(td)) {
flags |= O_RDONLY;
} else if (td_trim(td)) {
td_verror(td, EINVAL, "libzbc does not support trim");
- log_err("%s: libzbc does not support trim\n",
- f->file_name);
- return -EINVAL;
+ log_err("%s: libzbc does not support trim\n", f->file_name);
+ return -EINVAL;
}
- if (td->o.oatomic) {
+ if (td->o.oatomic) {
td_verror(td, EINVAL, "libzbc does not support O_ATOMIC");
- log_err("%s: libzbc does not support O_ATOMIC\n",
- f->file_name);
- return -EINVAL;
- }
+ log_err("%s: libzbc does not support O_ATOMIC\n", f->file_name);
+ return -EINVAL;
+ }
ld = calloc(1, sizeof(*ld));
if (!ld)
zbdz->start = zones[i].zbz_start << 9;
zbdz->len = zones[i].zbz_length << 9;
zbdz->wp = zones[i].zbz_write_pointer << 9;
+ /*
+ * ZBC/ZAC do not define zone capacity, so use the zone size as
+ * the zone capacity.
+ */
+ zbdz->capacity = zbdz->len;
switch (zones[i].zbz_type) {
case ZBC_ZT_CONVENTIONAL:
return FIO_Q_COMPLETED;
}
-static struct ioengine_ops ioengine = {
+FIO_STATIC struct ioengine_ops ioengine = {
.name = "libzbc",
.version = FIO_IOOPS_VERSION,
.open_file = libzbc_open_file,