VOP_RMDIR man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

VOP_REMOVE(9)		 BSD Kernel Developer's Manual		 VOP_REMOVE(9)

NAME
     VOP_REMOVE, VOP_RMDIR — remove a file or directory

SYNOPSIS
     #include <sys/param.h>
     #include <sys/vnode.h>

     int
     VOP_REMOVE(struct vnode *dvp, struct vnode *vp,
	 struct componentname *cnp);

     int
     VOP_RMDIR(struct vnode *dvp, struct vnode *vp,
	 struct componentname *cnp);

DESCRIPTION
     These entry points remove files and directories respectively.

     The arguments are:

     dvp  the vnode of the directory

     vp	  the vnode of the file to be removed

     cnp  pathname information about the file

LOCKS
     Both dvp and vp should be locked on entry and remain locked on return.

RETURN VALUES
     Zero is returned on success, otherwise an error code is returned.

PSEUDOCODE
     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;
     }

ERRORS
     [EPERM]		the file is immutable

     [ENOTEMPTY]	attempt to remove a directory which is not empty

SEE ALSO
     vnode(9), VOP_LOOKUP(9)

AUTHORS
     This man page was written by Doug Rabson.

BSD				 July 24, 1996				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net