From: Ralph Boehme Date: Tue, 12 Mar 2019 14:29:48 +0000 (+0100) Subject: s3-mdssvc: make mds_ctx_destructor_cb static X-Git-Tag: tdb-1.4.1~306 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=003b5d3ee4c8a44ad9062fbee4cec45738b5a9bd;p=thirdparty%2Fsamba.git s3-mdssvc: make mds_ctx_destructor_cb static This is only used in this compilation unit. Signed-off-by: Ralph Boehme Reviewed-by: Noel Power --- diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c index 693675fff6f..7111f0e87ca 100644 --- a/source3/rpc_server/mdssvc/mdssvc.c +++ b/source3/rpc_server/mdssvc/mdssvc.c @@ -1860,6 +1860,36 @@ bool mds_shutdown(void) return true; } +/** + * Tear down connections and free all resources + **/ +static int mds_ctx_destructor_cb(struct mds_ctx *mds_ctx) +{ + /* + * We need to free query_list before ino_path_map + */ + while (mds_ctx->query_list != NULL) { + /* + * slq destructor removes element from list. + * Don't use TALLOC_FREE()! + */ + talloc_free(mds_ctx->query_list); + } + TALLOC_FREE(mds_ctx->ino_path_map); + + if (mds_ctx->tracker_con != NULL) { + g_object_unref(mds_ctx->tracker_con); + } + if (mds_ctx->gcancellable != NULL) { + g_cancellable_cancel(mds_ctx->gcancellable); + g_object_unref(mds_ctx->gcancellable); + } + + ZERO_STRUCTP(mds_ctx); + + return 0; +} + /** * Initialise a context per RPC bind * @@ -1919,36 +1949,6 @@ error: return NULL; } -/** - * Tear down connections and free all resources - **/ -int mds_ctx_destructor_cb(struct mds_ctx *mds_ctx) -{ - /* - * We need to free query_list before ino_path_map - */ - while (mds_ctx->query_list != NULL) { - /* - * slq destructor removes element from list. - * Don't use TALLOC_FREE()! - */ - talloc_free(mds_ctx->query_list); - } - TALLOC_FREE(mds_ctx->ino_path_map); - - if (mds_ctx->tracker_con != NULL) { - g_object_unref(mds_ctx->tracker_con); - } - if (mds_ctx->gcancellable != NULL) { - g_cancellable_cancel(mds_ctx->gcancellable); - g_object_unref(mds_ctx->gcancellable); - } - - ZERO_STRUCTP(mds_ctx); - - return 0; -} - /** * Dispatch a Spotlight RPC command **/ diff --git a/source3/rpc_server/mdssvc/mdssvc.h b/source3/rpc_server/mdssvc/mdssvc.h index b9e3e56f785..baf0e92f8f2 100644 --- a/source3/rpc_server/mdssvc/mdssvc.h +++ b/source3/rpc_server/mdssvc/mdssvc.h @@ -129,7 +129,6 @@ extern struct mds_ctx *mds_init_ctx(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct auth_session_info *session_info, const char *path); -extern int mds_ctx_destructor_cb(struct mds_ctx *mds_ctx); extern bool mds_dispatch(struct mds_ctx *query_ctx, struct mdssvc_blob *request_blob, struct mdssvc_blob *response_blob);