lkml.org 
[lkml]   [2004]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] cdrom: MO-drive open write fix (trivial)
Date
Jens Axboe <axboe@suse.de> wrote:
> drive. If you could look into why that isn't set for your mo device
> and send a patch for that, it would be much better.

Assuming mo devices can do random writing, how about this patch:

--- linux/drivers/cdrom/cdrom.c.orig 2004-08-07 14:02:28.958908544 +0200
+++ linux/drivers/cdrom/cdrom.c 2004-08-07 13:58:29.306167698 +0200
@@ -833,8 +833,11 @@ static int cdrom_open_write(struct cdrom
if (!cdrom_is_mrw(cdi, &mrw_write))
mrw = 1;

- (void) cdrom_is_random_writable(cdi, &ram_write);
-
+ if (CDROM_CAN(CDC_MO_DRIVE))
+ ram_write = 1;
+ else
+ (void) cdrom_is_random_writable(cdi, &ram_write);
+
if (mrw)
cdi->mask &= ~CDC_MRW;
else
@@ -855,7 +858,7 @@ static int cdrom_open_write(struct cdrom
else if (CDROM_CAN(CDC_DVD_RAM))
ret = cdrom_dvdram_open_write(cdi);
else if (CDROM_CAN(CDC_RAM) &&
- !CDROM_CAN(CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_MRW))
+ !CDROM_CAN(CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_MRW|CDC_MO_DRIVE))
ret = cdrom_ram_open_write(cdi);
else if (CDROM_CAN(CDC_MO_DRIVE))
ret = mo_open_write(cdi);
--
Stefan Meyknecht
stefan at meyknecht dot org
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.054 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site