lkml.org 
[lkml]   [1998]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectLocking a block device
This may not be the place to ask but...

Is there a way to lock a block device so that a process has exclusive access to it? I have tried POSIX locks with little success.

For example, say I want a program to have exclusive access to /dev/hda3. I want the major/minor to be locked so that no other program can access it, mount it or do anything with it until I release the lock. A reason for the lock would be if I wanted to manipulate fs structures within a partition. I wouldn't want the state of the fs to change on me unawares while I change the FS myself. Granted, while it is likely that it won't happen, I would like to able to guarantee that it won't.

If there is a way to do this, please let me know. If not, maybe this should be an enhancement to the kernel (?).

Any comments would be appreciated.

Phillip Burr



____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

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