I'm trying to lock a SCSI device (a shared storage disk) using ioctl but I can't find a highlevel API for this and I'm not sure which commands to use. Basically I want to be able to do the four operations mentioned here: http://docs.sun.com/app/docs/doc/816-5177/mhd-7i?l=en&n=1&a=view (See: Non-shared multihost disk). I already have a working driver for solaris which use the linked interface but there the commands are easy but I want the equivalent commands when used from Linux.
Any ideas?