diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2012-03-25 23:25:01 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-03-26 00:57:29 +0200 |
commit | 206421c8fd28ca4bb6375b97e106d3531f1a5559 (patch) | |
tree | 2fc4076ec37cc15e916801aa1873f09f22187a75 /source4/dsdb/samdb/ldb_modules/objectclass.c | |
parent | 0f8ffa9ce1777d0b368eb765a7f69f93e68118bd (diff) | |
download | samba-206421c8fd28ca4bb6375b97e106d3531f1a5559.tar.gz samba-206421c8fd28ca4bb6375b97e106d3531f1a5559.tar.bz2 samba-206421c8fd28ca4bb6375b97e106d3531f1a5559.zip |
s4:dsdb - enhance "get_last_structural_class()" for optimisations
If the objectclass entry has been sorted before we are able to determine
the (last) structural or 88 object class in constant time.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/objectclass.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/objectclass.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index b66b4d7a5f..0d75e5ff89 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -637,7 +637,8 @@ static int objectclass_do_add(struct oc_context *ac) /* Make sure its valid to add an object of this type */ objectclass = get_last_structural_class(ac->schema, - objectclass_element, ac->req); + objectclass_element, + true); if(objectclass == NULL) { ldb_asprintf_errstring(ldb, "Failed to find a structural class for %s", @@ -1112,7 +1113,7 @@ static int objectclass_do_mod(struct oc_context *ac) /* Get the new top-most structural object class */ objectclass = get_last_structural_class(ac->schema, oc_el_entry, - ac->req); + false); if (objectclass == NULL) { ldb_set_errstring(ldb, "objectclass: cannot delete all structural objectclasses!"); @@ -1312,7 +1313,8 @@ static int objectclass_do_rename2(struct oc_context *ac) /* existing entry without a valid object class? */ return ldb_operr(ldb); } - objectclass = get_last_structural_class(ac->schema, oc_el_entry, ac->req); + objectclass = get_last_structural_class(ac->schema, oc_el_entry, + false); if (objectclass == NULL) { /* existing entry without a valid object class? */ return ldb_operr(ldb); |