s3:idmap_tdb2: move idmap_tdb2_alloc_load() up to reduce need for prototype
authorMichael Adam <obnox@samba.org>
Wed, 16 Jun 2010 15:28:34 +0000 (17:28 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 09:23:57 +0000 (11:23 +0200)
source3/winbindd/idmap_tdb2.c

index 979eb53790af8b40f61c6287ca83693c4d83541c..f679553b455f6d87a325907b2f4c66c405a8597a 100644 (file)
@@ -51,42 +51,6 @@ static NTSTATUS idmap_tdb2_new_mapping(struct idmap_domain *dom,
 /* handle to the permanent tdb */
 static struct db_context *idmap_tdb2;
 
-static NTSTATUS idmap_tdb2_alloc_load(struct idmap_domain *dom);
-
-/*
-  open the permanent tdb
- */
-static NTSTATUS idmap_tdb2_open_db(struct idmap_domain *dom)
-{
-       char *db_path;
-
-       if (idmap_tdb2) {
-               /* its already open */
-               return NT_STATUS_OK;
-       }
-
-       db_path = lp_parm_talloc_string(-1, "tdb", "idmap2.tdb", NULL);
-       if (db_path == NULL) {
-               /* fall back to the private directory, which, despite
-                  its name, is usually on shared storage */
-               db_path = talloc_asprintf(NULL, "%s/idmap2.tdb", lp_private_dir());
-       }
-       NT_STATUS_HAVE_NO_MEMORY(db_path);
-
-       /* Open idmap repository */
-       idmap_tdb2 = db_open(NULL, db_path, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644);
-       TALLOC_FREE(db_path);
-
-       if (idmap_tdb2 == NULL) {
-               DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n",
-                         db_path));
-               return NT_STATUS_UNSUCCESSFUL;
-       }
-
-       /* load the ranges and high/low water marks */
-       return idmap_tdb2_alloc_load(dom);
-}
-
 
 /*
   load the idmap allocation ranges and high/low water marks
@@ -123,6 +87,41 @@ static NTSTATUS idmap_tdb2_alloc_load(struct idmap_domain *dom)
 }
 
 
+/*
+  open the permanent tdb
+ */
+static NTSTATUS idmap_tdb2_open_db(struct idmap_domain *dom)
+{
+       char *db_path;
+
+       if (idmap_tdb2) {
+               /* its already open */
+               return NT_STATUS_OK;
+       }
+
+       db_path = lp_parm_talloc_string(-1, "tdb", "idmap2.tdb", NULL);
+       if (db_path == NULL) {
+               /* fall back to the private directory, which, despite
+                  its name, is usually on shared storage */
+               db_path = talloc_asprintf(NULL, "%s/idmap2.tdb", lp_private_dir());
+       }
+       NT_STATUS_HAVE_NO_MEMORY(db_path);
+
+       /* Open idmap repository */
+       idmap_tdb2 = db_open(NULL, db_path, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644);
+       TALLOC_FREE(db_path);
+
+       if (idmap_tdb2 == NULL) {
+               DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n",
+                         db_path));
+               return NT_STATUS_UNSUCCESSFUL;
+       }
+
+       /* load the ranges and high/low water marks */
+       return idmap_tdb2_alloc_load(dom);
+}
+
+
 /*
   Allocate a new id. 
 */