| .. | .. |
|---|
| 280 | 280 | struct flakey_c *fc = ti->private; |
|---|
| 281 | 281 | |
|---|
| 282 | 282 | bio_set_dev(bio, fc->dev->bdev); |
|---|
| 283 | | - if (bio_sectors(bio) || bio_op(bio) == REQ_OP_ZONE_RESET) |
|---|
| 283 | + if (bio_sectors(bio) || op_is_zone_mgmt(bio_op(bio))) |
|---|
| 284 | 284 | bio->bi_iter.bi_sector = |
|---|
| 285 | 285 | flakey_map_sector(ti, bio->bi_iter.bi_sector); |
|---|
| 286 | 286 | } |
|---|
| .. | .. |
|---|
| 322 | 322 | struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data)); |
|---|
| 323 | 323 | pb->bio_submitted = false; |
|---|
| 324 | 324 | |
|---|
| 325 | | - /* Do not fail reset zone */ |
|---|
| 326 | | - if (bio_op(bio) == REQ_OP_ZONE_RESET) |
|---|
| 327 | | - goto map_bio; |
|---|
| 328 | | - |
|---|
| 329 | | - /* We need to remap reported zones, so remember the BIO iter */ |
|---|
| 330 | | - if (bio_op(bio) == REQ_OP_ZONE_REPORT) |
|---|
| 325 | + if (op_is_zone_mgmt(bio_op(bio))) |
|---|
| 331 | 326 | goto map_bio; |
|---|
| 332 | 327 | |
|---|
| 333 | 328 | /* Are we alive ? */ |
|---|
| .. | .. |
|---|
| 388 | 383 | struct flakey_c *fc = ti->private; |
|---|
| 389 | 384 | struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data)); |
|---|
| 390 | 385 | |
|---|
| 391 | | - if (bio_op(bio) == REQ_OP_ZONE_RESET) |
|---|
| 386 | + if (op_is_zone_mgmt(bio_op(bio))) |
|---|
| 392 | 387 | return DM_ENDIO_DONE; |
|---|
| 393 | | - |
|---|
| 394 | | - if (bio_op(bio) == REQ_OP_ZONE_REPORT) { |
|---|
| 395 | | - dm_remap_zone_report(ti, bio, fc->start); |
|---|
| 396 | | - return DM_ENDIO_DONE; |
|---|
| 397 | | - } |
|---|
| 398 | 388 | |
|---|
| 399 | 389 | if (!*error && pb->bio_submitted && (bio_data_dir(bio) == READ)) { |
|---|
| 400 | 390 | if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) && |
|---|
| .. | .. |
|---|
| 468 | 458 | return 0; |
|---|
| 469 | 459 | } |
|---|
| 470 | 460 | |
|---|
| 461 | +#ifdef CONFIG_BLK_DEV_ZONED |
|---|
| 462 | +static int flakey_report_zones(struct dm_target *ti, |
|---|
| 463 | + struct dm_report_zones_args *args, unsigned int nr_zones) |
|---|
| 464 | +{ |
|---|
| 465 | + struct flakey_c *fc = ti->private; |
|---|
| 466 | + sector_t sector = flakey_map_sector(ti, args->next_sector); |
|---|
| 467 | + |
|---|
| 468 | + args->start = fc->start; |
|---|
| 469 | + return blkdev_report_zones(fc->dev->bdev, sector, nr_zones, |
|---|
| 470 | + dm_report_zones_cb, args); |
|---|
| 471 | +} |
|---|
| 472 | +#endif |
|---|
| 473 | + |
|---|
| 471 | 474 | static int flakey_iterate_devices(struct dm_target *ti, iterate_devices_callout_fn fn, void *data) |
|---|
| 472 | 475 | { |
|---|
| 473 | 476 | struct flakey_c *fc = ti->private; |
|---|
| .. | .. |
|---|
| 479 | 482 | .name = "flakey", |
|---|
| 480 | 483 | .version = {1, 5, 0}, |
|---|
| 481 | 484 | #ifdef CONFIG_BLK_DEV_ZONED |
|---|
| 482 | | - .features = DM_TARGET_ZONED_HM, |
|---|
| 485 | + .features = DM_TARGET_ZONED_HM | DM_TARGET_PASSES_CRYPTO, |
|---|
| 486 | + .report_zones = flakey_report_zones, |
|---|
| 487 | +#else |
|---|
| 488 | + .features = DM_TARGET_PASSES_CRYPTO, |
|---|
| 483 | 489 | #endif |
|---|
| 484 | 490 | .module = THIS_MODULE, |
|---|
| 485 | 491 | .ctr = flakey_ctr, |
|---|