From 76acac485b9f06f36d145b4c31fa6f4da3c70f52 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 29 Jul 2011 16:30:36 +0530 Subject: IOBUF: Bring in variable iobuf support Rebasing Raghavendra's patch to master Change-Id: Ie7a0c9a7b8e73cfe48c4573a5153460d5126208e BUG: 2472 Reviewed-on: http://review.gluster.com/12 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- libglusterfs/src/common-utils.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libglusterfs/src/common-utils.h') diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 9afa2805822..7b3cf4fde54 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -307,6 +307,19 @@ memdup (const void *ptr, size_t size) return newptr; } +/* + * rounds up nr to power of two. If nr is already a power of two, just returns + * nr + */ + +int32_t gf_roundup_power_of_two (uint32_t nr); + +/* + * rounds up nr to next power of two. If nr is already a power of two, next + * power of two is returned. + */ + +int32_t gf_roundup_next_power_of_two (uint32_t nr); char *gf_trim (char *string); int gf_strsplit (const char *str, const char *delim, -- cgit