On 03.07.19 23:55, John Snow wrote: > Add a public interface for get. While we're at it, > rename "bdrv_get_dirty_bitmap_locked" to "bdrv_dirty_bitmap_get_locked". > > (There are more functions to rename to the bdrv_dirty_bitmap_VERB form, > but they will wait until the conclusion of this series.) > > Signed-off-by: John Snow <js...@redhat.com> > --- > block/dirty-bitmap.c | 18 +++++++++++------- > block/mirror.c | 2 +- > include/block/dirty-bitmap.h | 4 ++-- > migration/block.c | 5 ++--- > nbd/server.c | 2 +- > 5 files changed, 17 insertions(+), 14 deletions(-) > > diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c > index b0f76826b3..97541521ab 100644 > --- a/block/dirty-bitmap.c > +++ b/block/dirty-bitmap.c > @@ -509,14 +509,18 @@ BlockDirtyInfoList > *bdrv_query_dirty_bitmaps(BlockDriverState *bs) > } > > /* Called within bdrv_dirty_bitmap_lock..unlock */ > -bool bdrv_get_dirty_locked(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, > - int64_t offset) > +bool bdrv_dirty_bitmap_get_locked(BdrvDirtyBitmap *bitmap, int64_t offset) > { > - if (bitmap) { > - return hbitmap_get(bitmap->bitmap, offset); > - } else { > - return false; > - } > + return hbitmap_get(bitmap->bitmap, offset); > +} > + > +bool bdrv_dirty_bitmap_get(BdrvDirtyBitmap *bitmap, int64_t offset) {
I’m sure Patchew has told this already, but this is not Rust yet. With that fixed: Reviewed-by: Max Reitz <mre...@redhat.com> > + bool ret; > + bdrv_dirty_bitmap_lock(bitmap); > + ret = bdrv_dirty_bitmap_get_locked(bitmap, offset); > + bdrv_dirty_bitmap_unlock(bitmap); > + > + return ret; > } > > /**
signature.asc
Description: OpenPGP digital signature