blkdev_get|put and how to get excl blk dev access w/i the kernel

Date: Mon Jul 16 2001 - 12:55:01 EST

I noticed some "locking" functions in the md driver which gave me the
impression of giving exclusive access to a block device. The functions
make use of:


These aren't particularly documented that I've seen and I haven't traced
through enough code to figure out for sure what exactly they'd lock and
not lock. But I've been playing around with them just to see what I could
do with an sd device which I'd "locked". It seems like I'm unable to run
fdisk against the disk, but other than that I can read/write (using dd)
the sd device without a problem. Is this what's supposed to happen?

If so, is there anything else I can do to get exclusive use of a system
device (especially particular sd and sg devices) from within the kernel?
This seems like it would be a generally desireable feature, although
I can understand people taking the stance of "if the sysadmin wants to
shoot themselves in the foot by writing to an sd directly instead of to
the filesystem mounted on that sd...more power to them." That's kind of my
thought, but somebody (my employer) wants this from me.


*  tpepper@vato dot org             * Venimus, Vidimus, *
*     * Dolavimus         *
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:07 EST