s3:registry: use create_reg_subkey() in reg_createkey().
authorMichael Adam <obnox@samba.org>
Wed, 25 Feb 2009 21:06:47 +0000 (22:06 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 19 Mar 2009 17:04:00 +0000 (18:04 +0100)
Instead of calling store_reg_keys()

On my box, importing 2000 shares into an empty smbconf key
now takes some 32 seconds.

Michael

Signed-off-by: Michael Adam <obnox@samba.org>
source/registry/reg_api.c

index 64c34f93ac27bef06ef6139689c49f5453620cc0..262c6ae96bbc54dafa933ca2b98dd7672d6e8aa9 100644 (file)
@@ -524,14 +524,8 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
        err = fill_subkey_cache(create_parent);
        if (!W_ERROR_IS_OK(err)) goto done;
 
-       err = regsubkey_ctr_addkey(create_parent->subkeys, path);
-       if (!W_ERROR_IS_OK(err)) goto done;
-
-       if (!store_reg_keys(create_parent->key, create_parent->subkeys)) {
-               TALLOC_FREE(create_parent->subkeys);
-               err = WERR_REG_IO_FAILURE;
-               goto done;
-       }
+       err = create_reg_subkey(key->key, path);
+       W_ERROR_NOT_OK_GOTO_DONE(err);
 
        /*
         * Now open the newly created key