/* Complete the clone and the original request. Must be called without queue lock.  */
static void dm_end_request(struct request *clone, int error)
/* Complete the clone and the original request. Must be called without queue lock.  */
static void dm_end_request(struct request *clone, int error)
{
	int rw = rq_data_dir(clone);
	int run_queue = 1;
	bool is_barrier = blk_barrier_rq(clone);
	struct dm_rq_target_io *tio = clone->end_io_data;
	struct mapped_device *md = tio->md;
	struct request *rq = tio->orig;
	if (blk_pc_request(rq) && !is_barrier) {
		rq->errors = clone->errors;
		rq->resid_len = clone->resid_len;
		if (rq->sense)
			rq->sense_len = clone->sense_len;
	}
	free_rq_clone(clone);
	if (unlikely(is_barrier)) {
		if (unlikely(error))
			store_barrier_error(md, error);
		run_queue = 0;
	} else
		blk_end_request_all(rq, error);
	rq_completed(md, rw, run_queue);
}