• Andrew Morton's avatar
    [PATCH] Allow O_EXCL on a block device to claim exclusive use. · c366082d
    Andrew Morton authored
    From: NeilBrown <neilb@cse.unsw.edu.au>
    
    The blockdev layer has a concept of 'claiming' a device, so for example it
    can be claimed when a filesystem is mounted or when it is included into a
    raid array.  Only one subsystem can claim it at a time.
    
    This patch matches this functionality available to user-space via the
    O_EXCL flag to open.
    
    This allows user-space programs to easily test if a device is currently
    mounted etc, and to prevent a device from being mounted or otherwise
    claimed.
    c366082d
block_dev.c 20.8 KB