On Mon, 2004-05-31 at 21:30, Alan Cox wrote:
> Wouldn't it suffice with just an option to mount(1), e.g.
have as few
> changes to how this impact user space as possible. I mean, at the end of
> the day, isn't this just about the kernel locking/unlocking the drive
> (same for e.g. USB storage) only when there is I/O?
To do it properly you need a bit more because users may change CD-ROMs and you
probably want to do "Please insert 'Install Disk 2'" type dialogs.
Internally the kernel really doesn't deal with disks going away when they are
wanted. Volumagic can cope with
cd /mnt/cdrom
eject
insert new cd
ls
and also with requests when the disk is removed - not all file systems handle
media vanishing as a routine thing.
In my, possibly uninformed, opinion it would be nicest if optical discs
just appeared to the user like the other block devices out there e.g.
/sys/block/hdc
/sys/block/hdc/hdc1
Then your change notification would just be a hotplug event. Further,
for a mixed CD-ROM disc you would also have
/sys/block/hdc/hdc2
so you can access the data and audio parts simultaneously. This works on
Mac OS X, though the drive makes a lot of noise. I'm not sure how to
achieve this on Linux.
David