block/throttle-groups: Make incref/decref public
commit973f2ddf7b48c27aa8642047796cca3bec0b48d8
authorMax Reitz <mreitz@redhat.com>
Mon, 19 Oct 2015 15:53:23 +0000 (19 17:53 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Oct 2015 16:18:23 +0000 (23 18:18 +0200)
tree159ea895abcbe825e9d42c227b25129106e5372f
parent373340b26caa1572cf0f155131569dfc527aa133
block/throttle-groups: Make incref/decref public

Throttle groups are not necessarily referenced by BDSs alone; a later
patch will essentially allow BBs to reference them, too. Make the
ref/unref functions public so that reference can be properly accounted
for.

Their interface is slightly adjusted in that they return and take a
ThrottleState pointer, respectively, instead of a ThrottleGroup pointer.
Functionally, they are equivalent, but since ThrottleGroup is not meant
to be used outside of block/throttle-groups.c, ThrottleState is easier
to handle.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/throttle-groups.c
include/block/throttle-groups.h