+struct hfsmount;
+
+/*
+ * Catalog FileID/CNID Acquisition / Lookup
+ *
+ * Some use-cases require that we find a valid CNID
+ * before we may be ready to enter the item into the namespace.
+ * In order to resolve this, we support a hashtable attached to
+ * the mount that is secured by the catalog lock.
+ *
+ * Finding the next valid CNID is easy if the wraparound bit is
+ * not set -- you just pull from the hfsmp next pointer.
+ * If it is set then you must find a free entry in the catalog
+ * and also query the hashtable to see if the item is free or not.
+ *
+ * If you want to request a CNID before there is a backing item
+ * in the catalog, you must find one that is valid, then insert
+ * it into the hash table until such time that the item is
+ * inserted into the catalog. After successful catalog insertion,
+ * you must remove the item from the hashtable.
+ */
+
+typedef struct cat_preflightid {
+ cnid_t fileid;
+ LIST_ENTRY(cat_preflightid) id_hash;
+} cat_preflightid_t;
+
+extern int cat_remove_idhash (cat_preflightid_t *preflight);
+extern int cat_insert_idhash (struct hfsmount *hfsmp, cat_preflightid_t *preflight);
+extern int cat_check_idhash (struct hfsmount *hfsmp, cnid_t test_fileid);
+
+/* initialize the id look up hashtable during mount */
+extern void hfs_idhash_init (struct hfsmount *hfsmp);
+
+/* release the id lookup hashtable during unmount */
+extern void hfs_idhash_destroy (struct hfsmount *hfsmp);
+
+/* Get a new CNID for use */
+extern int cat_acquire_cnid (struct hfsmount *hfsmp, cnid_t *new_cnid);
+
+
+/* default size of ID hash is 64 entries */
+#define HFS_IDHASH_DEFAULT 64
+