/*
- * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#include <sys/cdefs.h>
#ifdef KERNEL
#include <sys/kernel_types.h>
+#include <sys/param.h>
#include <sys/signal.h>
#endif
/*
* Vnode types. VNON means no type.
*/
-enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD, VSTR,
- VCPLX };
+enum vtype {
+ /* 0 */
+ VNON,
+ /* 1 - 5 */
+ VREG, VDIR, VBLK, VCHR, VLNK,
+ /* 6 - 10 */
+ VSOCK, VFIFO, VBAD, VSTR, VCPLX
+};
/*
* Vnode tag types.
* and should NEVER be inspected by the kernel.
*/
enum vtagtype {
- VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_MSDOSFS, VT_LFS, VT_LOFS, VT_FDESC,
- VT_PORTAL, VT_NULL, VT_UMAP, VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS,
- VT_UNION, VT_HFS, VT_ZFS, VT_DEVFS, VT_WEBDAV, VT_UDF, VT_AFP,
- VT_CDDA, VT_CIFS, VT_OTHER};
+ /* 0 */
+ VT_NON,
+ /* 1 reserved, overlaps with (CTL_VFS, VFS_NUMMNTOPS) */
+ VT_UFS,
+ /* 2 - 5 */
+ VT_NFS, VT_MFS, VT_MSDOSFS, VT_LFS,
+ /* 6 - 10 */
+ VT_LOFS, VT_FDESC, VT_PORTAL, VT_NULL, VT_UMAP,
+ /* 11 - 15 */
+ VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS, VT_MOCKFS,
+ /* 16 - 20 */
+ VT_HFS, VT_ZFS, VT_DEVFS, VT_WEBDAV, VT_UDF,
+ /* 21 - 24 */
+ VT_AFP, VT_CDDA, VT_CIFS, VT_OTHER
+};
/*
#define IO_BACKGROUND IO_PASSIVE /* used for backward compatibility. to be removed after IO_BACKGROUND is no longer
* used by DiskImages in-kernel mode */
#define IO_NOAUTH 0x8000 /* No authorization checks. */
-#define IO_NODIRECT 0x10000 /* don't use direct synchronous writes if IO_NOCACHE is specified */
-
+#define IO_NODIRECT 0x10000 /* don't use direct synchronous writes if IO_NOCACHE is specified */
+#define IO_ENCRYPTED 0x20000 /* Retrieve encrypted blocks from the filesystem */
+#define IO_RETURN_ON_THROTTLE 0x40000
+#define IO_SINGLE_WRITER 0x80000
+#define IO_SYSCALL_DISPATCH 0x100000 /* I/O was originated from a file table syscall */
+#define IO_SWAP_DISPATCH 0x200000 /* I/O was originated from the swap layer */
+#define IO_SKIP_ENCRYPTION 0x400000 /* Skips en(de)cryption on the IO. Must be initiated from kernel */
+#define IO_EVTONLY 0x800000 /* the i/o is being done on an fd that's marked O_EVTONLY */
/*
* Component Name: this structure describes the pathname
* component name operational modifier flags
*/
#define FOLLOW 0x00000040 /* follow symbolic links */
-#define NOTRIGGER 0x10000000 /* don't trigger automounts */
/*
* component name parameter descriptors.
#define ISDOTDOT 0x00002000 /* current component name is .. */
#define MAKEENTRY 0x00004000 /* entry is to be added to name cache */
#define ISLASTCN 0x00008000 /* this is last component of pathname */
-#define ISWHITEOUT 0x00020000 /* OBSOLETE: found whiteout */
-#define DOWHITEOUT 0x00040000 /* OBSOLETE: do whiteouts */
-
/* The following structure specifies a vnode for creation */
struct vnode_fsparam {
#define VNCREATE_FLAVOR 0
#define VCREATESIZE sizeof(struct vnode_fsparam)
+#ifdef KERNEL_PRIVATE
+/*
+ * For use with SPI to create trigger vnodes.
+ */
+struct vnode_trigger_param;
+#define VNCREATE_TRIGGER (('T' << 8) + ('V'))
+#define VNCREATE_TRIGGER_SIZE sizeof(struct vnode_trigger_param)
+#endif /* KERNEL_PRIVATE */
#ifdef KERNEL_PRIVATE
OP_MAXOP /* anything beyond previous entry is invalid */
};
-/*
- * is operation a traditional trigger (autofs)?
- * 1 if trigger, 0 if no trigger
- */
-extern int vfs_istraditionaltrigger(enum path_operation op, const struct componentname *cnp);
-
/*!
@enum resolver status
@abstract Constants defining resolver status
uint32_t vnt_flags; /* optional flags (see below) */
};
-#define VNCREATE_TRIGGER (('T' << 8) + ('V'))
-#define VNCREATE_TRIGGER_SIZE sizeof(struct vnode_trigger_param)
-
/*
* vnode trigger flags (vnt_flags)
*
* Note that this structure may be extended, but existing fields must not move.
*/
-#define VATTR_INIT(v) do {(v)->va_supported = (v)->va_active = 0ll; (v)->va_vaflags = 0;} while(0)
+#define VATTR_INIT(v) do {(v)->va_supported = (v)->va_active = 0ll; (v)->va_vaflags = 0; } while(0)
#define VATTR_SET_ACTIVE(v, a) ((v)->va_active |= VNODE_ATTR_ ## a)
#define VATTR_SET_SUPPORTED(v, a) ((v)->va_supported |= VNODE_ATTR_ ## a)
#define VATTR_IS_SUPPORTED(v, a) ((v)->va_supported & VNODE_ATTR_ ## a)
#define VATTR_CLEAR_ACTIVE(v, a) ((v)->va_active &= ~VNODE_ATTR_ ## a)
#define VATTR_CLEAR_SUPPORTED(v, a) ((v)->va_supported &= ~VNODE_ATTR_ ## a)
+#define VATTR_CLEAR_SUPPORTED_ALL(v) ((v)->va_supported = 0)
#define VATTR_IS_ACTIVE(v, a) ((v)->va_active & VNODE_ATTR_ ## a)
#define VATTR_ALL_SUPPORTED(v) (((v)->va_active & (v)->va_supported) == (v)->va_active)
#define VATTR_INACTIVE_SUPPORTED(v) do {(v)->va_active &= ~(v)->va_supported; (v)->va_supported = 0;} while(0)
#define VNODE_ATTR_va_guuid (1LL<<27) /* 08000000 */
#define VNODE_ATTR_va_nchildren (1LL<<28) /* 10000000 */
#define VNODE_ATTR_va_dirlinkcount (1LL<<29) /* 20000000 */
-#define VNODE_ATTR_va_addedtime (1LL<<30) /* 40000000 */
+#define VNODE_ATTR_va_addedtime (1LL<<30) /* 40000000 */
+#define VNODE_ATTR_va_dataprotect_class (1LL<<31) /* 80000000 */
+#define VNODE_ATTR_va_dataprotect_flags (1LL<<32) /* 100000000 */
+#define VNODE_ATTR_va_document_id (1LL<<33) /* 200000000 */
+#define VNODE_ATTR_va_devid (1LL<<34) /* 400000000 */
+#define VNODE_ATTR_va_objtype (1LL<<35) /* 800000000 */
+#define VNODE_ATTR_va_objtag (1LL<<36) /* 1000000000 */
+#define VNODE_ATTR_va_user_access (1LL<<37) /* 2000000000 */
+#define VNODE_ATTR_va_finderinfo (1LL<<38) /* 4000000000 */
+#define VNODE_ATTR_va_rsrc_length (1LL<<39) /* 8000000000 */
+#define VNODE_ATTR_va_rsrc_alloc (1LL<<40) /* 10000000000 */
+#define VNODE_ATTR_va_fsid64 (1LL<<41) /* 20000000000 */
+#define VNODE_ATTR_va_write_gencount (1LL<<42) /* 40000000000 */
#define VNODE_ATTR_BIT(n) (VNODE_ATTR_ ## n)
/*
VNODE_ATTR_BIT(va_name) | \
VNODE_ATTR_BIT(va_type) | \
VNODE_ATTR_BIT(va_nchildren) | \
- VNODE_ATTR_BIT(va_dirlinkcount)| \
- VNODE_ATTR_BIT(va_addedtime))
+ VNODE_ATTR_BIT(va_dirlinkcount) | \
+ VNODE_ATTR_BIT(va_addedtime) | \
+ VNODE_ATTR_BIT(va_devid) | \
+ VNODE_ATTR_BIT(va_objtype) | \
+ VNODE_ATTR_BIT(va_objtag) | \
+ VNODE_ATTR_BIT(va_user_access) | \
+ VNODE_ATTR_BIT(va_finderinfo) | \
+ VNODE_ATTR_BIT(va_rsrc_length) | \
+ VNODE_ATTR_BIT(va_rsrc_alloc) | \
+ VNODE_ATTR_BIT(va_fsid64) | \
+ VNODE_ATTR_BIT(va_write_gencount))
/*
* Attributes that can be applied to a new file object.
*/
VNODE_ATTR_BIT(va_encoding) | \
VNODE_ATTR_BIT(va_type) | \
VNODE_ATTR_BIT(va_uuuid) | \
- VNODE_ATTR_BIT(va_guuid))
+ VNODE_ATTR_BIT(va_guuid) | \
+ VNODE_ATTR_BIT(va_dataprotect_class) | \
+ VNODE_ATTR_BIT(va_dataprotect_flags) | \
+ VNODE_ATTR_BIT(va_document_id))
+#include <sys/_types/_fsid_t.h>
struct vnode_attr {
/* bitfields */
uint64_t va_nchildren; /* Number of items in a directory */
uint64_t va_dirlinkcount; /* Real references to dir (i.e. excluding "." and ".." refs) */
- /* add new fields here only */
#ifdef BSD_KERNEL_PRIVATE
struct kauth_acl *va_base_acl;
#else
void * va_reserved1;
#endif /* BSD_KERNEL_PRIVATE */
- struct timespec va_addedtime; /* timestamp when item was added to parent directory */
-
+ struct timespec va_addedtime; /* timestamp when item was added to parent directory */
+ /* Data Protection fields */
+ uint32_t va_dataprotect_class; /* class specified for this file if it didn't exist */
+ uint32_t va_dataprotect_flags; /* flags from NP open(2) to the filesystem */
+
+ /* Document revision tracking */
+ uint32_t va_document_id;
+
+ /* Fields for Bulk args */
+ uint32_t va_devid; /* devid of filesystem */
+ uint32_t va_objtype; /* type of object */
+ uint32_t va_objtag; /* vnode tag of filesystem */
+ uint32_t va_user_access; /* access for user */
+ uint8_t va_finderinfo[32]; /* Finder Info */
+ uint64_t va_rsrc_length; /* Resource Fork length */
+ uint64_t va_rsrc_alloc; /* Resource Fork allocation size */
+ fsid_t va_fsid64; /* fsid, of the correct type */
+
+ uint32_t va_write_gencount; /* counter that increments each time the file changes */
+
+ /* add new fields here only */
};
+#ifdef BSD_KERNEL_PRIVATE
+/*
+ * Flags for va_dataprotect_flags
+ */
+#define VA_DP_RAWENCRYPTED 0x0001
+#define VA_DP_RAWUNENCRYPTED 0x0002
+
+#endif
+
/*
* Flags for va_vaflags.
*/
#define REVOKEALL 0x0001 /* vnop_revoke: revoke all aliases */
-/* VNOP_REMOVE: do not delete busy files (Carbon remove file semantics) */
-#define VNODE_REMOVE_NODELETEBUSY 0x0001
+/* VNOP_REMOVE/unlink flags */
+#define VNODE_REMOVE_NODELETEBUSY 0x0001 /* Don't delete busy files (Carbon) */
+#define VNODE_REMOVE_SKIP_NAMESPACE_EVENT 0x0002 /* Do not upcall to userland handlers */
+#define VNODE_REMOVE_NO_AUDIT_PATH 0x0004 /* Do not audit the path */
/* VNOP_READDIR flags: */
#define VNODE_READDIR_EXTENDED 0x0001 /* use extended directory entries */
#define VNODE_READDIR_REQSEEKOFF 0x0002 /* requires seek offset (cookies) */
#define VNODE_READDIR_SEEKOFF32 0x0004 /* seek offset values should fit in 32 bits */
-
+#define VNODE_READDIR_NAMEMAX 0x0008 /* For extended readdir, try to limit names to NAME_MAX bytes */
#define NULLVP ((struct vnode *)NULL)
*/
errno_t vnode_create(uint32_t, uint32_t, void *, vnode_t *);
+#if KERNEL_PRIVATE
+/*!
+ @function vnode_create_empty
+ @abstract Create an empty, uninitialized vnode.
+ @discussion Returns with an iocount held on the vnode which must eventually be
+ dropped with vnode_put(). The next operation performed on the vnode must be
+ vnode_initialize (or vnode_put if the vnode is not needed anymore).
+ This interface is provided as a mechanism to pre-flight obtaining a vnode for
+ certain filesystem operations which may need to get a vnode without filesystem
+ locks held. It is imperative that nothing be done with the vnode till the
+ succeeding vnode_initialize (or vnode_put as the case may be) call.
+ @param vpp Pointer to a vnode pointer, to be filled in with newly created vnode.
+ @return 0 for success, error code otherwise.
+ */
+errno_t vnode_create_empty(vnode_t *);
+
+/*!
+ @function vnode_initialize
+ @abstract Initialize a vnode obtained by vnode_create_empty
+ @discussion Does not drop iocount held on the vnode which must eventually be
+ dropped with vnode_put(). In case of an error however, the vnode's iocount is
+ dropped and the vnode must not be referenced again by the caller.
+ @param flavor Should be VNCREATE_FLAVOR.
+ @param size Size of the struct vnode_fsparam in "data".
+ @param data Pointer to a struct vnode_fsparam containing initialization information.
+ @param vpp Pointer to a vnode pointer, to be filled in with newly created vnode.
+ @return 0 for success, error code otherwise.
+ */
+errno_t vnode_initialize(uint32_t, uint32_t, void *, vnode_t *);
+#endif /* KERNEL_PRIVATE */
+
/*!
@function vnode_addfsref
@abstract Mark a vnode as being stored in a filesystem hash.
*/
void vnode_clearnoreadahead(vnode_t);
+/*!
+ @function vnode_isfastdevicecandidate
+ @abstract Check if a vnode is a candidate to store on the fast device of a composite disk system
+ @param vp The vnode which you want to test.
+ @return Nonzero if the vnode is marked as a fast-device candidate
+ @return void.
+ */
+int vnode_isfastdevicecandidate(vnode_t);
+
+/*!
+ @function vnode_setfastdevicecandidate
+ @abstract Mark a vnode as a candidate to store on the fast device of a composite disk system
+ @abstract If the vnode is a directory, all its children will inherit this bit.
+ @param vp The vnode which you want marked.
+ @return void.
+ */
+void vnode_setfastdevicecandidate(vnode_t);
+
+/*!
+ @function vnode_clearfastdevicecandidate
+ @abstract Clear the status of a vnode being a candidate to store on the fast device of a composite disk system.
+ @param vp The vnode whose flag to clear.
+ @return void.
+ */
+void vnode_clearfastdevicecandidate(vnode_t);
+
+/*!
+ @function vnode_isautocandidate
+ @abstract Check if a vnode was automatically selected to be fast-dev candidate (see vnode_setfastdevicecandidate)
+ @param vp The vnode which you want to test.
+ @return Nonzero if the vnode was automatically marked as a fast-device candidate
+ @return void.
+ */
+int vnode_isautocandidate(vnode_t);
+
+/*!
+ @function vnode_setfastdevicecandidate
+ @abstract Mark a vnode as an automatically selected candidate for storing on the fast device of a composite disk system
+ @abstract If the vnode is a directory, all its children will inherit this bit.
+ @param vp The vnode which you want marked.
+ @return void.
+ */
+void vnode_setautocandidate(vnode_t);
+
+/*!
+ @function vnode_clearautocandidate
+ @abstract Clear the status of a vnode being an automatic candidate (see above)
+ @param vp The vnode whose flag to clear.
+ @return void.
+ */
+void vnode_clearautocandidate(vnode_t);
+
/* left only for compat reasons as User code depends on this from getattrlist, for ex */
/*!
@abstract Get the credential associated with a vfs_context_t.
@discussion Succeeds if and only if the context has a thread, the thread has a task, and the task has a BSD proc.
@param ctx Context whose associated process to find.
- @return Process if available, NULL otherwise.
+ @returns credential if process available; NULL otherwise
*/
kauth_cred_t vfs_context_ucred(vfs_context_t);
#endif /* BSD_KERNEL_PRIVATE */
-/*!
- @function vnode_notify
- @abstract Send a notification up to VFS.
- @param vp Vnode for which to provide notification.
- @param vap Attributes for that vnode, to be passed to fsevents.
- @discussion Filesystem determines which attributes to pass up using
- vfs_get_notify_attributes(&vap). The most specific events possible should be passed,
- e.g. VNODE_EVENT_FILE_CREATED on a directory rather than just VNODE_EVENT_WRITE, but
- a less specific event can be passed up if more specific information is not available.
- Will not reenter the filesystem.
- @return 0 for success, else an error code.
- */
-int vnode_notify(vnode_t, uint32_t, struct vnode_attr*);
-
/*!
@function vnode_ismonitored
@abstract Check whether a file has watchers that would make it useful to query a server
int vnode_isdyldsharedcache(vnode_t);
-/*!
- @function vfs_get_notify_attributes
- @abstract Determine what attributes are required to send up a notification with vnode_notify().
- @param vap Structure to initialize and activate required attributes on.
- @discussion Will not reenter the filesystem.
- @return 0 for success, nonzero for error (currently always succeeds).
- */
-int vfs_get_notify_attributes(struct vnode_attr *vap);
-
/*!
@function vn_getpath_fsenter
@abstract Attempt to get a vnode's path, willing to enter the filesystem.
*/
int vn_getpath(struct vnode *vp, char *pathbuf, int *len);
+/*!
+ @function vnode_notify
+ @abstract Send a notification up to VFS.
+ @param vp Vnode for which to provide notification.
+ @param vap Attributes for that vnode, to be passed to fsevents.
+ @discussion Filesystem determines which attributes to pass up using
+ vfs_get_notify_attributes(&vap). The most specific events possible should be passed,
+ e.g. VNODE_EVENT_FILE_CREATED on a directory rather than just VNODE_EVENT_WRITE, but
+ a less specific event can be passed up if more specific information is not available.
+ Will not reenter the filesystem.
+ @return 0 for success, else an error code.
+ */
+int vnode_notify(vnode_t, uint32_t, struct vnode_attr*);
+
+/*!
+ @function vfs_get_notify_attributes
+ @abstract Determine what attributes are required to send up a notification with vnode_notify().
+ @param vap Structure to initialize and activate required attributes on.
+ @discussion Will not reenter the filesystem.
+ @return 0 for success, nonzero for error (currently always succeeds).
+ */
+int vfs_get_notify_attributes(struct vnode_attr *vap);
+
/*
* Flags for the vnode_lookup and vnode_open
*/
#define VNODE_LOOKUP_NOFOLLOW 0x01
#define VNODE_LOOKUP_NOCROSSMOUNT 0x02
-#define VNODE_LOOKUP_DOWHITEOUT 0x04 /* OBSOLETE */
+#define VNODE_LOOKUP_CROSSMOUNTNOWAIT 0x04
/*!
@function vnode_lookup
@abstract Convert a path into a vnode.
*/
vnode_t vnode_getparent(vnode_t vp);
+/*!
+ @function vnode_setdirty
+ @abstract Mark the vnode as having data or metadata that needs to be written out during reclaim
+ @discussion The vnode should be marked as dirty anytime a file system defers flushing of data or meta-data associated with it.
+ @param the vnode to mark as dirty
+ @return 0 if successful else an error code.
+ */
+int vnode_setdirty(vnode_t);
+
+/*!
+ @function vnode_cleardirty
+ @abstract Mark the vnode as clean i.e. all its data or metadata has been flushed
+ @discussion The vnode should be marked as clean whenever the file system is done flushing data or meta-data associated with it.
+ @param the vnode to clear as being dirty
+ @return 0 if successful else an error code.
+ */
+int vnode_cleardirty(vnode_t);
+
+/*!
+ @function vnode_isdirty
+ @abstract Determine if a vnode is marked dirty.
+ @discussion The vnode should be marked as clean whenever the file system is done flushing data or meta-data associated with it.
+ @param vp the vnode to test.
+ @return Non-zero if the vnode is dirty, 0 otherwise.
+ */
+int vnode_isdirty(vnode_t);
+
+
+
#ifdef KERNEL_PRIVATE
/*!
@function vnode_lookup_continue_needed
@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);
+
+/*
+ * Get the context for the first kernel thread (private SPI)
+ */
+vfs_context_t vfs_context_kernel(void); /* get from 1st kernel thread */
#endif /* KERNEL_PRIVATE */
#ifdef BSD_KERNEL_PRIVATE
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);
enum vtype vnode_iftovt(int);
int vnode_vttoif(enum vtype);
int vnode_isshadow(vnode_t);
-int vnode_istty(vnode_t vp);
+boolean_t vnode_on_reliable_media(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
*/
vnode_t vnode_parent(vnode_t);
void vnode_setparent(vnode_t, vnode_t);
-const char * vnode_name(vnode_t);
+/*!
+ @function vnode_getname_printable
+ @abstract Get a non-null printable name of a vnode.
+ @Used to make sure a printable name is returned for all vnodes. If a name exists or can be artificially created, the routine creates a new entry in the VFS namecache. Otherwise, the function returns an artificially created vnode name which is safer and easier to use. vnode_putname_printable() should be used to release names obtained by this routine.
+ @param vp The vnode whose name to grab.
+ @return The printable name.
+ */
+const char *vnode_getname_printable(vnode_t vp);
+
+/*!
+ @function vnode_putname_printable
+ @abstract Release a reference on a name from the VFS cache if it was added by the matching vnode_getname_printable() call.
+ @param name String to release.
+ @return void.
+ */
+void vnode_putname_printable(const char *name);
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);
-
+#if CONFIG_IOSCHED
+vnode_t vnode_mountdevvp(vnode_t);
+#endif
#endif /* BSD_KERNEL_PRIVATE */
+/*
+ * Helper functions for implementing VNOP_GETATTRLISTBULK for a filesystem
+ */
+
+/*!
+ @function vfs_setup_vattr_from_attrlist
+ @abstract Setup a vnode_attr structure given an attrlist structure.
+ @Used by a VNOP_GETATTRLISTBULK implementation to setup a vnode_attr structure from a attribute list. It also returns the fixed size of the attribute buffer required.
+ @param alp Pointer to attribute list structure.
+ @param vap Pointer to vnode_attr structure.
+ @param obj_vtype Type of object - If VNON is passed, then the type is ignored and common, file and dir attrs are used to initialise the vattrs. If set to VDIR, only common and directory attributes are used. For all other types, only common and file attrbutes are used.
+ @param attr_fixed_sizep. Returns the fixed length required in the attrbute buffer for the object. NULL should be passed if it is not required.
+ @param ctx vfs context of caller.
+ @return error.
+ */
+errno_t vfs_setup_vattr_from_attrlist(struct attrlist * /* alp */, struct vnode_attr * /* vap */, enum vtype /* obj_vtype */, ssize_t * /* attr_fixed_sizep */, vfs_context_t /* ctx */);
+
+/*!
+ @function vfs_attr_pack
+ @abstract Pack a vnode_attr structure into a buffer in the same format as getattrlist(2).
+ @Used by a VNOP_GETATTRLISTBULK implementation to pack data provided into a vnode_attr structure into a buffer the way getattrlist(2) does.
+ @param vp If available, the vnode for which the attributes are being given, NULL if vnode is not available (which will usually be the case for a VNOP_GETATTRLISTBULK implementation.
+ @param auio - a uio_t initialised with one iovec..
+ @param alp - Pointer to an attrlist structure.
+ @param options - options for call (same as options for getattrlistbulk(2)).
+ @param vap Pointer to a filled in vnode_attr structure. Data from the vnode_attr structure will be used to copy and lay out the data in the required format for getatrlistbulk(2) by this function.
+ @param fndesc Currently unused
+ @param ctx vfs context of caller.
+ @return error.
+ */
+errno_t vfs_attr_pack(vnode_t /* vp */, uio_t /* uio */, struct attrlist * /* alp */, uint64_t /* options */, struct vnode_attr * /* vap */, void * /* fndesc */, vfs_context_t /* ctx */);
+
__END_DECLS
#endif /* KERNEL */