Unlinks a file or directory.
Item | Description |
---|---|
vp | Points to a virtual node (v-node). The v-node indicates which file to remove and is held over the duration of the vnop_remove entry point. |
dvp | Points to the v-node of the parent directory. This directory contains the file to be removed. The directory's v-node is held for the duration of the vnop_remove entry point. |
name | Identifies the name of the file. |
crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. |
The vnop_remove entry point is called by the logical file system to remove a directory entry (or link) as the result of a call to the unlink subroutine.
The logical file system assumes that the vnop_remove entry point calls the vnop_rele entry point. If the link is the last reference to the file in the file system, the disk resources that the file is using are released.
The logical file system ensures that the directory specified by the dvp parameter does not reside in a read-only file system.
The vnop_remove entry point can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.