|
|
0a122b |
From ff40b201543aff558f2bf681da3093bce82c6eba Mon Sep 17 00:00:00 2001
|
|
|
0a122b |
From: Juan Quintela <quintela@redhat.com>
|
|
|
0a122b |
Date: Tue, 14 Jan 2014 15:07:28 +0100
|
|
|
0a122b |
Subject: [PATCH 17/40] bitmap: Add bitmap_zero_extend operation
|
|
|
0a122b |
|
|
|
0a122b |
RH-Author: Juan Quintela <quintela@redhat.com>
|
|
|
0a122b |
Message-id: <1389712071-23303-18-git-send-email-quintela@redhat.com>
|
|
|
0a122b |
Patchwork-id: 56671
|
|
|
0a122b |
O-Subject: [RHEL7 qemu-kvm PATCH 17/40] bitmap: Add bitmap_zero_extend operation
|
|
|
0a122b |
Bugzilla: 997559
|
|
|
0a122b |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
0a122b |
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
|
|
|
0a122b |
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
|
|
|
0a122b |
|
|
|
0a122b |
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
|
|
0a122b |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
0a122b |
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
|
|
|
0a122b |
(cherry picked from commit 164590a60fd685399da259ac41b338d9a0b9d6c0)
|
|
|
0a122b |
Signed-off-by: Juan Quintela <quintela@trasno.org>
|
|
|
0a122b |
---
|
|
|
0a122b |
include/qemu/bitmap.h | 9 +++++++++
|
|
|
0a122b |
1 file changed, 9 insertions(+)
|
|
|
0a122b |
|
|
|
0a122b |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
0a122b |
---
|
|
|
0a122b |
include/qemu/bitmap.h | 9 +++++++++
|
|
|
0a122b |
1 files changed, 9 insertions(+), 0 deletions(-)
|
|
|
0a122b |
|
|
|
0a122b |
diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h
|
|
|
0a122b |
index afdd257..1babd5d 100644
|
|
|
0a122b |
--- a/include/qemu/bitmap.h
|
|
|
0a122b |
+++ b/include/qemu/bitmap.h
|
|
|
0a122b |
@@ -220,4 +220,13 @@ unsigned long bitmap_find_next_zero_area(unsigned long *map,
|
|
|
0a122b |
unsigned long nr,
|
|
|
0a122b |
unsigned long align_mask);
|
|
|
0a122b |
|
|
|
0a122b |
+static inline unsigned long *bitmap_zero_extend(unsigned long *old,
|
|
|
0a122b |
+ long old_nbits, long new_nbits)
|
|
|
0a122b |
+{
|
|
|
0a122b |
+ long new_len = BITS_TO_LONGS(new_nbits) * sizeof(unsigned long);
|
|
|
0a122b |
+ unsigned long *new = g_realloc(old, new_len);
|
|
|
0a122b |
+ bitmap_clear(new, old_nbits, new_nbits - old_nbits);
|
|
|
0a122b |
+ return new;
|
|
|
0a122b |
+}
|
|
|
0a122b |
+
|
|
|
0a122b |
#endif /* BITMAP_H */
|
|
|
0a122b |
--
|
|
|
0a122b |
1.7.1
|
|
|
0a122b |
|