mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 08:20:07 +01:00
Add device_is_locked function.
This commit is contained in:
committed by
Milan Broz
parent
1192fd27c6
commit
a4d236eebe
@@ -129,6 +129,7 @@ int device_read_lock(struct crypt_device *cd, struct device *device);
|
||||
int device_write_lock(struct crypt_device *cd, struct device *device);
|
||||
void device_read_unlock(struct crypt_device *cd, struct device *device);
|
||||
void device_write_unlock(struct crypt_device *cd, struct device *device);
|
||||
bool device_is_locked(struct device *device);
|
||||
|
||||
enum devcheck { DEV_OK = 0, DEV_EXCL = 1 };
|
||||
int device_check_access(struct crypt_device *cd,
|
||||
|
||||
@@ -890,3 +890,8 @@ void device_write_unlock(struct crypt_device *cd, struct device *device)
|
||||
|
||||
device->lh = NULL;
|
||||
}
|
||||
|
||||
bool device_is_locked(struct device *device)
|
||||
{
|
||||
return device ? device_locked(device->lh) : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user