Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Dec 2008 01:08:28 +0000 (UTC)
From:      Joe Marcus Clarke <marcus@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185961 - head/share/man/man9
Message-ID:  <200812120108.mBC18SaU082093@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcus (doc,ports committer)
Date: Fri Dec 12 01:08:28 2008
New Revision: 185961
URL: http://svn.freebsd.org/changeset/base/185961

Log:
  Add a man page for VOP_VPTOCNP.
  
  Reviewed by:	arch
  Approved by:	kib

Added:
  head/share/man/man9/VOP_VPTOCNP.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Fri Dec 12 01:01:03 2008	(r185960)
+++ head/share/man/man9/Makefile	Fri Dec 12 01:08:28 2008	(r185961)
@@ -348,6 +348,7 @@ MAN=	accept_filter.9 \
 	VOP_SETACL.9 \
 	VOP_SETEXTATTR.9 \
 	VOP_STRATEGY.9 \
+	VOP_VPTOCNP.9 \
 	VOP_VPTOFH.9 \
 	vput.9 \
 	vref.9 \

Added: head/share/man/man9/VOP_VPTOCNP.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/VOP_VPTOCNP.9	Fri Dec 12 01:08:28 2008	(r185961)
@@ -0,0 +1,110 @@
+.\" -*- nroff -*-
+.\"
+.\" Copyright (c) 2008 Joe Marcus Clarke
+.\"
+.\" 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$
+.\"
+.Dd December 7, 2008
+.Os
+.Dt VOP_VPTOCNP 9
+.Sh NAME
+.Nm VOP_VPTOCNP
+.Nd translate a vnode to its component name
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/vnode.h
+.Ft int
+.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "char *buf" "int *buflen"
+.Sh DESCRIPTION
+This translates a vnode into its component name, and writes that name to
+the head of the buffer specified by
+.Fa buf
+.Bl -tag -width buflen
+.It Fa vp
+The vnode to translate.
+.It Fa dvp
+The vnode of the parent directory of
+.Fa vp .
+.It Fa buf
+The buffer into which to preprend the component name.
+.It Fa buflen
+The remaining size of the buffer.
+.El
+.Pp
+The default implementation of
+.Nm
+simply returns ENOENT.
+.Sh LOCKS
+The vnode should be locked on entry and will still be locked on exit.  The
+parent directory vnode will be unlocked on a successful exit.  However, it
+will have its hold count incremented.
+.Sh RETURN VALUES
+Zero is returned on success, otherwise an error code is returned.
+.Sh PSEUDOCODE
+.Bd -literal
+int
+vop_vptocnp(struct vnode *vp, struct vnode **dvp, char *buf, int *buflen)
+{
+    int error = 0;
+
+    /*
+     * Translate the vnode to its component name.
+     *
+     * Decrement the component name's length from buflen.
+     *
+     * Obtain the vnode's parent directory vnode.
+     */
+    ...;
+
+    /*
+     * Increment the parent directory's hold count.
+     */
+    vhold(*dvp);
+
+    return error;
+}
+.Ed
+.Sh ERRORS
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+The buffer was not large enough to hold the vnode's component name.
+.It Bq Er ENOENT
+The vnode was not found on the file system.
+.El
+.Sh SEE ALSO
+.Xr VOP_LOOKUP 9 ,
+.Xr vnode 9
+.Sh NOTES
+This interface is a work in progress.
+.Sh HISTORY
+The function
+.Nm
+appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+This manual page was written by
+.An Joe Marcus Clarke .



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812120108.mBC18SaU082093>