aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-09-05 17:11:38 -0400
committerKent Overstreet <koverstreet@google.com>2013-03-23 17:15:37 -0400
commitff8e0070d1a4d09cb462d3059956530fa67fd91d (patch)
treee1b15e6e2e0b2f71acf185924f098dfe0666ce37 /drivers
parentffb25dc60ff14f90a581975307b0c1d07e1f362a (diff)
pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage
In the short term this'll help with code auditing, and if this code ever gets used now it's converted :) Signed-off-by: Kent Overstreet <koverstreet@google.com> CC: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/pktcdvd.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 783c96c89b75..11190424536a 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1156,16 +1156,15 @@ static int pkt_start_recovery(struct packet_data *pkt)
1156 new_sector = new_block * (CD_FRAMESIZE >> 9); 1156 new_sector = new_block * (CD_FRAMESIZE >> 9);
1157 pkt->sector = new_sector; 1157 pkt->sector = new_sector;
1158 1158
1159 bio_reset(pkt->bio);
1160 pkt->bio->bi_bdev = pd->bdev;
1161 pkt->bio->bi_rw = REQ_WRITE;
1159 pkt->bio->bi_sector = new_sector; 1162 pkt->bio->bi_sector = new_sector;
1160 pkt->bio->bi_next = NULL; 1163 pkt->bio->bi_size = pkt->frames * CD_FRAMESIZE;
1161 pkt->bio->bi_flags = 1 << BIO_UPTODATE; 1164 pkt->bio->bi_vcnt = pkt->frames;
1162 pkt->bio->bi_idx = 0; 1165
1163 1166 pkt->bio->bi_end_io = pkt_end_io_packet_write;
1164 BUG_ON(pkt->bio->bi_rw != REQ_WRITE); 1167 pkt->bio->bi_private = pkt;
1165 BUG_ON(pkt->bio->bi_vcnt != pkt->frames);
1166 BUG_ON(pkt->bio->bi_size != pkt->frames * CD_FRAMESIZE);
1167 BUG_ON(pkt->bio->bi_end_io != pkt_end_io_packet_write);
1168 BUG_ON(pkt->bio->bi_private != pkt);
1169 1168
1170 drop_super(sb); 1169 drop_super(sb);
1171 return 1; 1170 return 1;