[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/37] throttle: Remove throttle_group_lock/unlock()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 27/37] throttle: Remove throttle_group_lock/unlock() |
Date: |
Fri, 23 Oct 2015 19:01:14 +0200 |
From: Alberto Garcia <address@hidden>
The group throttling code was always meant to handle its locking
internally. However, bdrv_swap() was touching the ThrottleGroup
structure directly and therefore needed an API for that.
Now that bdrv_swap() no longer exists there's no need for the
throttle_group_lock() API anymore.
Signed-off-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/throttle-groups.c | 31 +------------------------------
include/block/throttle-groups.h | 3 ---
2 files changed, 1 insertion(+), 33 deletions(-)
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 20cb216..3419af7 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -33,8 +33,7 @@
* its own locking.
*
* This locking is however handled internally in this file, so it's
- * mostly transparent to outside users (but see the documentation in
- * throttle_groups_lock()).
+ * transparent to outside users.
*
* The whole ThrottleGroup structure is private and invisible to
* outside users, that only use it through its ThrottleState.
@@ -468,34 +467,6 @@ void throttle_group_unregister_bs(BlockDriverState *bs)
bs->throttle_state = NULL;
}
-/* Acquire the lock of this throttling group.
- *
- * You won't normally need to use this. None of the functions from the
- * ThrottleGroup API require you to acquire the lock since all of them
- * deal with it internally.
- *
- * This should only be used in exceptional cases when you want to
- * access the protected fields of a BlockDriverState directly
- * (e.g. bdrv_swap()).
- *
- * @bs: a BlockDriverState that is member of the group
- */
-void throttle_group_lock(BlockDriverState *bs)
-{
- ThrottleGroup *tg = container_of(bs->throttle_state, ThrottleGroup, ts);
- qemu_mutex_lock(&tg->lock);
-}
-
-/* Release the lock of this throttling group.
- *
- * See the comments in throttle_group_lock().
- */
-void throttle_group_unlock(BlockDriverState *bs)
-{
- ThrottleGroup *tg = container_of(bs->throttle_state, ThrottleGroup, ts);
- qemu_mutex_unlock(&tg->lock);
-}
-
static void throttle_groups_init(void)
{
qemu_mutex_init(&throttle_groups_lock);
diff --git a/include/block/throttle-groups.h b/include/block/throttle-groups.h
index f3b75b3..aba28f3 100644
--- a/include/block/throttle-groups.h
+++ b/include/block/throttle-groups.h
@@ -43,7 +43,4 @@ void coroutine_fn
throttle_group_co_io_limits_intercept(BlockDriverState *bs,
unsigned int bytes,
bool is_write);
-void throttle_group_lock(BlockDriverState *bs);
-void throttle_group_unlock(BlockDriverState *bs);
-
#endif
--
1.8.3.1
- [Qemu-devel] [PULL 23/37] block: Prepare for NULL BDS, (continued)
- [Qemu-devel] [PULL 23/37] block: Prepare for NULL BDS, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 25/37] blockdev: Pull out blockdev option extraction, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 31/37] aio: introduce aio_{disable, enable}_external, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 26/37] blockdev: Allow more options for BB-less BDS tree, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 20/37] block: Fail requests to empty BlockBackend, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 24/37] blockdev: Do not create BDS for empty drive, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 30/37] dataplane: Mark host notifiers' client type as "external", Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 28/37] aio: Add "is_external" flag for event handlers, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 33/37] block: Add "drained begin/end" for transactional external snapshot, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 36/37] block: Add "drained begin/end" for internal snapshot, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 27/37] throttle: Remove throttle_group_lock/unlock(),
Kevin Wolf <=
- [Qemu-devel] [PULL 35/37] block: Add "drained begin/end" for transactional blockdev-backup, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 29/37] nbd: Mark fd handlers client type as "external", Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 32/37] block: Introduce "drained begin/end" API, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 37/37] tests: Add test case for aio_disable_external, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 34/37] block: Add "drained begin/end" for transactional backup, Kevin Wolf, 2015/10/23
- Re: [Qemu-devel] [PULL 00/37] Block layer patches, Peter Maydell, 2015/10/26