Skip to content

Commit

Permalink
pktcdvd: don't rely on bio_init() preserving bio->bi_destructor
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Laurent Riffard authored and Jens Axboe committed Oct 16, 2007
1 parent 761a15e commit 7e3da6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,7 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt)
bio->bi_end_io = pkt_end_io_read;
bio->bi_private = pkt;
bio->bi_io_vec = vec;
bio->bi_destructor = pkt_bio_destructor;

p = (f * CD_FRAMESIZE) / PAGE_SIZE;
offset = (f * CD_FRAMESIZE) % PAGE_SIZE;
Expand Down Expand Up @@ -1444,6 +1445,7 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
pkt->w_bio->bi_end_io = pkt_end_io_packet_write;
pkt->w_bio->bi_private = pkt;
pkt->w_bio->bi_io_vec = bvec;
pkt->w_bio->bi_destructor = pkt_bio_destructor;
for (f = 0; f < pkt->frames; f++)
if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset))
BUG();
Expand Down

0 comments on commit 7e3da6c

Please sign in to comment.