Experimental patches to let magicdev control locking of CD-ROM
- From: Samphan Raruenrom <samphan nectec or th>
- To: desktop-devel-list gnome org
- Subject: Experimental patches to let magicdev control locking of CD-ROM
- Date: Thu, 14 Aug 2003 23:43:09 +0700
Hi,
We have users found it as a surprise when they can't eject their CDs
even when they are not in use. Some even call in here for support
because they think there're something wrong with the software and
our answer is just to click the right mouse there. This is due to the
nature of usage of Linux in Thailand, mainly to replace proprietary
software. So Thai linux users are not hackers. But NECTEC
would like them to use Linux (or they will get Windows installed)
so we try to make the transition as painless as possible.
This patch is the first of my experiment with the kernel. I first learn
that it is impossible to do this (ejectable) without modifying the
kernel.
Supermount can do this but it modify the kernel too much.
My approach is to add an API to the CDROM driver for user-space
to query the mount status of its device, specificially the question
"is it ok to umount?" (will umount() return EBUSY)
The API is implemented as a new ioctl, add 40 lines to cdrom.c.
The other part in magicdev is easy. It's just a new state BUSY
and functions to handle transitions between new/old states.
Magicdev also have to handle auto-umount which happend when
user eject the CD, magicdev must be the one who umount
the device.
The result will be like this :-
- user insert CD - magicdev mount
- user play an mp3 file - magicdev lock
- user stop using the (any) file - magicdev unlock
- user eject CD - magicdev umount
Please make comments about this approch. Having to modifying the kernel
for this feature lead me to bug it here first, to make sure that I make
the right decision before proposing to the kernel mailing list.
http://bugzilla.gnome.org/show_bug.cgi?id=119892
--
Samphan Raruenrom,
The Open Source Project,
National Electronics and Computer Technology Center,
Thailand.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]