Signed-off-by: Karel Zak <kzak@redhat.com>
static int probe_ioctl_tp(blkid_probe pr, const struct blkid_idmag *mag)
{
int i;
- int count = 0;
for (i = 0; i < ARRAY_SIZE(topology_vals); i++) {
struct topology_val *val = &topology_vals[i];
rc = val->set_ulong(pr, (unsigned long) data);
if (rc)
goto err;
- count++;
}
- if (count)
- return 0;
+ return 0;
nothing:
return 1;
err:
if (blkid_devno_get_u64_attribute(attr_dev,
val->attr, &data))
continue;
- if (!data)
- continue;
rc = val->set_ulong(pr, (unsigned long) data);
} else if (val->set_int) {
if (blkid_devno_get_s64_attribute(attr_dev,
val->attr, &data))
continue;
- if (!data)
- continue;
rc = val->set_int(pr, (int) data);
}
* @ALIGNMENT_OFFSET: indicates how many bytes the beginning o the device is
* offset from the disk's natural alignment.
*
+ * The NAME=value tags are not defined when the corresponding topology value
+ * is zero. The MINIMUM_IO_SIZE should be always defined if kernel provides
+ * topology information.
+ *
* Binary interface:
*
* blkid_probe_get_tolology()
if (!chn)
return -1;
+ if (!data)
+ return 0; /* ignore zeros */
if (chn->binary) {
unsigned long *v =