Re: [PATCH] Add MOUNT_STATUS ioctl to cdrom device

Christoph Hellwig
2003-08-26T07:33:32Z

On Tue, Aug 26, 2003 at 01:50:43PM +0700, Samphan Raruenrom wrote:
> I'm sorry for issueing this layering violation. I read a guideline that
> it's easier to submit a patch to add device driver ioctl than inventing
> something new. It really doesn't belong here.

That guideline is wrong. Adding a driver ioctl is slmost always wrong.

> Could you guide me where else can I place this functionality?
>
> (my random idea)
> - fcntl(open("/dev/cdrom", F_MNTSTAT)
> - umount2("/dev/cdrom", MS_TEST) // not actually perform
> - new system call! e.g. mntstat(open("/dev/cdrom"))

In userspace. Or you could tell me what you want to actually
archive - your call by itself doesn't make any sense.