Hmm ... this is exactly what EJECT ioctls for some removables do. ide-floppy
and cdrom for sure. sd does not do it because it does not actually support
atomic EJECT ioctl so far. I am not interested in anything more than that.
> if (number of openers == 0)
> block ->open()
> do something ...
> will work, but it means that we are not triggering it from ioctl() on that
> device. And here we only care about zero/non-zero, so ->bd_openers on
> the entire disk will do just fine.
My concern is EJECT implemetation. So far EJECT was handled by individual
drivers that used private usage counters to decide when drive was free. Now
CDEJECT is moved into drivers/block/scsi_ioctl.c which means that at least
for IDE and SCSI removables device driver is never entered here. I am looking
for reliable method to detect busy device on block layer - and yes, the code
is triggered from ioctl (mostly).
regards
-andrey
-
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/