if (err)
return err;
+ /* the flags are inverted vs the values in the sysfs files */
if (val)
- bi->flags |= flag;
- else
bi->flags &= ~flag;
+ else
+ bi->flags |= flag;
return count;
}
{
struct blk_integrity *bi = dev_to_bi(dev);
- return sysfs_emit(page, "%d\n", !!(bi->flags & flag));
+ return sysfs_emit(page, "%d\n", !(bi->flags & flag));
}
static ssize_t format_show(struct device *dev, struct device_attribute *attr,
struct device_attribute *attr,
const char *page, size_t count)
{
- return flag_store(dev, attr, page, count, BLK_INTEGRITY_VERIFY);
+ return flag_store(dev, attr, page, count, BLK_INTEGRITY_NOVERIFY);
}
static ssize_t read_verify_show(struct device *dev,
struct device_attribute *attr, char *page)
{
- return flag_show(dev, attr, page, BLK_INTEGRITY_VERIFY);
+ return flag_show(dev, attr, page, BLK_INTEGRITY_NOVERIFY);
}
static ssize_t write_generate_store(struct device *dev,
struct device_attribute *attr,
const char *page, size_t count)
{
- return flag_store(dev, attr, page, count, BLK_INTEGRITY_GENERATE);
+ return flag_store(dev, attr, page, count, BLK_INTEGRITY_NOGENERATE);
}
static ssize_t write_generate_show(struct device *dev,
struct device_attribute *attr, char *page)
{
- return flag_show(dev, attr, page, BLK_INTEGRITY_GENERATE);
+ return flag_show(dev, attr, page, BLK_INTEGRITY_NOGENERATE);
}
static ssize_t device_is_integrity_capable_show(struct device *dev,
struct blk_integrity *bi = &disk->queue->integrity;
bi->csum_type = template->csum_type;
- bi->flags = BLK_INTEGRITY_VERIFY | BLK_INTEGRITY_GENERATE |
- template->flags;
+ bi->flags = template->flags;
bi->interval_exp = template->interval_exp ? :
ilog2(queue_logical_block_size(disk->queue));
bi->tuple_size = template->tuple_size;