From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtED5-00071g-7z for qemu-devel@nongnu.org; Wed, 18 Dec 2013 05:18:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtECz-0007ek-8P for qemu-devel@nongnu.org; Wed, 18 Dec 2013 05:18:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtECz-0007ef-0Y for qemu-devel@nongnu.org; Wed, 18 Dec 2013 05:18:29 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBIAIS9Z018304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Dec 2013 05:18:28 -0500 Message-ID: <52B1768E.7080906@redhat.com> Date: Wed, 18 Dec 2013 12:18:54 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1387293974-24718-1-git-send-email-quintela@redhat.com> <1387293974-24718-17-git-send-email-quintela@redhat.com> In-Reply-To: <1387293974-24718-17-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 16/38] bitmap: Add bitmap_zero_extend operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org On 12/17/2013 05:25 PM, Juan Quintela wrote: > Signed-off-by: Juan Quintela > Reviewed-by: Eric Blake > --- > include/qemu/bitmap.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h > index afdd257..1babd5d 100644 > --- a/include/qemu/bitmap.h > +++ b/include/qemu/bitmap.h > @@ -220,4 +220,13 @@ unsigned long bitmap_find_next_zero_area(unsigned long *map, > unsigned long nr, > unsigned long align_mask); > > +static inline unsigned long *bitmap_zero_extend(unsigned long *old, > + long old_nbits, long new_nbits) > +{ > + long new_len = BITS_TO_LONGS(new_nbits) * sizeof(unsigned long); > + unsigned long *new = g_realloc(old, new_len); > + bitmap_clear(new, old_nbits, new_nbits - old_nbits); > + return new; > +} > + > #endif /* BITMAP_H */ > Reviewed-by: Orit Wasserman