diff options
author | Eric Blake <eblake@redhat.com> | 2017-09-25 09:55:08 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-10-06 16:28:58 +0200 |
commit | ecbfa2817d61fd102d291487ec1e61571b3b6581 (patch) | |
tree | 501d6b0ebf2293a6e2ff512af049250c253352e9 /util/hbitmap.c | |
parent | a8b42a1c09e751b9f921a1a73756411fc118020b (diff) | |
download | qemu-ecbfa2817d61fd102d291487ec1e61571b3b6581.zip qemu-ecbfa2817d61fd102d291487ec1e61571b3b6581.tar.gz qemu-ecbfa2817d61fd102d291487ec1e61571b3b6581.tar.bz2 |
hbitmap: Rename serialization_granularity to serialization_align
The only client of hbitmap_serialization_granularity() is dirty-bitmap's
bdrv_dirty_bitmap_serialization_align(). Keeping the two names consistent
is worthwhile, and the shorter name is more representative of what the
function returns (the required alignment to be used for start/count of
other serialization functions, where violating the alignment causes
assertion failures).
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'util/hbitmap.c')
-rw-r--r-- | util/hbitmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/hbitmap.c b/util/hbitmap.c index 21535cc..2f9d0fd 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -413,14 +413,14 @@ bool hbitmap_is_serializable(const HBitmap *hb) { /* Every serialized chunk must be aligned to 64 bits so that endianness * requirements can be fulfilled on both 64 bit and 32 bit hosts. - * We have hbitmap_serialization_granularity() which converts this + * We have hbitmap_serialization_align() which converts this * alignment requirement from bitmap bits to items covered (e.g. sectors). * That value is: * 64 << hb->granularity * Since this value must not exceed UINT64_MAX, hb->granularity must be * less than 58 (== 64 - 6, where 6 is ld(64), i.e. 1 << 6 == 64). * - * In order for hbitmap_serialization_granularity() to always return a + * In order for hbitmap_serialization_align() to always return a * meaningful value, bitmaps that are to be serialized must have a * granularity of less than 58. */ @@ -437,7 +437,7 @@ bool hbitmap_get(const HBitmap *hb, uint64_t item) return (hb->levels[HBITMAP_LEVELS - 1][pos >> BITS_PER_LEVEL] & bit) != 0; } -uint64_t hbitmap_serialization_granularity(const HBitmap *hb) +uint64_t hbitmap_serialization_align(const HBitmap *hb) { assert(hbitmap_is_serializable(hb)); @@ -454,7 +454,7 @@ static void serialization_chunk(const HBitmap *hb, unsigned long **first_el, uint64_t *el_count) { uint64_t last = start + count - 1; - uint64_t gran = hbitmap_serialization_granularity(hb); + uint64_t gran = hbitmap_serialization_align(hb); assert((start & (gran - 1)) == 0); assert((last >> hb->granularity) < hb->size); |