Creates a new file.
dvp | Points to the directory vnode. |
vpp | Points to the newly created vnode pointer. |
flags | Specifies file creation flags. |
name | Specifies the name of the file to create. |
vattr | Points to the initial attributes. |
vcf | Specifies create flags. |
finfop | Specifies address of finfo field. |
crp | Specifies user's credentials. |
The vn_create_attr entry point is used to create a new file. This operation is similar to the vn_create entry point except that the initial file attributes are passed in a vattr structure.
The va_mask field in the vattr structure identifies which attributes are to be applied. For example, if the AT_SIZE bit is set, then the file system should use va_size for the initial file size. For all vn_create_attr calls, at least AT_TYPE and AT_MODE must be set.
The vcf parameter controls how the new vnode is to be activated. If vcf is set to VC_OPEN, then the new object should be opened. If vcf is VC_LOOKUP, then the new object should be created, but not opened. If vcf is VC_DEFAULT, then the new object should be created, but the vnode for the object is not activated.
File systems that do not define GFS_VERSION421 in their gfs flags do not need to supply a vn_create_attr entry point. The logical file system will funnel all creation requests through the old vn_create entry point.
The vn_create_attr entry point can be called from the process environment only.
Zero | Indicates a successful operation; *vpp contains a pointer to the new vnode. |
Nonzero | Indicates that the operation failed; return values should be chosen from the /usr/include/sys/errno.h file. |
The open subroutine, mknod subroutine.
Virtual File System Overview, Logical File System Overview, Understanding Virtual Nodes (V-nodes), and Virtual File System Kernel Extensions Overview.
List of Virtual File System Operations.