From 0b88121c7898e85837f32c98b445c9c4863b3fa8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 Dec 2003 19:59:05 +0000 Subject: Patch from James Peach . Remove the MAX_CONNECTIONS limit by increasing bitmap size. Limited by "max connections" parameter. Bug #716. Jeremy. (This used to be commit 0be57a2eb015f832c6bb6d84525719a3d632f741) --- source3/lib/bitmap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/lib/bitmap.c') diff --git a/source3/lib/bitmap.c b/source3/lib/bitmap.c index 1023dd6541..3fa20cdd11 100644 --- a/source3/lib/bitmap.c +++ b/source3/lib/bitmap.c @@ -83,6 +83,20 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n) return bm; } +/**************************************************************************** +copy as much of the source bitmap as will fit in the destination bitmap. +****************************************************************************/ + +int bitmap_copy(struct bitmap * const dst, const struct bitmap * const src) +{ + int count = MIN(dst->n, src->n); + + SMB_ASSERT(dst->b != src->b); + memcpy(dst->b, src->b, sizeof(dst->b[0])*(count+31)/32); + + return count; +} + /**************************************************************************** set a bit in a bitmap ****************************************************************************/ -- cgit