#include <errno.h>#include <inttypes.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <time.h>#include <utime.h>#include <talloc.h>#include <atalk/byteorder.h>#include <atalk/compat.h>#include <atalk/dalloc.h>#include <atalk/errchk.h>#include <atalk/iniparser_util.h>#include <atalk/list.h>#include <atalk/logger.h>#include <atalk/netatalk_conf.h>#include <atalk/spotlight.h>#include <atalk/util.h>#include <atalk/volume.h>#include "directory.h"#include "etc/spotlight/spotlight_private.h"Data Structures | |
| struct | slq_state_names |
Macros | |
| #define | USE_LIST |
| #define | MAX_SL_RESULTS 20 |
| #define | MAX_SL_QUERY_IDLE_TIME_ACTIVE 60 |
| #define | MAX_SL_QUERY_IDLE_TIME_TERMINAL 300 |
Functions | |
| static int | cnid_comp_fn (const void *p1, const void *p2) |
| static bool | create_result_handle (slq_t *slq) |
| static char * | tab_level (TALLOC_CTX *mem_ctx, int level) |
| int | sl_index_event (const AFPObj *obj, const struct vol *vol, sl_index_event_t event, const char *path, const char *oldpath) |
| static char * | dd_dump (DALLOC_CTX *dd, int nestinglevel) |
| static int | sl_createCNIDArray (slq_t *slq, const DALLOC_CTX *p) |
| bool | add_filemeta (sl_array_t *reqinfo, sl_array_t *fm_array, const char *path, const struct stat *sp) |
| Add requested metadata for a query result element. | |
| static bool | add_results (sl_array_t *array, slq_t *slq) |
| static | ATALK_LIST_HEAD (sl_queries) |
| static | ATALK_LIST_HEAD (sl_cancelled_queries) |
| static void | slq_add (slq_t *slq) |
| static void | slq_cancelled_add (slq_t *slq) |
| static void | slq_remove (slq_t *slq) |
| static slq_t * | slq_for_ctx (uint64_t ctx1, uint64_t ctx2) |
| static void | slq_destroy (slq_t *slq) |
| static void | slq_cancel (slq_t *slq) |
| static void | slq_cancelled_cleanup (void) |
| static void | slq_idle_cleanup (void) |
| static void | slq_dump (void) |
| static int | sl_rpc_fetchPropertiesForContext (const AFPObj *obj, const DALLOC_CTX *query, DALLOC_CTX *reply, const struct vol *v) |
| static int | sl_rpc_openQuery (AFPObj *obj, const DALLOC_CTX *query, DALLOC_CTX *reply, struct vol *v) |
| static int | sl_rpc_fetchQueryResultsForContext (const AFPObj *obj, const DALLOC_CTX *query, DALLOC_CTX *reply, const struct vol *v) |
| static int | sl_rpc_storeAttributesForOIDArray (const AFPObj *obj, const DALLOC_CTX *query, DALLOC_CTX *reply, const struct vol *vol) |
| static int | sl_rpc_fetchAttributeNamesForOIDArray (const AFPObj *obj, const DALLOC_CTX *query, DALLOC_CTX *reply, const struct vol *vol) |
| static int | sl_rpc_fetchAttributesForOIDArray (AFPObj *obj, const DALLOC_CTX *query, DALLOC_CTX *reply, const struct vol *vol) |
| static int | sl_rpc_closeQueryForContext (const AFPObj *obj, const DALLOC_CTX *query, DALLOC_CTX *reply, const struct vol *v) |
| int | afp_spotlight_rpc (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
Variables | |
| static struct slq_state_names | slq_state_names [] |
| #define MAX_SL_QUERY_IDLE_TIME_ACTIVE 60 |
| #define MAX_SL_QUERY_IDLE_TIME_TERMINAL 300 |
| #define MAX_SL_RESULTS 20 |
| #define USE_LIST |
| bool add_filemeta | ( | sl_array_t * | reqinfo, |
| sl_array_t * | fm_array, | ||
| const char * | path, | ||
| const struct stat * | sp ) |
Add requested metadata for a query result element.
This could be rewritten to something more sophisticated like querying metadata from Tracker.
If path or sp is NULL, simply add nil values for all attributes.
|
static |
| int afp_spotlight_rpc | ( | AFPObj * | obj, |
| char * | ibuf, | ||
| size_t | ibuflen, | ||
| char * | rbuf, | ||
| size_t * | rbuflen ) |
|
static |
|
static |
|
static |
|
static |
Allocate result handle used in the async search backend result handler for storing results
|
static |
|
static |
| int sl_index_event | ( | const AFPObj * | obj, |
| const struct vol * | vol, | ||
| sl_index_event_t | event, | ||
| const char * | path, | ||
| const char * | oldpath ) |
|
static |
|
static |
|
static |
|
static |
Return true if any currently-open volume uses the localsearch backend
|
static |
|
static |
|
static |
|
static |
Add a query to the list of active queries
|
static |
Cancel a query (move to cancelled list; backend cleanup deferred)
|
static |
Add a query to the list of cancelled queries
|
static |
Free all fully-cancelled queries
|
static |
Invoke the backend close_query hook then free the slq
|
static |
|
static |
|
static |
Cancel or destroy queries idle longer than MAX_SL_QUERY_IDLE_TIME
|
static |
Remove a query from the active list
Uses pointer identity rather than ctx-value comparison so that a query that was never enqueued (e.g. openQuery failure before slq_add()) cannot accidentally remove an unrelated active query whose ctx IDs happen to match the zero-initialized or partially-parsed values.
|
static |
|
static |