qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] util/co-shared-resource: Remove unused co_try_get_from_shres
@ 2024-09-18 12:42 dave
  2024-09-27 19:49 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 2+ messages in thread
From: dave @ 2024-09-18 12:42 UTC (permalink / raw)
  To: jsnow, vsementsov; +Cc: qemu-block, qemu-devel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <dave@treblig.org>

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>
---
 include/qemu/co-shared-resource.h | 7 -------
 util/qemu-co-shared-resource.c    | 6 ------
 2 files changed, 13 deletions(-)

diff --git a/include/qemu/co-shared-resource.h b/include/qemu/co-shared-resource.h
index 78ca5850f8..41be1a8131 100644
--- a/include/qemu/co-shared-resource.h
+++ b/include/qemu/co-shared-resource.h
@@ -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.
diff --git a/util/qemu-co-shared-resource.c b/util/qemu-co-shared-resource.c
index a66cc07e75..752eb5a1c5 100644
--- a/util/qemu-co-shared-resource.c
+++ b/util/qemu-co-shared-resource.c
@@ -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);
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] util/co-shared-resource: Remove unused co_try_get_from_shres
  2024-09-18 12:42 [PATCH] util/co-shared-resource: Remove unused co_try_get_from_shres dave
@ 2024-09-27 19:49 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2024-09-27 19:49 UTC (permalink / raw)
  To: dave, jsnow; +Cc: qemu-block, qemu-devel

On 18.09.24 15:42, dave@treblig.org wrote:
> From: "Dr. David Alan Gilbert"<dave@treblig.org>
> 
> 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>

Thanks, applied to my block branch.

-- 
Best regards,
Vladimir



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-27 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 12:42 [PATCH] util/co-shared-resource: Remove unused co_try_get_from_shres dave
2024-09-27 19:49 ` Vladimir Sementsov-Ogievskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).