Lines Matching full:clone

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