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/fd.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'libglusterfs/src/fd.c') diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c index bbb774be492..2a1dcb789a8 100644 --- a/libglusterfs/src/fd.c +++ b/libglusterfs/src/fd.c @@ -37,27 +37,6 @@ gf_fd_fdtable_expand (fdtable_t *fdtable, uint32_t nr); fd_t * _fd_ref (fd_t *fd); -/* - Allocate in memory chunks of power of 2 starting from 1024B - Assumes fdtable->lock is held -*/ -static inline int -gf_roundup_power_of_two (uint32_t nr) -{ - uint32_t result = 1; - - if (nr < 0) { - gf_log ("fd", GF_LOG_ERROR, "negative number passed"); - return -1; - } - - while (result <= nr) - result *= 2; - - return result; -} - - static int gf_fd_chain_fd_entries (fdentry_t *entries, uint32_t startidx, uint32_t endcount) @@ -96,7 +75,7 @@ gf_fd_fdtable_expand (fdtable_t *fdtable, uint32_t nr) } nr /= (1024 / sizeof (fdentry_t)); - nr = gf_roundup_power_of_two (nr + 1); + nr = gf_roundup_next_power_of_two (nr + 1); nr *= (1024 / sizeof (fdentry_t)); oldfds = fdtable->fdentries; -- cgit