3 .\" Copyright (c) 1996 Doug Rabson
5 .\" All rights reserved.
7 .\" This program is free software.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
19 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 .Nd create a file, socket, fifo, device, directory or symlink
45 .Fn VOP_CREATE "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
47 .Fn VOP_MKNOD "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
49 .Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
51 .Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "char *target"
53 These entry points create a new file, socket, fifo, device, directory or symlink
57 .Bl -tag -width target
59 The locked vnode of the directory.
61 The address of a variable where the resulting locked vnode should be stored.
63 The pathname component created.
65 The attributes that the new object should be created with.
67 The pathname of the target of the symlink.
70 These entry points are called after
72 when an object is being created.
76 will be locked on entry and must remain locked on return.
77 If the call is successful, the new object will be returned locked.
79 If successful, the vnode for the new object is placed in
82 Otherwise, an appropriate error is returned.
86 vop_create(struct vnode *dvp,
88 struct componentname *cnp
91 int mode = MAKEIMODE(vap->va_type, vap->va_mode);
96 if ((mode & IFMT) == 0)
99 error = SOMEFS_VALLOC(dvp, mode, cnp->cn_cred, &vp);
104 * Update the permissions for the new vnode, including
105 * copying the group from the directory.
111 * Possibly check quota information.
117 * Enter new vnode in directory, taking care that the vnode
118 * hits the disk before the directory contents are changed.
131 * Write error occurred trying to update the inode
132 * or the directory so must deallocate the inode.
137 * Deallocate file system resources for vp.
147 The file system is full.
149 The user's file system space or inode quota would be exceeded.
160 This manual page was written by