g_lock: Remove unused g_lock_get
authorVolker Lendecke <vl@samba.org>
Wed, 17 May 2017 14:40:45 +0000 (16:40 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 15 Jun 2017 11:19:13 +0000 (13:19 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/g_lock.h
source3/lib/g_lock.c

index f513349bfc2e2cfc97d9f71eff429f404fe9947d..998a9da8544c400dabbc0a3d76ae8d66c2ed52df 100644 (file)
@@ -42,8 +42,6 @@ NTSTATUS g_lock_lock_recv(struct tevent_req *req);
 NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name,
                     enum g_lock_type lock_type, struct timeval timeout);
 NTSTATUS g_lock_unlock(struct g_lock_ctx *ctx, const char *name);
 NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name,
                     enum g_lock_type lock_type, struct timeval timeout);
 NTSTATUS g_lock_unlock(struct g_lock_ctx *ctx, const char *name);
-NTSTATUS g_lock_get(struct g_lock_ctx *ctx, const char *name,
-               struct server_id *pid);
 
 NTSTATUS g_lock_do(const char *name, enum g_lock_type lock_type,
                   struct timeval timeout,
 
 NTSTATUS g_lock_do(const char *name, enum g_lock_type lock_type,
                   struct timeval timeout,
index f9eb5ef7e9f7bff5259a912df5adf53bb8061748..d0302cde4431eb8cfc31e196e9d575a81f6c30a1 100644 (file)
@@ -558,39 +558,6 @@ NTSTATUS g_lock_dump(struct g_lock_ctx *ctx, const char *name,
        return NT_STATUS_OK;
 }
 
        return NT_STATUS_OK;
 }
 
-struct g_lock_get_state {
-       bool found;
-       struct server_id *pid;
-};
-
-static int g_lock_get_fn(struct server_id pid, enum g_lock_type lock_type,
-                        void *priv)
-{
-       struct g_lock_get_state *state = (struct g_lock_get_state *)priv;
-       state->found = true;
-       *state->pid = pid;
-       return 1;
-}
-
-NTSTATUS g_lock_get(struct g_lock_ctx *ctx, const char *name,
-                   struct server_id *pid)
-{
-       struct g_lock_get_state state;
-       NTSTATUS status;
-
-       state.found = false;
-       state.pid = pid;
-
-       status = g_lock_dump(ctx, name, g_lock_get_fn, &state);
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-       if (!state.found) {
-               return NT_STATUS_NOT_FOUND;
-       }
-       return NT_STATUS_OK;
-}
-
 static bool g_lock_init_all(TALLOC_CTX *mem_ctx,
                            struct tevent_context **pev,
                            struct messaging_context **pmsg,
 static bool g_lock_init_all(TALLOC_CTX *mem_ctx,
                            struct tevent_context **pev,
                            struct messaging_context **pmsg,