From a7f57f13c210a20961071aa2652034235607a7b9 Mon Sep 17 00:00:00 2001 From: Antonio Huete Jimenez Date: Sun, 12 Oct 2014 17:48:00 +0200 Subject: [PATCH] stash manpages --- share/man/man9/Makefile | 8 +- share/man/man9/VOP_CREATE.9 | 182 ----------------------- share/man/man9/VOP_LINK.9 | 132 ----------------- share/man/man9/VOP_OLD_CREATE.9 | 170 ++++++++++++++++++++++ share/man/man9/VOP_OLD_LINK.9 | 132 +++++++++++++++++ share/man/man9/VOP_OLD_REMOVE.9 | 106 ++++++++++++++ share/man/man9/VOP_OLD_RENAME.9 | 311 ++++++++++++++++++++++++++++++++++++++++ share/man/man9/VOP_REMOVE.9 | 106 -------------- share/man/man9/VOP_RENAME.9 | 311 ---------------------------------------- 9 files changed, 723 insertions(+), 735 deletions(-) delete mode 100644 share/man/man9/VOP_CREATE.9 delete mode 100644 share/man/man9/VOP_LINK.9 create mode 100644 share/man/man9/VOP_OLD_CREATE.9 create mode 100644 share/man/man9/VOP_OLD_LINK.9 create mode 100644 share/man/man9/VOP_OLD_REMOVE.9 create mode 100644 share/man/man9/VOP_OLD_RENAME.9 delete mode 100644 share/man/man9/VOP_REMOVE.9 delete mode 100644 share/man/man9/VOP_RENAME.9 diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9b41834..8972130 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -196,7 +196,7 @@ MAN= accept_filter.9 \ VOP_ACLCHECK.9 \ VOP_ADVLOCK.9 \ VOP_ATTRIB.9 \ - VOP_CREATE.9 \ + VOP_OLD_CREATE.9 \ VOP_FSYNC.9 \ VOP_GETACL.9 \ VOP_GETEXTATTR.9 \ @@ -204,7 +204,7 @@ MAN= accept_filter.9 \ VOP_INACTIVE.9 \ VOP_IOCTL.9 \ VOP_LEASE.9 \ - VOP_LINK.9 \ + VOP_OLD_LINK.9 \ VOP_LOCK.9 \ VOP_LOOKUP.9 \ VOP_MMAP.9 \ @@ -215,8 +215,8 @@ MAN= accept_filter.9 \ VOP_READDIR.9 \ VOP_READLINK.9 \ VOP_REALLOCBLKS.9 \ - VOP_REMOVE.9 \ - VOP_RENAME.9 \ + VOP_OLD_REMOVE.9 \ + VOP_OLD_RENAME.9 \ VOP_SETACL.9 \ VOP_SETEXTATTR.9 \ VOP_STRATEGY.9 \ diff --git a/share/man/man9/VOP_CREATE.9 b/share/man/man9/VOP_CREATE.9 deleted file mode 100644 index 6f5fdbf..0000000 --- a/share/man/man9/VOP_CREATE.9 +++ /dev/null @@ -1,182 +0,0 @@ -.\" Copyright (c) 1996 Doug Rabson -.\" -.\" All rights reserved. -.\" -.\" This program is free software. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD: src/share/man/man9/VOP_CREATE.9,v 1.9.2.1 2001/12/17 11:30:18 ru Exp $ -.\" -.Dd July 24, 1996 -.Dt VOP_CREATE 9 -.Os -.Sh NAME -.Nm VOP_CREATE , -.Nm VOP_MKNOD , -.Nm VOP_MKDIR , -.Nm VOP_SYMLINK -.Nd create a file, socket, fifo, device, directory or symlink -.Sh SYNOPSIS -.In sys/param.h -.In sys/vnode.h -.In sys/namei.h -.Ft int -.Fn VOP_CREATE "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" -.Ft int -.Fn VOP_MKNOD "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" -.Ft int -.Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" -.Ft int -.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "char *target" -.Sh DESCRIPTION -These entry points create a new file, socket, fifo, device, directory or symlink -in a given directory. -.Pp -The arguments are: -.Bl -tag -width target -.It Fa dvp -the locked vnode of the directory -.It Fa vpp -the address of a variable where the resulting locked vnode should be stored -.It Fa cnp -the pathname component created -.It Fa vap -the attributes that the new object should be created with -.It Fa target -the pathname of the target of the symlink -.El -.Pp -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 -will be locked on entry and must remain locked on return. -If the call is successful, the new object will be returned locked. -.Sh RETURN VALUES -If successful, the vnode for the new object is placed in -.Fa *vpp -and zero is returned. Otherwise, an appropriate error is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_create(struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp - struct vattr *vap) -{ - int mode = MAKEIMODE(vap->va_type, vap->va_mode); - struct vnode *vp; - int error; - - *vpp = NULL; - if ((mode & IFMT) == 0) - mode |= IFREG; - - error = SOMEFS_VALLOC(dvp, mode, cnp->cn_cred, &vp); - if (error) { - kfree(cnp->cn_pnbuf, M_NAMEI); - vput(dvp); - return error; - } - - /* - * Update the permissions for the new vnode, including - * copying the group from the directory. - */ - ...; - -#ifdef QUOTA - /* - * Possibly check quota information. - */ - ...; -#endif - - /* - * Enter new vnode in directory, taking care that the vnode - * hits the disk before the directory contents are changed. - */ - error = ...; - - if (error) - goto bad; - - if ((cnp->cn_flags & SAVESTART) == 0) - kfree(cnp->cn_pnbuf, M_NAMEI); - vput(dvp); - *vpp = vp; - - return 0; - -bad: - /* - * Write error occurred trying to update the inode - * or the directory so must deallocate the inode. - */ - kfree(cnp->cn_pnbuf, M_NAMEI); - vput(vp); - - /* - * Deallocate filesystem resources for vp. - */ - ...; - - vput(dvp); - - return error; -} -.Ed -.Sh ERRORS -.Bl -tag -width Er -.It Bq Er ENOSPC -The filesystem is full. -.It Bq Er EDQUOT -Quota exceeded. -.El -.Sh SEE ALSO -.Xr vnode 9 , -.Xr VOP_LOOKUP 9 -.Sh HISTORY -The function -.Nm -appeared in -.Bx 4.3 . -.Sh AUTHORS -This man page was written by -.An Doug Rabson . diff --git a/share/man/man9/VOP_LINK.9 b/share/man/man9/VOP_LINK.9 deleted file mode 100644 index 1327a3c..0000000 --- a/share/man/man9/VOP_LINK.9 +++ /dev/null @@ -1,132 +0,0 @@ -.\" Copyright (c) 1996 Doug Rabson -.\" -.\" All rights reserved. -.\" -.\" This program is free software. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD: src/share/man/man9/VOP_LINK.9,v 1.9.2.3 2001/12/17 11:30:18 ru Exp $ -.\" -.Dd July 24, 1996 -.Dt VOP_LINK 9 -.Os -.Sh NAME -.Nm VOP_LINK -.Nd create a new name for a file -.Sh SYNOPSIS -.In sys/param.h -.In sys/vnode.h -.Ft int -.Fn VOP_LINK "struct vnode *dvp" "struct vnode *vp" "struct componentname *cnp" -.Sh DESCRIPTION -This links a new name in the specified directory to an existing file. -.Pp -Its arguments are: -.Bl -tag -width 8n -.It Fa dvp -the vnode of the directory -.It Fa vp -the vnode of the file to be linked -.It Fa cnp -pathname information about the file -.El -.Pp -The pathname info must be released on exit. The directory and -file vnodes should NOT be released on exit. -.Sh LOCKS -The directory, -.Fa dvp -is locked on entry and should remain locked on return. -The file -.Fa vp -is not locked on entry and should remain that way on return. -If your VOP code locks -.Fa vp , -it must be sure to unlock prior to returning. -.Sh RETURN VALUES -Zero is returned if the file was linked successfully, otherwise an -error is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_link(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) -{ - int error = 0; - - if (vp->v_mount != dvp->v_mount) { - VOP_ABORTOP(dvp, cnp); - error = EXDEV; - goto out2; - } - if (vp != dvp && (error = VOP_LOCK(vp))) { - VOP_ABORTOP(dvp, cnp); - goto out2; - } - - /* - * now that we've locked vp, we have to use out1 instead of out2 - */ - - if (vp would have too many links) { - VOP_ABORTOP(dvp, cnp); - error = EMLINK; - goto out1; - } - - if (vp is immutable) { - VOP_ABORTOP(dvp, cnp); - error = EPERM; - goto out1; - } - - /* - * Increment link count of vp and write back the on-disc version of it. - */ - ...; - - if (!error) { - /* - * Add the new name to the directory. - */ - ...; - } - - kfree(cnp->cn_pnbuf, M_NAMEI); -out1: - if (vp != dvp) - VOP_UNLOCK(vp); -out2: - - return error; -} -.Ed -.Sh ERRORS -.Bl -tag -width Er -.It Bq Er EPERM -the file is immutable -.El -.Sh SEE ALSO -.Xr vnode 9 , -.Xr vn_lock 9 -.Sh AUTHORS -This man page was originally written by -.An Doug Rabson . diff --git a/share/man/man9/VOP_OLD_CREATE.9 b/share/man/man9/VOP_OLD_CREATE.9 new file mode 100644 index 0000000..34732d7 --- /dev/null +++ b/share/man/man9/VOP_OLD_CREATE.9 @@ -0,0 +1,170 @@ +.\" Copyright (c) 1996 Doug Rabson +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/share/man/man9/VOP_CREATE.9,v 1.9.2.1 2001/12/17 11:30:18 ru Exp $ +.\" +.Dd October, 10 2014 +.Dt VOP_OLD_CREATE 9 +.Os +.Sh NAME +.Nm VOP_OLD_CREATE , +.Nm VOP_OLD_MKNOD , +.Nm VOP_OLD_MKDIR , +.Nm VOP_OLD_SYMLINK +.Nd create a file, socket, fifo, device, directory or symlink +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.In sys/namei.h +.Ft int +.Fn VOP_OLD_CREATE "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" +.Ft int +.Fn VOP_OLD_MKNOD "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" +.Ft int +.Fn VOP_OLD_MKDIR "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" +.Ft int +.Fn VOP_OLD_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "char *target" +.Sh DESCRIPTION +These entry points create a new file, socket, fifo, device, directory or symlink +in a given directory. +.Pp +The arguments are: +.Bl -tag -width target +.It Fa dvp +the locked vnode of the directory +.It Fa vpp +the address of a variable where the resulting locked vnode should be stored +.It Fa cnp +the pathname component created +.It Fa vap +the attributes that the new object should be created with +.It Fa target +the pathname of the target of the symlink +.El +.Pp +These entry points are called after +.Xr VOP_OLD_LOOKUP 9 +when an object is being created. +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. +.Sh LOCKS +The directory, +.Fa dvp +will be locked on entry and must remain locked on return. +If the call is successful, the new object will be returned locked. +.Sh RETURN VALUES +If successful, the vnode for the new object is placed in +.Fa *vpp +and zero is returned. Otherwise, an appropriate error is returned. +.Sh PSEUDOCODE +.Bd -literal +int +vop_old_create(struct vnode *dvp, + struct vnode **vpp, + struct componentname *cnp + struct vattr *vap) +{ + int mode = MAKEIMODE(vap->va_type, vap->va_mode); + struct vnode *vp; + int error; + + *vpp = NULL; + if ((mode & IFMT) == 0) + mode |= IFREG; + + error = SOMEFS_VALLOC(dvp, mode, cnp->cn_cred, &vp); + if (error) { + kfree(cnp->cn_pnbuf, M_NAMEI); + vput(dvp); + return error; + } + + /* + * Update the permissions for the new vnode, including + * copying the group from the directory. + */ + ...; + +#ifdef QUOTA + /* + * Possibly check quota information. + */ + ...; +#endif + + /* + * Enter new vnode in directory, taking care that the vnode + * hits the disk before the directory contents are changed. + */ + error = ...; + + if (error) + goto bad; + + if ((cnp->cn_flags & SAVESTART) == 0) + kfree(cnp->cn_pnbuf, M_NAMEI); + vput(dvp); + *vpp = vp; + + return 0; + +bad: + /* + * Write error occurred trying to update the inode + * or the directory so must deallocate the inode. + */ + kfree(cnp->cn_pnbuf, M_NAMEI); + vput(vp); + + /* + * Deallocate filesystem resources for vp. + */ + ...; + + vput(dvp); + + return error; +} +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er ENOSPC +The filesystem is full. +.It Bq Er EDQUOT +Quota exceeded. +.El +.Sh SEE ALSO +.Xr vnode 9 , +.Xr VOP_LOOKUP 9 +.Sh HISTORY +The function +.Nm +appeared in +.Bx 4.3 . +.Sh AUTHORS +This man page was written by +.An Doug Rabson . diff --git a/share/man/man9/VOP_OLD_LINK.9 b/share/man/man9/VOP_OLD_LINK.9 new file mode 100644 index 0000000..1327a3c --- /dev/null +++ b/share/man/man9/VOP_OLD_LINK.9 @@ -0,0 +1,132 @@ +.\" Copyright (c) 1996 Doug Rabson +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/share/man/man9/VOP_LINK.9,v 1.9.2.3 2001/12/17 11:30:18 ru Exp $ +.\" +.Dd July 24, 1996 +.Dt VOP_LINK 9 +.Os +.Sh NAME +.Nm VOP_LINK +.Nd create a new name for a file +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_LINK "struct vnode *dvp" "struct vnode *vp" "struct componentname *cnp" +.Sh DESCRIPTION +This links a new name in the specified directory to an existing file. +.Pp +Its arguments are: +.Bl -tag -width 8n +.It Fa dvp +the vnode of the directory +.It Fa vp +the vnode of the file to be linked +.It Fa cnp +pathname information about the file +.El +.Pp +The pathname info must be released on exit. The directory and +file vnodes should NOT be released on exit. +.Sh LOCKS +The directory, +.Fa dvp +is locked on entry and should remain locked on return. +The file +.Fa vp +is not locked on entry and should remain that way on return. +If your VOP code locks +.Fa vp , +it must be sure to unlock prior to returning. +.Sh RETURN VALUES +Zero is returned if the file was linked successfully, otherwise an +error is returned. +.Sh PSEUDOCODE +.Bd -literal +int +vop_link(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) +{ + int error = 0; + + if (vp->v_mount != dvp->v_mount) { + VOP_ABORTOP(dvp, cnp); + error = EXDEV; + goto out2; + } + if (vp != dvp && (error = VOP_LOCK(vp))) { + VOP_ABORTOP(dvp, cnp); + goto out2; + } + + /* + * now that we've locked vp, we have to use out1 instead of out2 + */ + + if (vp would have too many links) { + VOP_ABORTOP(dvp, cnp); + error = EMLINK; + goto out1; + } + + if (vp is immutable) { + VOP_ABORTOP(dvp, cnp); + error = EPERM; + goto out1; + } + + /* + * Increment link count of vp and write back the on-disc version of it. + */ + ...; + + if (!error) { + /* + * Add the new name to the directory. + */ + ...; + } + + kfree(cnp->cn_pnbuf, M_NAMEI); +out1: + if (vp != dvp) + VOP_UNLOCK(vp); +out2: + + return error; +} +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EPERM +the file is immutable +.El +.Sh SEE ALSO +.Xr vnode 9 , +.Xr vn_lock 9 +.Sh AUTHORS +This man page was originally written by +.An Doug Rabson . diff --git a/share/man/man9/VOP_OLD_REMOVE.9 b/share/man/man9/VOP_OLD_REMOVE.9 new file mode 100644 index 0000000..c487bc6 --- /dev/null +++ b/share/man/man9/VOP_OLD_REMOVE.9 @@ -0,0 +1,106 @@ +.\" Copyright (c) 1996 Doug Rabson +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/share/man/man9/VOP_REMOVE.9,v 1.7.2.2 2001/12/17 11:30:18 ru Exp $ +.\" +.Dd July 24, 1996 +.Dt VOP_REMOVE 9 +.Os +.Sh NAME +.Nm VOP_REMOVE , +.Nm VOP_RMDIR +.Nd remove a file or directory +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_REMOVE "struct vnode *dvp" "struct vnode *vp" "struct componentname *cnp" +.Ft int +.Fn VOP_RMDIR "struct vnode *dvp" "struct vnode *vp" "struct componentname *cnp" +.Sh DESCRIPTION +These entry points remove files and directories respectively. +.Pp +The arguments are: +.Bl -tag -width dvp +.It Fa dvp +the vnode of the directory +.It Fa vp +the vnode of the file to be removed +.It Fa cnp +pathname information about the file +.El +.Sh LOCKS +Both +.Fa dvp +and +.Fa vp +should be locked on entry and remain locked on return. +.Sh RETURN VALUES +Zero is returned on success, otherwise an error code is returned. +.Sh PSEUDOCODE +.Bd -literal +int +vop_remove(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) +{ + int error = 0; + + if (vp is immutable) { + error = EPERM; + goto out; + } + + /* + * Remove name cnp->cn_nameptr from directory and update link count + * of vp. + */ + ...; + + /* + * Careful about trying to remove ".". XXX this should be handled + * higher up. + */ + if (dvp == vp) + vrele(vp); + else + vput(vp); + vput(dvp); + + return error; +} +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EPERM +the file is immutable +.It Bq Er ENOTEMPTY +attempt to remove a directory which is not empty +.El +.Sh SEE ALSO +.Xr vnode 9 , +.Xr VOP_LOOKUP 9 +.Sh AUTHORS +This man page was written by +.An Doug Rabson . diff --git a/share/man/man9/VOP_OLD_RENAME.9 b/share/man/man9/VOP_OLD_RENAME.9 new file mode 100644 index 0000000..7e7d318 --- /dev/null +++ b/share/man/man9/VOP_OLD_RENAME.9 @@ -0,0 +1,311 @@ +.\" Copyright (c) 1996 Doug Rabson +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: src/share/man/man9/VOP_RENAME.9,v 1.10.2.2 2001/12/17 11:30:18 ru Exp $ +.\" +.Dd July 24, 1996 +.Dt VOP_RENAME 9 +.Os +.Sh NAME +.Nm VOP_RENAME +.Nd rename a file +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_RENAME "struct vnode *fdvp" "struct vnode *fvp" "struct componentname *fcnp" "struct vnode *tdvp" "struct vnode *tvp" "struct componentname *tcnp" +.Sh DESCRIPTION +This renames a file and possibly changes its parent directory. +If the destination object exists, it will be removed first. +.Pp +Its arguments are: +.Bl -tag -width fdvp +.It Fa fdvp +the vnode of the old parent directory +.It Fa fvp +the vnode of the file to be renamed +.It Fa fcnp +pathname information about the file's current name +.It Fa tdvp +the vnode of the new parent directory +.It Fa tvp +the vnode of the target file (if it exists) +.It Fa tcnp +pathname information about the file's new name +.El +.Sh LOCKS +The source directory and file are unlocked but are expected to have their +ref count bumped on entry. The VOP routine is expected to +.Fn vrele +both prior +to returning. +.Pp +The destination directory and file are locked as well as having their ref +count bumped. The VOP routine is expected to +.Fn vput +both prior to +returning. +.Sh PSEUDOCODE +.Bd -literal +int +vop_rename(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp, + struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp) +{ + int doingdirectory = 0; + int error = 0; + + /* + * Check for cross-device rename. + */ + if (fvp->v_mount != tdvp->v_mount) { + error = EXDEV; + abortit: + VOP_ABORTOP(tdvp, tcnp); + if (tdvp == tvp) + vrele(tdvp); + else + vput(tdvp); + if (tvp) + vput(tvp); + VOP_ABORTOP(fdvp, fcnp); + vrele(fdvp); + vrele(fvp); + return error; + } + + if (tvp exists and is immutable) { + error = EPERM; + goto abortit; + } + + /* + * Check if just deleting a link name. + */ + if (fvp == tvp) { + if (fvp->v_type == VDIR) { + error = EINVAL; + goto abortit; + } + + /* + * Release destination. + */ + VOP_ABORTOP(tdvp, tcnp); + vput(tdvp); + vput(tvp); + + /* + * Delete source. Pretty bizarre stuff. + */ + vrele(fdvp); + vrele(fvp); + fcnp->cn_flags &= ~MODMASK; + fcnp->cn_flags |= LOCKPARENT | LOCKLEAF; + fcnp->cn_nameiop = DELETE; + VREF(fdvp); + error = relookup(fdvp, &fvp, fcnp); + if (error == 0) + vrele(fdvp); + return VOP_REMOVE(fdvp, fvp, fcnp); + } + + if (fvp is immutable) { + error = EPERM; + goto abortit; + } + + error = VOP_LOCK(fvp); + if (error) + goto abortit; + + if (vp is a directory) { + /* + * Avoid ".", "..", and aliases of "." for obvious reasons. + */ + if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') + || fdvp == fvp + || ((fcnp->cn_flags | tcnp->cn_flags) & ISDOTDOT)) { + VOP_UNLOCK(fvp); + error = EINVAL; + goto abortit; + } + doingdirectory = 1; + } + vrele(fdvp); + + /* + * Bump link count on fvp while we are moving stuff around. If we + * crash before completing the work, the link count may be wrong + * but correctable. + */ + ...; + + /* + * If ".." must be changed (ie the directory gets a new + * parent) then the source directory must not be in the + * directory hierarchy above the target, as this would + * orphan everything below the source directory. Also + * the user must have write permission in the source so + * as to be able to change "..". + */ + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc); + VOP_UNLOCK(fvp); + if (doingdirectory && fdvp != tdvp) { + /* + * Check for pathname conflict. + */ + ...; + } + + /* + * If the target doesn't exist, link the target to the source and + * unlink the source. Otherwise, rewrite the target directory to + * reference the source and remove the original entry. + */ + if (tvp == NULL) { + /* + * Account for ".." in new directory. + */ + if (doingdirectory && fdvp != tdvp) { + /* + * Increase link count of tdvp. + */ + ...; + } + + /* + * Add name in new directory. + */ + ...; + + if (error) { + if (doingdirectory && fdvp != tdvp) { + /* + * Decrease link count if tdvp. + */ + ...; + } + goto bad; + } + vput(tdvp); + } else { + /* + * Target must be empty if a directory and have no links + * to it. Also, ensure source and target are compatible + * (both directories, or both not directories). + */ + if (tvp is a directory) { + if (tvp is not empty) { + error = ENOTEMPTY; + goto bad; + } + if (!doingdirectory) { + error = ENOTDIR; + goto bad; + } + /* + * Update name cache since directory is going away. + */ + cache_purge(tdvp); + } else if (doingdirectory) { + error = ENOTDIR; + goto bad; + } + + /* + * Change name tcnp in tdvp to point at fvp. + */ + ...; + + /* + * If the target directory is in same directory as the source + * directory, decrement the link count on the parent of the + * target directory. This accounts for the fact that a + * directory links back to its parent with "..". + */ + if (doingdirectory && fdvp == tdvp) { + /* + * Decrement link count of tdvp. + */ + ...; + } + vput(tdvp); + + /* + * Decrement the link count of tvp since the directory no + * longer points at it. + */ + ...; + if (doingdirectory) { + /* + * Clean up the old directory tvp. + */ + ...; + } + vput(tvp); + } + + /* + * Unlink the source. If a directory was moved to a new parent, + * update its ".." entry. Gobs of ugly UFS code omitted here. + */ + ...; + +bad: + if (tvp) + vput(tvp); + vput(tdvp); +out: + if (VOP_LOCK(fvp) == 0) { + /* + * Decrement link count of fvp. + */ + ...; + vput(fvp); + } else + vrele(fvp); + + return error; +} +.Ed +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EPERM +the file is immutable +.It Bq Er EXDEV +cross device move +.It Bq Er EINVAL +illegal directory rename +.It Bq Er ENOTDIR +attempt to rename a directory to a file or vice versa +.It Bq Er ENOTEMPTY +attempt to remove a directory which is not empty +.El +.Sh SEE ALSO +.Xr vnode 9 +.Sh AUTHORS +This man page was written by +.An Doug Rabson . diff --git a/share/man/man9/VOP_REMOVE.9 b/share/man/man9/VOP_REMOVE.9 deleted file mode 100644 index c487bc6..0000000 --- a/share/man/man9/VOP_REMOVE.9 +++ /dev/null @@ -1,106 +0,0 @@ -.\" Copyright (c) 1996 Doug Rabson -.\" -.\" All rights reserved. -.\" -.\" This program is free software. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD: src/share/man/man9/VOP_REMOVE.9,v 1.7.2.2 2001/12/17 11:30:18 ru Exp $ -.\" -.Dd July 24, 1996 -.Dt VOP_REMOVE 9 -.Os -.Sh NAME -.Nm VOP_REMOVE , -.Nm VOP_RMDIR -.Nd remove a file or directory -.Sh SYNOPSIS -.In sys/param.h -.In sys/vnode.h -.Ft int -.Fn VOP_REMOVE "struct vnode *dvp" "struct vnode *vp" "struct componentname *cnp" -.Ft int -.Fn VOP_RMDIR "struct vnode *dvp" "struct vnode *vp" "struct componentname *cnp" -.Sh DESCRIPTION -These entry points remove files and directories respectively. -.Pp -The arguments are: -.Bl -tag -width dvp -.It Fa dvp -the vnode of the directory -.It Fa vp -the vnode of the file to be removed -.It Fa cnp -pathname information about the file -.El -.Sh LOCKS -Both -.Fa dvp -and -.Fa vp -should be locked on entry and remain locked on return. -.Sh RETURN VALUES -Zero is returned on success, otherwise an error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_remove(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) -{ - int error = 0; - - if (vp is immutable) { - error = EPERM; - goto out; - } - - /* - * Remove name cnp->cn_nameptr from directory and update link count - * of vp. - */ - ...; - - /* - * Careful about trying to remove ".". XXX this should be handled - * higher up. - */ - if (dvp == vp) - vrele(vp); - else - vput(vp); - vput(dvp); - - return error; -} -.Ed -.Sh ERRORS -.Bl -tag -width Er -.It Bq Er EPERM -the file is immutable -.It Bq Er ENOTEMPTY -attempt to remove a directory which is not empty -.El -.Sh SEE ALSO -.Xr vnode 9 , -.Xr VOP_LOOKUP 9 -.Sh AUTHORS -This man page was written by -.An Doug Rabson . diff --git a/share/man/man9/VOP_RENAME.9 b/share/man/man9/VOP_RENAME.9 deleted file mode 100644 index 7e7d318..0000000 --- a/share/man/man9/VOP_RENAME.9 +++ /dev/null @@ -1,311 +0,0 @@ -.\" Copyright (c) 1996 Doug Rabson -.\" -.\" All rights reserved. -.\" -.\" This program is free software. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD: src/share/man/man9/VOP_RENAME.9,v 1.10.2.2 2001/12/17 11:30:18 ru Exp $ -.\" -.Dd July 24, 1996 -.Dt VOP_RENAME 9 -.Os -.Sh NAME -.Nm VOP_RENAME -.Nd rename a file -.Sh SYNOPSIS -.In sys/param.h -.In sys/vnode.h -.Ft int -.Fn VOP_RENAME "struct vnode *fdvp" "struct vnode *fvp" "struct componentname *fcnp" "struct vnode *tdvp" "struct vnode *tvp" "struct componentname *tcnp" -.Sh DESCRIPTION -This renames a file and possibly changes its parent directory. -If the destination object exists, it will be removed first. -.Pp -Its arguments are: -.Bl -tag -width fdvp -.It Fa fdvp -the vnode of the old parent directory -.It Fa fvp -the vnode of the file to be renamed -.It Fa fcnp -pathname information about the file's current name -.It Fa tdvp -the vnode of the new parent directory -.It Fa tvp -the vnode of the target file (if it exists) -.It Fa tcnp -pathname information about the file's new name -.El -.Sh LOCKS -The source directory and file are unlocked but are expected to have their -ref count bumped on entry. The VOP routine is expected to -.Fn vrele -both prior -to returning. -.Pp -The destination directory and file are locked as well as having their ref -count bumped. The VOP routine is expected to -.Fn vput -both prior to -returning. -.Sh PSEUDOCODE -.Bd -literal -int -vop_rename(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp, - struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp) -{ - int doingdirectory = 0; - int error = 0; - - /* - * Check for cross-device rename. - */ - if (fvp->v_mount != tdvp->v_mount) { - error = EXDEV; - abortit: - VOP_ABORTOP(tdvp, tcnp); - if (tdvp == tvp) - vrele(tdvp); - else - vput(tdvp); - if (tvp) - vput(tvp); - VOP_ABORTOP(fdvp, fcnp); - vrele(fdvp); - vrele(fvp); - return error; - } - - if (tvp exists and is immutable) { - error = EPERM; - goto abortit; - } - - /* - * Check if just deleting a link name. - */ - if (fvp == tvp) { - if (fvp->v_type == VDIR) { - error = EINVAL; - goto abortit; - } - - /* - * Release destination. - */ - VOP_ABORTOP(tdvp, tcnp); - vput(tdvp); - vput(tvp); - - /* - * Delete source. Pretty bizarre stuff. - */ - vrele(fdvp); - vrele(fvp); - fcnp->cn_flags &= ~MODMASK; - fcnp->cn_flags |= LOCKPARENT | LOCKLEAF; - fcnp->cn_nameiop = DELETE; - VREF(fdvp); - error = relookup(fdvp, &fvp, fcnp); - if (error == 0) - vrele(fdvp); - return VOP_REMOVE(fdvp, fvp, fcnp); - } - - if (fvp is immutable) { - error = EPERM; - goto abortit; - } - - error = VOP_LOCK(fvp); - if (error) - goto abortit; - - if (vp is a directory) { - /* - * Avoid ".", "..", and aliases of "." for obvious reasons. - */ - if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') - || fdvp == fvp - || ((fcnp->cn_flags | tcnp->cn_flags) & ISDOTDOT)) { - VOP_UNLOCK(fvp); - error = EINVAL; - goto abortit; - } - doingdirectory = 1; - } - vrele(fdvp); - - /* - * Bump link count on fvp while we are moving stuff around. If we - * crash before completing the work, the link count may be wrong - * but correctable. - */ - ...; - - /* - * If ".." must be changed (ie the directory gets a new - * parent) then the source directory must not be in the - * directory hierarchy above the target, as this would - * orphan everything below the source directory. Also - * the user must have write permission in the source so - * as to be able to change "..". - */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc); - VOP_UNLOCK(fvp); - if (doingdirectory && fdvp != tdvp) { - /* - * Check for pathname conflict. - */ - ...; - } - - /* - * If the target doesn't exist, link the target to the source and - * unlink the source. Otherwise, rewrite the target directory to - * reference the source and remove the original entry. - */ - if (tvp == NULL) { - /* - * Account for ".." in new directory. - */ - if (doingdirectory && fdvp != tdvp) { - /* - * Increase link count of tdvp. - */ - ...; - } - - /* - * Add name in new directory. - */ - ...; - - if (error) { - if (doingdirectory && fdvp != tdvp) { - /* - * Decrease link count if tdvp. - */ - ...; - } - goto bad; - } - vput(tdvp); - } else { - /* - * Target must be empty if a directory and have no links - * to it. Also, ensure source and target are compatible - * (both directories, or both not directories). - */ - if (tvp is a directory) { - if (tvp is not empty) { - error = ENOTEMPTY; - goto bad; - } - if (!doingdirectory) { - error = ENOTDIR; - goto bad; - } - /* - * Update name cache since directory is going away. - */ - cache_purge(tdvp); - } else if (doingdirectory) { - error = ENOTDIR; - goto bad; - } - - /* - * Change name tcnp in tdvp to point at fvp. - */ - ...; - - /* - * If the target directory is in same directory as the source - * directory, decrement the link count on the parent of the - * target directory. This accounts for the fact that a - * directory links back to its parent with "..". - */ - if (doingdirectory && fdvp == tdvp) { - /* - * Decrement link count of tdvp. - */ - ...; - } - vput(tdvp); - - /* - * Decrement the link count of tvp since the directory no - * longer points at it. - */ - ...; - if (doingdirectory) { - /* - * Clean up the old directory tvp. - */ - ...; - } - vput(tvp); - } - - /* - * Unlink the source. If a directory was moved to a new parent, - * update its ".." entry. Gobs of ugly UFS code omitted here. - */ - ...; - -bad: - if (tvp) - vput(tvp); - vput(tdvp); -out: - if (VOP_LOCK(fvp) == 0) { - /* - * Decrement link count of fvp. - */ - ...; - vput(fvp); - } else - vrele(fvp); - - return error; -} -.Ed -.Sh ERRORS -.Bl -tag -width Er -.It Bq Er EPERM -the file is immutable -.It Bq Er EXDEV -cross device move -.It Bq Er EINVAL -illegal directory rename -.It Bq Er ENOTDIR -attempt to rename a directory to a file or vice versa -.It Bq Er ENOTEMPTY -attempt to remove a directory which is not empty -.El -.Sh SEE ALSO -.Xr vnode 9 -.Sh AUTHORS -This man page was written by -.An Doug Rabson . -- 2.0.0