summaryrefslogtreecommitdiff
path: root/source3/tdb/common/open.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-12 23:16:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:54 -0500
commit949eb20a1ab73e5da068183e8b05b114206dd555 (patch)
treee2d2b173fad1d4bf24519fe55f4f6652e35331df /source3/tdb/common/open.c
parentb5114650cf63a0e6338da7ac9b5d2fe82ebb057b (diff)
downloadsamba-949eb20a1ab73e5da068183e8b05b114206dd555.tar.gz
samba-949eb20a1ab73e5da068183e8b05b114206dd555.tar.bz2
samba-949eb20a1ab73e5da068183e8b05b114206dd555.zip
r21303: As discussed on samba-technical: Change the static array for the in-memory
mirrors of the hash chain locks to a dynamically allocated one. Jeremy, I count on you to revert it if the build farm freaks out, it's after midnight here :-) Volker (This used to be commit c50f099be1fcae2d533e1c3816cb25c315ba167a)
Diffstat (limited to 'source3/tdb/common/open.c')
-rw-r--r--source3/tdb/common/open.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/source3/tdb/common/open.c b/source3/tdb/common/open.c
index 224103e679..3f0c35331b 100644
--- a/source3/tdb/common/open.c
+++ b/source3/tdb/common/open.c
@@ -263,15 +263,6 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
tdb->map_size = st.st_size;
tdb->device = st.st_dev;
tdb->inode = st.st_ino;
- tdb->locked = (struct tdb_lock_type *)calloc(tdb->header.hash_size+1,
- sizeof(tdb->locked[0]));
- if (!tdb->locked) {
- TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: "
- "failed to allocate lock structure for %s\n",
- name));
- errno = ENOMEM;
- goto fail;
- }
tdb_mmap(tdb);
if (locked) {
if (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0, 1) == -1) {
@@ -324,7 +315,6 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
if (tdb->fd != -1)
if (close(tdb->fd) != 0)
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: failed to close tdb->fd on error!\n"));
- SAFE_FREE(tdb->locked);
SAFE_FREE(tdb);
errno = save_errno;
return NULL;
@@ -354,7 +344,7 @@ int tdb_close(struct tdb_context *tdb)
SAFE_FREE(tdb->name);
if (tdb->fd != -1)
ret = close(tdb->fd);
- SAFE_FREE(tdb->locked);
+ SAFE_FREE(tdb->lockrecs);
/* Remove from contexts list */
for (i = &tdbs; *i; i = &(*i)->next) {