s3:lib: remove unused connections_fetch_entry*() and connections_init()
authorStefan Metzmacher <metze@samba.org>
Fri, 5 Oct 2012 17:05:32 +0000 (19:05 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 19 Oct 2012 10:15:03 +0000 (12:15 +0200)
metze

Signed-off-by: Michael Adam <obnox@samba.org>
source3/lib/conn_tdb.c
source3/lib/conn_tdb.h

index 3930e2736a5593a22142a2991b2bdc1d357f9682..a7e7cf02eb714024e340b6c1957711a57a1bc682 100644 (file)
 #include "lib/conn_tdb.h"
 #include "util_tdb.h"
 
-static struct db_context *connections_db_ctx(bool rw)
-{
-       static struct db_context *db_ctx;
-       int open_flags;
-
-       if (db_ctx != NULL) {
-               return db_ctx;
-       }
-
-       open_flags = rw ? (O_RDWR|O_CREAT) : O_RDONLY;
-
-       db_ctx = db_open(NULL, lock_path("connections.tdb"), 0,
-                        TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH|TDB_DEFAULT,
-                        open_flags, 0644, DBWRAP_LOCK_ORDER_1);
-       return db_ctx;
-}
-
-static struct db_record *connections_fetch_record(TALLOC_CTX *mem_ctx,
-                                                 TDB_DATA key)
-{
-       struct db_context *ctx = connections_db_ctx(True);
-
-       if (ctx == NULL) {
-               return NULL;
-       }
-
-       return dbwrap_fetch_locked(ctx, mem_ctx, key);
-}
-
-struct db_record *connections_fetch_entry_ext(TALLOC_CTX *mem_ctx,
-                                             struct server_id id,
-                                             int cnum,
-                                             const char *name)
-{
-       struct connections_key ckey;
-       TDB_DATA key;
-
-       ZERO_STRUCT(ckey);
-       ckey.pid = id;
-       ckey.cnum = cnum;
-       strlcpy(ckey.name, name, sizeof(ckey.name));
-
-       key.dsize = sizeof(ckey);
-       key.dptr = (uint8 *)&ckey;
-
-       return connections_fetch_record(mem_ctx, key);
-}
-
-struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
-                                         connection_struct *conn,
-                                         const char *name)
-{
-       struct server_id id = messaging_server_id(conn->sconn->msg_ctx);
-       return connections_fetch_entry_ext(mem_ctx, id, conn->cnum, name);
-}
-
 struct connections_forall_state {
        struct db_context *session_by_pid;
        int (*fn)(const struct connections_key *key,
@@ -200,7 +144,3 @@ done:
        return ret;
 }
 
-bool connections_init(bool rw)
-{
-       return (connections_db_ctx(rw) != NULL);
-}
index 2f45281a819976fbc3a9346f8daad0c2ba56814d..b91a153740dfbba1efa8fcaf0037b45d8746530b 100644 (file)
@@ -37,15 +37,7 @@ struct connections_data {
 
 /* The following definitions come from lib/conn_tdb.c  */
 
-struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
-                                         connection_struct *conn,
-                                         const char *name);
-struct db_record *connections_fetch_entry_ext(TALLOC_CTX *mem_ctx,
-                                             struct server_id id,
-                                             int cnum,
-                                             const char *name);
 int connections_forall_read(int (*fn)(const struct connections_key *key,
                                      const struct connections_data *data,
                                      void *private_data),
                            void *private_data);
-bool connections_init(bool rw);