From: Volker Lendecke Date: Wed, 17 May 2017 14:40:45 +0000 (+0200) Subject: g_lock: Remove unused g_lock_get X-Git-Tag: ldb-1.1.31~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6358901f152e72cad5e7718e01e79551fa6195a6;p=thirdparty%2Fsamba.git g_lock: Remove unused g_lock_get Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/g_lock.h b/source3/include/g_lock.h index f513349bfc2..998a9da8544 100644 --- a/source3/include/g_lock.h +++ b/source3/include/g_lock.h @@ -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_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, diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index f9eb5ef7e9f..d0302cde443 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -558,39 +558,6 @@ NTSTATUS g_lock_dump(struct g_lock_ctx *ctx, const char *name, 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,