diff options
author | Andrew Bartlett <abartlet@samba.org> | 2016-10-14 15:42:53 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2016-12-01 05:54:23 +0100 |
commit | d8ee92734b0fdaee52734f4b22315a31d15388ab (patch) | |
tree | 02721e125ad0997e8c89177e70c35d824221a44c | |
parent | df2cc307e7993197a8793e6beadc967432168cc5 (diff) | |
download | samba-d8ee92734b0fdaee52734f4b22315a31d15388ab.tar.gz |
ldb: Reduce per-attribute memory allocation during @ATTRIBUTES load
This means we do just a few allocations, not multiple per configured attribute (there can be 1000s)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
-rw-r--r-- | lib/ldb/ldb_tdb/ldb_cache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_cache.c b/lib/ldb/ldb_tdb/ldb_cache.c index 3d207c8f5f3..8e7112b8732 100644 --- a/lib/ldb/ldb_tdb/ldb_cache.c +++ b/lib/ldb/ldb_tdb/ldb_cache.c @@ -113,7 +113,10 @@ static int ltdb_attributes_load(struct ldb_module *module) dn = ldb_dn_new(module, ldb, LTDB_ATTRIBUTES); if (dn == NULL) goto failed; - r = ltdb_search_dn1(module, dn, attrs_msg, 0); + r = ltdb_search_dn1(module, dn, attrs_msg, + LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC + |LDB_UNPACK_DATA_FLAG_NO_VALUES_ALLOC + |LDB_UNPACK_DATA_FLAG_NO_DN); talloc_free(dn); if (r != LDB_SUCCESS && r != LDB_ERR_NO_SUCH_OBJECT) { goto failed; |