+/*!
+ @function vn_path_package_check
+ @abstract Figure out if a path corresponds to a Mac OS X package.
+ @discussion Determines if the extension on a path is a known OS X extension type.
+ @param vp Unused.
+ @param path Path to check.
+ @param pathlen Size of path buffer.
+ @param component Set to index of start of last path component if the path is found to be a package. Set to -1 if
+ the path is not a known package type.
+ @return 0 unless some parameter was invalid, in which case EINVAL is returned. Determine package-ness by checking
+ what *component is set to.
+ */
+int vn_path_package_check(vnode_t vp, char *path, int pathlen, int *component);
+
+#ifdef KERNEL_PRIVATE
+/*!
+ @function vn_searchfs_inappropriate_name
+ @abstract Figure out if the component is inappropriate for a SearchFS query.
+ @param name component to check
+ @param len length of component.
+ @return 0 if no match, 1 if inappropriate.
+ */
+int vn_searchfs_inappropriate_name(const char *name, int len);
+#endif
+
+/*!
+ @function vn_rdwr
+ @abstract Read from or write to a file.
+ @discussion vn_rdwr() abstracts the details of constructing a uio and picking a vnode operation to allow
+ simple in-kernel file I/O.
+ @param rw UIO_READ for a read, UIO_WRITE for a write.
+ @param vp The vnode on which to perform I/O.
+ @param base Start of buffer into which to read or from which to write data.
+ @param len Length of buffer.
+ @param offset Offset within the file at which to start I/O.
+ @param segflg What kind of address "base" is. See uio_seg definition in sys/uio.h. UIO_SYSSPACE for kernelspace, UIO_USERSPACE for userspace.
+ UIO_USERSPACE32 and UIO_USERSPACE64 are in general preferred, but vn_rdwr will make sure that has the correct address sizes.
+ @param ioflg Defined in vnode.h, e.g. IO_NOAUTH, IO_NOCACHE.
+ @param cred Credential to pass down to filesystem for authentication.
+ @param aresid Destination for amount of requested I/O which was not completed, as with uio_resid().
+ @param p Process requesting I/O.
+ @return 0 for success; errors from filesystem, and EIO if did not perform all requested I/O and the "aresid" parameter is NULL.
+ */
+int vn_rdwr(enum uio_rw, vnode_t, caddr_t, int, off_t, enum uio_seg, int, kauth_cred_t, int *, proc_t);
+
+/*!
+ @function vnode_getname
+ @abstract Get the name of a vnode from the VFS namecache.
+ @discussion Not all vnodes have names, and vnode names can change (notably, hardlinks). Use this routine at your own risk.
+ The string is returned with a refcount incremented in the cache; callers must call vnode_putname() to release that reference.
+ @param vp The vnode whose name to grab.
+ @return The name, or NULL if unavailable.
+ */
+const char *vnode_getname(vnode_t vp);
+
+/*!
+ @function vnode_putname
+ @abstract Release a reference on a name from the VFS cache.
+ @discussion Should be called on a string obtained with vnode_getname().
+ @param name String to release.
+ @return void.
+ */
+void vnode_putname(const char *name);
+
+/*!
+ @function vnode_getparent
+ @abstract Get an iocount on the parent of a vnode.
+ @discussion A vnode's parent may change over time or be reclaimed, so vnode_getparent() may return different
+ results at different times (e.g. a multiple-hardlink file). The parent is returned with an iocount which must
+ subsequently be dropped with vnode_put().
+ @param vp The vnode whose parent to grab.
+ @return Parent if available, else NULL.
+ */
+vnode_t vnode_getparent(vnode_t vp);
+
+#ifdef KERNEL_PRIVATE
+/*!
+ @function vnode_lookup_continue_needed
+ @abstract Determine whether vnode needs additional processing in VFS before being opened.
+ @discussion If result is zero, filesystem can open this vnode. If result is nonzero,
+ additional processing is needed in VFS (e.g. symlink, mountpoint). Nonzero results should
+ be passed up to VFS.
+ @param vp Vnode to consider opening (found by filesystem).
+ @param cnp Componentname as passed to filesystem from VFS.
+ @result 0 to indicate that a vnode can be opened, or an error that should be passed up to VFS.
+ */
+int vnode_lookup_continue_needed(vnode_t vp, struct componentname *cnp);
+
+/*!
+ @function vnode_istty
+ @abstract Determine if the given vnode represents a tty device.
+ @param vp Vnode to examine.
+ @result Non-zero to indicate that the vnode represents a tty device. Zero otherwise.
+ */
+int vnode_istty(vnode_t vp);
+#endif /* KERNEL_PRIVATE */
+
+#ifdef BSD_KERNEL_PRIVATE
+/* Not in export list so can be private */
+struct stat;
+int vn_stat(struct vnode *vp, void * sb, kauth_filesec_t *xsec, int isstat64, vfs_context_t ctx);
+int vn_stat_noauth(struct vnode *vp, void * sb, kauth_filesec_t *xsec, int isstat64, vfs_context_t ctx);
+int vaccess(mode_t file_mode, uid_t uid, gid_t gid,
+ mode_t acc_mode, kauth_cred_t cred);
+int check_mountedon(dev_t dev, enum vtype type, int *errorp);
+int vn_getcdhash(struct vnode *vp, off_t offset, unsigned char *cdhash);
+void vnode_reclaim(vnode_t);
+vfs_context_t vfs_context_kernel(void); /* get from 1st kernel thread */
+int vfs_context_issuser(vfs_context_t);
+vnode_t vfs_context_cwd(vfs_context_t);
+vnode_t current_rootdir(void);
+vnode_t current_workingdir(void);
+void *vnode_vfsfsprivate(vnode_t);
+struct vfsstatfs *vnode_vfsstatfs(vnode_t);
+uint32_t vnode_vfsvisflags(vnode_t);
+uint32_t vnode_vfscmdflags(vnode_t);
+int vnode_is_openevt(vnode_t);
+void vnode_set_openevt(vnode_t);
+void vnode_clear_openevt(vnode_t);
+int vnode_isstandard(vnode_t);
+int vnode_makeimode(int, int);
+enum vtype vnode_iftovt(int);
+int vnode_vttoif(enum vtype);
+int vnode_isshadow(vnode_t);
+/*
+ * Indicate that a file has multiple hard links. VFS will always call
+ * VNOP_LOOKUP on this vnode. Volfs will always ask for it's parent
+ * object ID (instead of using the v_parent pointer).
+ */
+vnode_t vnode_parent(vnode_t);
+void vnode_setparent(vnode_t, vnode_t);
+const char * vnode_name(vnode_t);
+void vnode_setname(vnode_t, char *);
+int vnode_isnoflush(vnode_t);
+void vnode_setnoflush(vnode_t);
+void vnode_clearnoflush(vnode_t);
+/* XXX temporary until we can arrive at a KPI for NFS, Seatbelt */
+thread_t vfs_context_thread(vfs_context_t);
+
+#endif /* BSD_KERNEL_PRIVATE */
+