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, 26 Feb 2009 12:22:55 +0000 (13:22 +0100)
Instead of calling store_reg_keys()

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

Michael

source3/registry/reg_api.c

index 7185b1a312b0d162189daefa048bea6853baac26..9f6ed20568db1d287b37d9a8c9c4098d2117c2d5 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