Lines Matching refs:hdp
287 static int cache_alloc(struct di_devlink_handle *hdp);
288 static int open_db(struct di_devlink_handle *hdp, int flags);
289 static int invalid_db(struct di_devlink_handle *hdp, size_t fsize, long pg_sz);
290 static int read_nodes(struct di_devlink_handle *hdp, cache_node_t *pcnp,
292 static int read_minors(struct di_devlink_handle *hdp, cache_node_t *pcnp,
294 static int read_links(struct di_devlink_handle *hdp, cache_minor_t *pcmp,
296 static int init_hdr(struct di_devlink_handle *hdp, long page_sz,
298 static size_t size_db(struct di_devlink_handle *hdp, long page_sz,
300 static size_t seg_size(struct di_devlink_handle *hdp, int seg);
302 static cache_node_t *node_insert(struct di_devlink_handle *hdp,
304 static cache_minor_t *minor_insert(struct di_devlink_handle *hdp,
307 static cache_link_t *link_insert(struct di_devlink_handle *hdp,
310 static void minor_delete(di_devlink_handle_t hdp, cache_minor_t *cmnp);
311 static void link_delete(di_devlink_handle_t hdp, cache_link_t *clp);
313 static int write_nodes(struct di_devlink_handle *hdp, struct db_node *pdnp,
315 static int write_minors(struct di_devlink_handle *hdp, struct db_node *pdnp,
317 static int write_links(struct di_devlink_handle *hdp, struct db_minor *pdmp,
319 static void rm_link_from_hash(struct di_devlink_handle *hdp, cache_link_t *clp);
320 static uint32_t write_string(struct di_devlink_handle *hdp, const char *str,
322 static int close_db(struct di_devlink_handle *hdp);
323 static void cache_free(struct di_devlink_handle *hdp);
325 static void resolve_dangling_links(struct di_devlink_handle *hdp);
326 static void subtree_free(struct di_devlink_handle *hdp, cache_node_t **pp);
328 static void minor_free(struct di_devlink_handle *hdp, cache_minor_t **pp);
337 static void *lookup_node(struct di_devlink_handle *hdp, char *path,
339 static cache_link_t *add_link(struct di_devlink_handle *hdp, const char *link,
342 static void *lookup_minor(struct di_devlink_handle *hdp, const char *minor_path,
344 static cache_link_t *link_hash(di_devlink_handle_t hdp, const char *link,
347 static void hash_insert(struct di_devlink_handle *hdp, cache_link_t *clp);
348 static uint_t hashfn(struct di_devlink_handle *hdp, const char *str);
349 static void get_db_path(struct di_devlink_handle *hdp, const char *fname,
352 static struct db_node *get_node(struct di_devlink_handle *hdp, uint32_t idx);
353 static struct db_node *set_node(struct di_devlink_handle *hdp, uint32_t idx);
355 static struct db_minor *get_minor(struct di_devlink_handle *hdp, uint32_t idx);
356 static struct db_minor *set_minor(struct di_devlink_handle *hdp, uint32_t idx);
358 static struct db_link *get_link(struct di_devlink_handle *hdp, uint32_t idx);
359 static struct db_link *set_link(struct di_devlink_handle *hdp, uint32_t idx);
361 static char *get_string(struct di_devlink_handle *hdp, uint32_t idx);
362 static char *set_string(struct di_devlink_handle *hdp, uint32_t idx);
364 static void *map_seg(struct di_devlink_handle *hdp, uint32_t idx, int prot,
367 static int walk_db(struct di_devlink_handle *hdp, link_desc_t *linkp);
368 static int walk_all_links(struct di_devlink_handle *hdp, link_desc_t *linkp);
369 static int walk_matching_links(struct di_devlink_handle *hdp,
371 static int visit_link(struct di_devlink_handle *hdp, link_desc_t *linkp,
374 static void walk_cache_minor(di_devlink_handle_t hdp, const char *mpath,
376 static int walk_cache_links(di_devlink_handle_t hdp, cache_link_t *clp,
378 static void walk_all_cache(di_devlink_handle_t hdp, link_desc_t *linkp);
379 static int cache_dev_link(struct di_devlink_handle *hdp, void *data,
382 static int walk_dev(struct di_devlink_handle *hdp, link_desc_t *linkp);
383 static int recurse_dev(struct di_devlink_handle *hdp, recurse_t *rp);
384 static int do_recurse(const char *dir, struct di_devlink_handle *hdp,
392 static void *get_last_node(struct di_devlink_handle *hdp, const char *path,
394 static void *get_last_minor(struct di_devlink_handle *hdp,
396 static void set_last_minor(struct di_devlink_handle *hdp, cache_minor_t *cmnp,
399 static int enter_db_lock(struct di_devlink_handle *hdp, const char *root_dir);
400 static void exit_db_lock(struct di_devlink_handle *hdp);
403 static const char *rel_path(struct di_devlink_handle *hdp, const char *path);
406 static cache_minor_t *link2minor(struct di_devlink_handle *hdp,
409 static void delete_unused_nodes(di_devlink_handle_t hdp, cache_node_t *cnp);
410 static void delete_unused_minor(di_devlink_handle_t hdp, cache_minor_t *cmnp);
411 static int synchronize_db(di_devlink_handle_t hdp);