Commit 2d9e28a9 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

pktcdvd: remove the if 0'ed pkt_start_recovery function



Remove code which has been dead since the initial commit.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 47816282
Loading
Loading
Loading
Loading
+2 −65
Original line number Diff line number Diff line
@@ -1082,65 +1082,6 @@ static void pkt_put_packet_data(struct pktcdvd_device *pd, struct packet_data *p
	}
}

/*
 * recover a failed write, query for relocation if possible
 *
 * returns 1 if recovery is possible, or 0 if not
 *
 */
static int pkt_start_recovery(struct packet_data *pkt)
{
	/*
	 * FIXME. We need help from the file system to implement
	 * recovery handling.
	 */
	return 0;
#if 0
	struct request *rq = pkt->rq;
	struct pktcdvd_device *pd = rq->rq_disk->private_data;
	struct block_device *pkt_bdev;
	struct super_block *sb = NULL;
	unsigned long old_block, new_block;
	sector_t new_sector;

	pkt_bdev = bdget(kdev_t_to_nr(pd->pkt_dev));
	if (pkt_bdev) {
		sb = get_super(pkt_bdev);
		bdput(pkt_bdev);
	}

	if (!sb)
		return 0;

	if (!sb->s_op->relocate_blocks)
		goto out;

	old_block = pkt->sector / (CD_FRAMESIZE >> 9);
	if (sb->s_op->relocate_blocks(sb, old_block, &new_block))
		goto out;

	new_sector = new_block * (CD_FRAMESIZE >> 9);
	pkt->sector = new_sector;

	bio_reset(pkt->bio);
	bio_set_dev(pkt->bio, pd->bdev);
	bio_set_op_attrs(pkt->bio, REQ_OP_WRITE, 0);
	pkt->bio->bi_iter.bi_sector = new_sector;
	pkt->bio->bi_iter.bi_size = pkt->frames * CD_FRAMESIZE;
	pkt->bio->bi_vcnt = pkt->frames;

	pkt->bio->bi_end_io = pkt_end_io_packet_write;
	pkt->bio->bi_private = pkt;

	drop_super(sb);
	return 1;

out:
	drop_super(sb);
	return 0;
#endif
}

static inline void pkt_set_state(struct packet_data *pkt, enum packet_data_state state)
{
#if PACKET_DEBUG > 1
@@ -1357,12 +1298,8 @@ static void pkt_run_state_machine(struct pktcdvd_device *pd, struct packet_data
			break;

		case PACKET_RECOVERY_STATE:
			if (pkt_start_recovery(pkt)) {
				pkt_start_write(pd, pkt);
			} else {
			pkt_dbg(2, pd, "No recovery possible\n");
			pkt_set_state(pkt, PACKET_FINISHED_STATE);
			}
			break;

		case PACKET_FINISHED_STATE: