summaryrefslogtreecommitdiff
path: root/ctdb/server/ipalloc_common.c
AgeCommit message (Collapse)AuthorFilesLines
2025-01-02remove usage of bzeroMichael Tokarev1-1/+1
bzero() function has been deprecated for a long time. In samba it is replaced with memset(). But samba also provides common memory-zeroing macros, like ZERO_STRUCT(). In all places where bzero() is used, it actually meant to zero a structure or an array. So replace these bzero() calls with ZERO_STRUCT() or ZERO_ARRAY() as appropriate, and remove bzero() replacement and testing entirely. While at it, also stop checking for presence of memset() - this function is standard for a very long time, and the only conditional where HAVE_MEMSET were used, was to provide replacement for bzero() - in all other places memset() is used unconditionally. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2023-03-24ctdb:server: Fix code spellingAndreas Schneider1-1/+1
Best reviewed with: `git show --word-diff` Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2022-05-31ctdb-daemon: Remove unused #includes of rb_tree.hMartin Schwenke1-1/+0
ctdb_takeover.c and eventscript.c no longer use this. ipalloc_common.c has never used it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-06-05ctdb-ipalloc: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN insteadMartin Schwenke1-7/+7
This fixes warnings about signed versus unsigned comparisons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-06-05ctdb-ipalloc: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke1-3/+4
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-07-11ctdb-daemon: Drop the noiphost "node flags" bitmapMartin Schwenke1-4/+0
This is no longer needed because inactive/disabled nodes no longer report any available public IP addresses. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-09-19ctdb-protocol: Optionally print port for address printing functionsMartin Schwenke1-4/+7
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-09-19ctdb-build: Split protocol-util as a separate subsystemMartin Schwenke1-1/+1
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-02-24ctdb-ipalloc: Switch noiphost to struct bitmapMartin Schwenke1-1/+1
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-02-24ctdb-ipalloc: Switch available_on to struct bitmapMartin Schwenke1-1/+1
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19ctdb-takeover: NoIPTakeover is global across clusterMartin Schwenke1-1/+1
Instead of gathering the value from all nodes, just use the value on the recovery master and have it affect all nodes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-02ctdb-ipalloc: Optimise check to see if IP is available on a nodeMartin Schwenke1-16/+1
Use a "bitmap" of available IPs for each IP address instead of walking the list of available IP addresses. For ctdb/tests/takeover/lcp2.030.sh, this improves the time taken on my laptop from: real 0m11.997s user 0m11.960s sys 0m0.000s to real 0m8.571s user 0m8.544s sys 0m0.000s So, when assigning all 900 IP addresses the improvement is about 25%. For the no-op case (where all IPs are already assigned to nodes), the extra setup adds a small fraction of a second for 900 IPs. Intermediate cases result in intermediate improvements. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: Drop implicit dependency on ctdb-commonMartin Schwenke1-4/+9
Use new functions from protocol API instead. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-02-16ctdb: Fix CID 1353176 Logically dead codeVolker Lendecke1-4/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-12ctdb-ipalloc: Remove most uses of struct ctdb_public_ip_list_oldMartin Schwenke1-5/+3
Where possible, this should no longer be used. struct ctdb_public_ip_list is a fixed size structure and introduces an extra level of indirection. This means one level of indirection can be dropped for known_public_ips and available_public_ips. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Feb 12 08:40:21 CET 2016 on sn-devel-144
2016-01-13ctdb-ipalloc: Split IP allocation into its own build subsystemMartin Schwenke1-0/+206
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>