util/co-shared-resource: Remove unused co_try_get_from_shres
authorDr. David Alan Gilbert <dave@treblig.org>
Wed, 18 Sep 2024 12:42:20 +0000 (13:42 +0100)
committerVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Mon, 30 Sep 2024 07:53:18 +0000 (10:53 +0300)
co_try_get_from_shres hasn't been used since it was added in
  55fa54a789 ("co-shared-resource: protect with a mutex")

(Everyone uses the _locked version)
Remove it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Message-Id: <20240918124220.27871-1-dave@treblig.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
include/qemu/co-shared-resource.h
util/qemu-co-shared-resource.c

index 78ca5850f8f5cf3fdc1a901938514c99f83a3ecd..41be1a813124b2de83d829a9ce59255878fdf3e9 100644 (file)
@@ -44,13 +44,6 @@ SharedResource *shres_create(uint64_t total);
  */
 void shres_destroy(SharedResource *s);
 
-/*
- * Try to allocate an amount of @n.  Return true on success, and false
- * if there is too little left of the collective resource to fulfill
- * the request.
- */
-bool co_try_get_from_shres(SharedResource *s, uint64_t n);
-
 /*
  * Allocate an amount of @n, and, if necessary, yield until
  * that becomes possible.
index a66cc07e75be98195f9fabd9670c863bfb1f5259..752eb5a1c5f15bcc3d6dfb35b6e440c70ca41791 100644 (file)
@@ -66,12 +66,6 @@ static bool co_try_get_from_shres_locked(SharedResource *s, uint64_t n)
     return false;
 }
 
-bool co_try_get_from_shres(SharedResource *s, uint64_t n)
-{
-    QEMU_LOCK_GUARD(&s->lock);
-    return co_try_get_from_shres_locked(s, n);
-}
-
 void coroutine_fn co_get_from_shres(SharedResource *s, uint64_t n)
 {
     assert(n <= s->total);