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...
NAMEVOP_RENAME - rename a file
SYNOPSISIn 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
DESCRIPTIONThis renames a file and possibly changes its parent directory. If the destination object exists, it will be removed first.
Its arguments are:
- Fa fdvp
- The vnode of the old parent directory.
- Fa fvp
- The vnode of the file to be renamed.
- Fa fcnp
- Pathname information about the file's current name.
- Fa tdvp
- The vnode of the new parent directory.
- Fa tvp
- The vnode of the target file (if it exists).
- Fa tcnp
- Pathname information about the file's new name.
LOCKSThe source directory and file are unlocked but are expected to have their ref count bumped on entry. The VOP routine is expected to vrele(9) both prior to returning.
The destination directory and file are locked as well as having their ref count bumped. The VOP routine is expected to vput(9) both prior to returning.
- Bq Er EPERM
- The file is immutable.
- Bq Er EXDEV
- It is not possible to rename a file between different file systems.
- Bq Er EINVAL
- An attempt was made to rename . or .. or to perform an operation which would break the directory tree structure.
- Bq Er ENOTDIR
- An attempt was made to rename a directory to a file or vice versa.
- Bq Er ENOTEMPTY
- An attempt was made to remove a directory which is not empty.