]> arthur.barton.de Git - netatalk.git/commit
Restructure opening and deleting the CNID dbs and CNID wraparound support
authorRalph Boehme <sloowfranklin@gmail.com>
Mon, 10 Dec 2012 17:38:07 +0000 (18:38 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Mon, 17 Dec 2012 18:04:58 +0000 (19:04 +0100)
commit83416b7b2b6651e76ad20960822249dceb55644a
tree1603024ff5553c6d0c281df4b6be35c7b16d56ac
parent06c0bfaea7c9db5d404813efd23bf06c49c2bc4f
Restructure opening and deleting the CNID dbs and CNID wraparound support

If opening the db fails, delete it and recreate a new empty one.

Add handling of CNID overflow, ie when the last used CNID reaches
its maximum (UINT32_MAX), wrap around to CNID_START. This then neccesites
a modification to get_id() where we used to just increment the last
used CNID counter and use that as next CNID.
Now we need to ensure that it isn't already used in the db and keep
searching for an used in case it is in a loop.

Move locking function back to main.c, as it's only used by cnid_dbd.

Modify dbd_add() such that it can add an entry with the CNID passed
in from the client, the CNID hint read from the adouble file.

Invalidate CNID hint in case lookup detected a problem
etc/cnid_dbd/dbd_add.c
etc/cnid_dbd/dbd_lookup.c
etc/cnid_dbd/dbif.c
etc/cnid_dbd/dbif.h
etc/cnid_dbd/main.c