[PATCH] ide-cd.c to mount multi-session DVD

From: Andy Polyakov
Date: Sat Aug 28 2004 - 05:06:24 EST


With respect to http://marc.theaimsgroup.com/?l=linux-kernel&m=108827602322464&w=2
I'd like to nominate the attached patch. And while we're on ide-cd.c
track I also wonder why has dma alignment requirement been hardened?

- blk_queue_dma_alignment(drive->queue, 3);
+ blk_queue_dma_alignment(drive->queue, 31);

I can find requirement for minimal lenght reasonable, but who aligns
pointers at 32 byte boundary? Cheers. A.

8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------
--- ./drivers/ide/ide-cd.c.orig Tue Aug 24 18:54:42 2004
+++ ./drivers/ide/ide-cd.c Fri Aug 27 20:31:27 2004
@@ -2356,26 +2356,32 @@
/* Read the multisession information. */
if (toc->hdr.first_track != CDROM_LEADOUT) {
/* Read the multisession information. */
- stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
+ int ask_for_msf=0;
+#if ! STANDARD_ATAPI
+ if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd)
+ ask_for_msf=1;
+#endif
+ stat = cdrom_read_tocentry(drive, 0, ask_for_msf, 1,
+ (char *)&ms_tmp,
sizeof(ms_tmp), sense);
if (stat) return stat;
} else {
- ms_tmp.ent.addr.msf.minute = 0;
- ms_tmp.ent.addr.msf.second = 2;
- ms_tmp.ent.addr.msf.frame = 0;
+ ms_tmp.ent.addr.lba = 0;
ms_tmp.hdr.first_track = ms_tmp.hdr.last_track = CDROM_LEADOUT;
}

+ toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
+ toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);
+
#if ! STANDARD_ATAPI
- if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd)
+ if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd
+ && toc->hdr.first_track != CDROM_LEADOUT) {
msf_from_bcd (&ms_tmp.ent.addr.msf);
+ toc->last_session_lba = msf_to_lba (ms_tmp.ent.addr.msf.minute,
+ ms_tmp.ent.addr.msf.second,
+ ms_tmp.ent.addr.msf.frame);
+ }
#endif /* not STANDARD_ATAPI */
-
- toc->last_session_lba = msf_to_lba (ms_tmp.ent.addr.msf.minute,
- ms_tmp.ent.addr.msf.second,
- ms_tmp.ent.addr.msf.frame);
-
- toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);

/* Now try to get the total cdrom capacity. */
stat = cdrom_get_last_written(cdi, &last_written);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/