Lines Matching defs:clone
368 unsigned int zno, struct bio *clone)
385 switch (bio_op(clone)) {
392 if ((clone->bi_iter.bi_sector & (zsectors - 1)) != zwp_offset)
401 clone->bi_opf = REQ_OP_WRITE | REQ_NOMERGE |
402 (clone->bi_opf & (~REQ_OP_MASK));
403 clone->bi_iter.bi_sector += zwp_offset;
420 * data written to a zone. Note that at this point, the remapped clone BIO
429 /* The clone BIO may already have been completed and failed */
464 struct bio *clone)
466 if (WARN_ON_ONCE(bio_flagged(clone, BIO_ZONE_WRITE_LOCKED)))
470 bio_set_flag(clone, BIO_ZONE_WRITE_LOCKED);
474 struct bio *clone)
476 if (!bio_flagged(clone, BIO_ZONE_WRITE_LOCKED))
484 bio_clear_flag(clone, BIO_ZONE_WRITE_LOCKED);
517 struct bio *clone = &tio->clone;
527 if (!dm_need_zone_wp_tracking(clone))
528 return ti->type->map(ti, clone);
531 zno = bio_zone_no(clone);
532 dm_zone_lock(md->disk, zno, clone);
534 orig_bio_details.nr_sectors = bio_sectors(clone);
535 orig_bio_details.op = bio_op(clone);
541 if (!dm_zone_map_bio_begin(md, zno, clone)) {
542 dm_zone_unlock(md->disk, zno, clone);
547 r = ti->type->map(ti, clone);
551 * The target submitted the clone BIO. The target zone will
552 * be unlocked on completion of the clone.
559 * The target only remapped the clone BIO. In case of error,
560 * unlock the target zone here as the clone will not be
566 dm_zone_unlock(md->disk, zno, clone);
571 dm_zone_unlock(md->disk, zno, clone);
585 void dm_zone_endio(struct dm_io *io, struct bio *clone)
602 if (clone->bi_status == BLK_STS_OK &&
603 bio_op(clone) == REQ_OP_ZONE_APPEND) {
608 clone->bi_iter.bi_sector & mask;
615 * For targets that do emulate zone append, if the clone BIO does not
618 if (!bio_flagged(clone, BIO_ZONE_WRITE_LOCKED))
623 if (clone->bi_status != BLK_STS_OK) {
646 dm_zone_unlock(disk, zno, clone);