diff options
author | alfred <alfred@FreeBSD.org> | 2004-07-08 00:08:18 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2004-07-08 00:08:18 +0000 |
commit | 11872a37e76165f23760a147cf1d9e302f8682a3 (patch) | |
tree | 2ebd8a4f49ca214e2bea47ffe0fc634c4bb2683d /share | |
parent | 3c9dfc991900f60a7d65478c35ff17c72765edf7 (diff) | |
download | FreeBSD-src-11872a37e76165f23760a147cf1d9e302f8682a3.zip FreeBSD-src-11872a37e76165f23760a147cf1d9e302f8682a3.tar.gz |
Update in the face of NDFREE.
Basically the advice on freeing the componentname buffers is no
longer correct.
Update the example code.
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/VOP_CREATE.9 | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/share/man/man9/VOP_CREATE.9 b/share/man/man9/VOP_CREATE.9 index c730563..fb4e65a 100644 --- a/share/man/man9/VOP_CREATE.9 +++ b/share/man/man9/VOP_CREATE.9 @@ -70,21 +70,6 @@ the pathname of the target of the symlink These entry points are called after .Xr VOP_LOOKUP 9 when an object is being created. -Normally, -.Xr VOP_LOOKUP 9 -will have set the -.Dv SAVENAME -flag in -.Fa cnp->cn_flags -to keep the memory pointed to by -.Fa cnp->cn_pnbuf -valid. -If an error is detected when creating the file, -then this memory will be freed. -If the file is created successfully, then it will be freed unless the -.Dv SAVESTART -flag is specified in -.Fa cnp . .Sh LOCKS The directory, .Fa dvp @@ -112,11 +97,8 @@ vop_create(struct vnode *dvp, mode |= IFREG; error = SOMEFS_VALLOC(dvp, mode, cnp->cn_cred, &vp); - if (error) { - free(cnp->cn_pnbuf, M_NAMEI); - vput(dvp); + if (error) return error; - } /* * Update the permissions for the new vnode, including @@ -140,9 +122,6 @@ vop_create(struct vnode *dvp, if (error) goto bad; - if ((cnp->cn_flags & SAVESTART) == 0) - free(cnp->cn_pnbuf, M_NAMEI); - vput(dvp); *vpp = vp; return 0; @@ -152,7 +131,6 @@ bad: * Write error occurred trying to update the inode * or the directory so must deallocate the inode. */ - free(cnp->cn_pnbuf, M_NAMEI); vput(vp); /* @@ -160,8 +138,6 @@ bad: */ ...; - vput(dvp); - return error; } .Ed |