From b05b6046fc790329d6b301aafb7ddb0b64ce00ab Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 Dec 2003 20:00:16 +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 fbbeb55b230ffc477f5563af66ab65eb6598e025) --- source3/lib/bitmap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/lib') 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