Add device_is_locked function.

This commit is contained in:
Ondrej Kozina
2019-02-27 17:48:51 +01:00
committed by Milan Broz
parent 1192fd27c6
commit a4d236eebe
2 changed files with 6 additions and 0 deletions

View File

@@ -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,

View File

@@ -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;
}