mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Drop unused crypt_read_lock helper.
This commit is contained in:
committed by
Milan Broz
parent
997ef242a2
commit
1d0680ce95
@@ -405,30 +405,6 @@ int device_write_lock_internal(struct crypt_device *cd, struct device *device)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int crypt_read_lock(struct crypt_device *cd, const char *resource, bool blocking, struct crypt_lock_handle **lock)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
struct crypt_lock_handle *h;
|
|
||||||
|
|
||||||
if (!resource)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
log_dbg(cd, "Acquiring %sblocking read lock for resource %s.", blocking ? "" : "non", resource);
|
|
||||||
|
|
||||||
r = acquire_and_verify(cd, NULL, resource, LOCK_SH | (blocking ? 0 : LOCK_NB), &h);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
h->type = DEV_LOCK_READ;
|
|
||||||
h->refcnt = 1;
|
|
||||||
|
|
||||||
log_dbg(cd, "READ lock for resource %s taken.", resource);
|
|
||||||
|
|
||||||
*lock = h;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int crypt_write_lock(struct crypt_device *cd, const char *resource, bool blocking, struct crypt_lock_handle **lock)
|
int crypt_write_lock(struct crypt_device *cd, const char *resource, bool blocking, struct crypt_lock_handle **lock)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ void device_unlock_internal(struct crypt_device *cd, struct device *device);
|
|||||||
|
|
||||||
int device_locked_verify(struct crypt_device *cd, int fd, struct crypt_lock_handle *h);
|
int device_locked_verify(struct crypt_device *cd, int fd, struct crypt_lock_handle *h);
|
||||||
|
|
||||||
int crypt_read_lock(struct crypt_device *cd, const char *name, bool blocking, struct crypt_lock_handle **lock);
|
|
||||||
int crypt_write_lock(struct crypt_device *cd, const char *name, bool blocking, struct crypt_lock_handle **lock);
|
int crypt_write_lock(struct crypt_device *cd, const char *name, bool blocking, struct crypt_lock_handle **lock);
|
||||||
void crypt_unlock_internal(struct crypt_device *cd, struct crypt_lock_handle *h);
|
void crypt_unlock_internal(struct crypt_device *cd, struct crypt_lock_handle *h);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user