+__options_decl(vnode_verify_flags_t, uint32_t, {
+ VNODE_VERIFY_DEFAULT = 0,
+});
+
+#define VNODE_VERIFY_DEFAULT VNODE_VERIFY_DEFAULT
+
+struct vnop_verify_args {
+ struct vnodeop_desc *a_desc;
+ vnode_t a_vp;
+ off_t a_foffset;
+ uint8_t *a_buf;
+ size_t a_bufsize;
+ size_t *a_verifyblksize;
+ vnode_verify_flags_t a_flags;
+ vfs_context_t a_context;
+};
+
+/*!
+ * @function VNOP_VERIFY
+ * @abstract Call down to a filesystem to verify file data for integrity.
+ * @discussion VNOP_VERIFY() returns whether file data being read has been verified to be what was written.
+ * This does not impose a specific mechanism for ensuring integrity beyond requiring that this be done in
+ * multiples of a verify block size (analogous to a filesystem block size but it can be per file)
+ * @param vp The vnode for which data is to be verified.
+ * @param foffset Offset (in bytes) at which region to be verified starts.
+ * @param buf buffer containing file data at foffset. If this is NULL, then only the verification block size is
+ * being requested.
+ * @param bufsize size of data buffer to be verified.
+ * @param verifyblksize pointer to size of verification block size in use for this file. If the verification block size is 0,
+ * no verification will be performed. The verification block size can be any value which is a power of two upto 128KiB.
+ * @param flags modifier flags.
+ * @param ctx Context to authenticate for verify request; currently often set to NULL.
+ * @return 0 for success, else an error code.
+ */
+#ifdef XNU_KERNEL_PRIVATE
+extern errno_t VNOP_VERIFY(vnode_t, off_t, uint8_t *, size_t, size_t *, vnode_verify_flags_t, vfs_context_t);
+#endif /* XNU_KERNEL_PRIVATE */
+