summaryrefslogtreecommitdiffstats
path: root/source3/lib/bitmap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-12-11 20:00:16 +0000
committerJeremy Allison <jra@samba.org>2003-12-11 20:00:16 +0000
commitb05b6046fc790329d6b301aafb7ddb0b64ce00ab (patch)
tree616e8a01c58da4473c5e469114f2982148465ee5 /source3/lib/bitmap.c
parent2e879cfacc23dd619055a7f5861dcab520951b2c (diff)
downloadsamba-b05b6046fc790329d6b301aafb7ddb0b64ce00ab.tar.gz
samba-b05b6046fc790329d6b301aafb7ddb0b64ce00ab.tar.xz
samba-b05b6046fc790329d6b301aafb7ddb0b64ce00ab.zip
Patch from James Peach <jpeach@sgi.com>. Remove the MAX_CONNECTIONS limit
by increasing bitmap size. Limited by "max connections" parameter. Bug #716. Jeremy. (This used to be commit fbbeb55b230ffc477f5563af66ab65eb6598e025)
Diffstat (limited to 'source3/lib/bitmap.c')
-rw-r--r--source3/lib/bitmap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/lib/bitmap.c b/source3/lib/bitmap.c
index 1023dd6541d..3fa20cdd112 100644
--- a/source3/lib/bitmap.c
+++ b/source3/lib/bitmap.c
@@ -84,6 +84,20 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n)
}
/****************************************************************************
+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
****************************************************************************/
BOOL bitmap_set(struct bitmap *bm, unsigned i)