[lkml]   [1996]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectExclusive access to block devices
A friend and I are working on a program to access Iomega's special features
for the ZIP drive. It's easy enough to use the SCSI_SEND_COMMAND ioctl
to actually do the things we need from a user mode program, but these
ioctls are things that should not be done when the drive is otherwise
in use. There doesn't appear to be any general way to specify that an
ioctl should only be executed if the access count is == 1, or to
test that a block device is not mounted or otherwise open ... (While
an absolute race-free lock would be nice, a simple busy test would be
adequate for the application.)

My friend wants to add the new ioctls into scsi_ioctl.c, but I'm arguing that
vendor-specific functions ought not to be in the kernel.

I feel certain that I'm missing something obvious - anyone care to enlighten
me ? :-)

Should we have a general low-level "lock this device for exclusive use"
ioctl for all block devices ? The access counters required to implement
it are all there already.

Grant R. Guenther

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