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
*
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
**/
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);