From: Stefan Hajnoczi Date: Tue, 28 Apr 2015 13:27:50 +0000 (+0100) Subject: block: add bdrv_set_dirty()/bdrv_reset_dirty() to block_int.h X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~221^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0c47b6cb1de430fbc6f828f7acffa851c580840;p=sdk%2Femulator%2Fqemu.git block: add bdrv_set_dirty()/bdrv_reset_dirty() to block_int.h The dirty bitmap functions are called from the block I/O processing code. Make them visible to block_int.h users so they can be used outside block.c. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- diff --git a/block.c b/block.c index 1f0a4e2..3b865ee 100644 --- a/block.c +++ b/block.c @@ -110,10 +110,6 @@ static QTAILQ_HEAD(, BlockDriverState) graph_bdrv_states = static QLIST_HEAD(, BlockDriver) bdrv_drivers = QLIST_HEAD_INITIALIZER(bdrv_drivers); -static void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector, - int nr_sectors); -static void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, - int nr_sectors); static void bdrv_dirty_bitmap_truncate(BlockDriverState *bs); /* If non-zero, use only whitelisted block drivers */ static int use_bdrv_whitelist; @@ -5787,8 +5783,8 @@ void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap) hbitmap_reset(bitmap->bitmap, 0, bitmap->size); } -static void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector, - int nr_sectors) +void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector, + int nr_sectors) { BdrvDirtyBitmap *bitmap; QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) { @@ -5799,8 +5795,8 @@ static void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector, } } -static void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, - int nr_sectors) +void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, + int nr_sectors) { BdrvDirtyBitmap *bitmap; QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) { diff --git a/include/block/block_int.h b/include/block/block_int.h index e0d5561..5ad20b2 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -626,4 +626,8 @@ bool blk_dev_is_tray_open(BlockBackend *blk); bool blk_dev_is_medium_locked(BlockBackend *blk); void blk_dev_resize_cb(BlockBackend *blk); +void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector, int nr_sectors); +void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, + int nr_sectors); + #endif /* BLOCK_INT_H */