From 1d0680ce95fe44b9382820f2fbb0eec6d4fe1109 Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Tue, 12 Dec 2023 12:18:28 +0100 Subject: [PATCH] Drop unused crypt_read_lock helper. --- lib/utils_device_locking.c | 24 ------------------------ lib/utils_device_locking.h | 1 - 2 files changed, 25 deletions(-) diff --git a/lib/utils_device_locking.c b/lib/utils_device_locking.c index f66e95e2..c49c032c 100644 --- a/lib/utils_device_locking.c +++ b/lib/utils_device_locking.c @@ -405,30 +405,6 @@ int device_write_lock_internal(struct crypt_device *cd, struct device *device) 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 r; diff --git a/lib/utils_device_locking.h b/lib/utils_device_locking.h index b73f15df..f68d36ac 100644 --- a/lib/utils_device_locking.h +++ b/lib/utils_device_locking.h @@ -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 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); void crypt_unlock_internal(struct crypt_device *cd, struct crypt_lock_handle *h);