summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-12-02 09:46:30 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-12-02 09:46:30 +0000
commit585d3f09d2cec5176474b2b311b5928f0812f82d (patch)
tree8d42a949ab5998b5caedf8dc02131b7d63c7ba51
parent1813cc09fdb4e7bf9117bfc4eb1d7b446df10839 (diff)
merge important bits of GETATTR into VOP_LOOKUP.
provoked by jmc (and reminded that i failed to commit by ingo)
-rw-r--r--share/man/man9/Makefile6
-rw-r--r--share/man/man9/VOP_GETATTR.9108
-rw-r--r--share/man/man9/VOP_LOOKUP.930
3 files changed, 31 insertions, 113 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index bd94df76317..e987f022f9b 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.264 2015/11/26 13:08:18 jmc Exp $
+# $OpenBSD: Makefile,v 1.265 2015/12/02 09:46:29 tedu Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -36,7 +36,7 @@ MAN= aml_evalnode.9 atomic_add_int.9 atomic_cas_uint.9 \
vfs.9 vfs_busy.9 \
vfs_cache.9 vaccess.9 vclean.9 vcount.9 vdevgone.9 vfinddev.9 vflush.9 \
vflushbuf.9 vget.9 vgone.9 vhold.9 vinvalbuf.9 vnode.9 vnsubr.9 \
- VOP_GETATTR.9 VOP_LOOKUP.9 vput.9 vrecycle.9 vref.9 vrele.9 \
+ VOP_LOOKUP.9 vput.9 vrecycle.9 vref.9 vrele.9 \
vwaitforio.9 vwakeup.9 wdog_register.9
MLINKS+=aml_evalnode.9 aml_evalname.9 aml_evalnode.9 aml_find_node.9 \
@@ -449,11 +449,11 @@ MLINKS+=vnsubr.9 vn_close.9 vnsubr.9 vn_default_error.9 \
vnsubr.9 vn_isunder.9 vnsubr.9 vn_lock.9 vnsubr.9 vn_open.9 \
vnsubr.9 vn_rdwr.9 vnsubr.9 vn_stat.9 vnsubr.9 vn_writechk.9 \
vnsubr.9 vn_marktext.9
-MLINKS+=VOP_GETATTR.9 VOP_SETATTR.9
MLINKS+=VOP_LOOKUP.9 VOP_ABORTOP.9 VOP_LOOKUP.9 VOP_ACCESS.9 \
VOP_LOOKUP.9 VOP_ADVLOCK.9 VOP_LOOKUP.9 VOP_BMAP.9 \
VOP_LOOKUP.9 VOP_BWRITE.9 VOP_LOOKUP.9 VOP_CLOSE.9 \
VOP_LOOKUP.9 VOP_CREATE.9 VOP_LOOKUP.9 VOP_FSYNC.9 \
+ VOP_LOOKUP.9 VOP_GETATTR.9 VOP_LOOKUP.9 VOP_SETATTR.9 \
VOP_LOOKUP.9 VOP_INACTIVE.9 VOP_LOOKUP.9 VOP_IOCTL.9 \
VOP_LOOKUP.9 VOP_ISLOCKED.9 VOP_LOOKUP.9 VOP_KQFILTER.9 \
VOP_LOOKUP.9 VOP_LINK.9 \
diff --git a/share/man/man9/VOP_GETATTR.9 b/share/man/man9/VOP_GETATTR.9
deleted file mode 100644
index 6df220b8f47..00000000000
--- a/share/man/man9/VOP_GETATTR.9
+++ /dev/null
@@ -1,108 +0,0 @@
-.\" $OpenBSD: VOP_GETATTR.9,v 1.5 2013/06/04 19:27:03 schwarze Exp $
-.\"
-.\" Copyright (c) 2005 Pedro Martelletto <pedro@ambientworks.net>
-.\" All rights reserved.
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\"
-.Dd $Mdocdate: June 4 2013 $
-.Dt VOP_GETATTR 9
-.Os
-.Sh NAME
-.Nm VOP_GETATTR ,
-.Nm VOP_SETATTR
-.Nd get or set vnode attributes
-.Sh SYNOPSIS
-.In sys/vnode.h
-.Ft int
-.Fo VOP_GETATTR
-.Fa "struct vnode *vp"
-.Fa "struct vattr *vap"
-.Fa "struct ucred *cred"
-.Fa "struct proc *p"
-.Fc
-.Ft int
-.Fo VOP_SETATTR
-.Fa "struct vnode *vp"
-.Fa "struct vattr *vap"
-.Fa "struct ucred *cred"
-.Fa "struct proc *p"
-.Fc
-.Sh DESCRIPTION
-The
-.Nm VOP_GETATTR
-and
-.Nm VOP_SETATTR
-routines implement a generic way of representing, retrieving, and setting many
-vnode attributes such as size, number of references, access mode, and last
-modified time.
-All attributes are held in the
-.Fa vattr
-structure described below.
-.Bd -literal
-struct vattr {
- enum vtype va_type; /* vnode type */
- mode_t va_mode; /* files access mode and type */
- nlink_t va_nlink; /* number of references */
- uid_t va_uid; /* owner user id */
- gid_t va_gid; /* owner group id */
- long va_fsid; /* file system id */
- long va_fileid; /* file id */
- u_quad_t va_size; /* file size in bytes */
- long va_blocksize; /* blocksize preferred for i/o */
- struct timespec va_atime; /* time of last access */
- struct timespec va_mtime; /* time of last modification */
- struct timespec va_ctime; /* time file changed */
- u_long va_gen; /* generation number of file */
- u_long va_flags; /* flags defined for file */
- dev_t va_rdev; /* device the vnode represents */
- u_quad_t va_bytes; /* bytes of held disk space */
- u_quad_t va_filerev; /* file modification number */
- u_int va_vaflags; /* operations flags */
- long va_spare; /* remain quad aligned */
-};
-.Ed
-.Sh IMPLEMENTATION NOTES
-Depending on the specific filesystem implementation, some values may not be
-available for modification and/or retrieval.
-In these cases, the corresponding fields in the
-.Fa vattr
-structure should be set to
-.Dv VNOVAL .
-.Pp
-Upon return from a
-.Fn VOP_GETATTR
-call made on a directory, the
-.Fa va_nlink
-field should contain the number of entries in the directory, if possible,
-or 1 otherwise.
-.Sh RETURN VALUES
-The
-.Fn VOP_GETATTR
-and
-.Fn VOP_SETATTR
-functions return 0 to indicate success and a non-zero error code
-to indicate failure.
-See
-.Xr errno 2
-for more information.
-.Sh SEE ALSO
-.Xr errno 2 ,
-.Xr vfs 9 ,
-.Xr vn_stat 9 ,
-.Xr vnode 9
-.Sh AUTHORS
-This man page was written by
-.An Pedro Martelletto
-for
-.Ox .
diff --git a/share/man/man9/VOP_LOOKUP.9 b/share/man/man9/VOP_LOOKUP.9
index 4f0f7d05f45..aa28975b8c4 100644
--- a/share/man/man9/VOP_LOOKUP.9
+++ b/share/man/man9/VOP_LOOKUP.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: VOP_LOOKUP.9,v 1.29 2015/11/23 17:53:57 jmc Exp $
+.\" $OpenBSD: VOP_LOOKUP.9,v 1.30 2015/12/02 09:46:29 tedu Exp $
.\"
.\" Copyright (c) 2003 Ted Unangst
.\" All rights reserved.
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: November 23 2015 $
+.Dd $Mdocdate: December 2 2015 $
.Dt VOP_LOOKUP 9
.Os
.Sh NAME
@@ -482,6 +482,32 @@ or should not be changed by
.Fn VOP_SETATTR .
Upon success of obtaining or changing the attributes, zero is returned;
otherwise, an appropriate error code is returned.
+All attributes are held in the
+.Fa vattr
+structure described below.
+.Bd -literal
+struct vattr {
+ enum vtype va_type; /* vnode type */
+ mode_t va_mode; /* files access mode and type */
+ nlink_t va_nlink; /* number of references */
+ uid_t va_uid; /* owner user id */
+ gid_t va_gid; /* owner group id */
+ long va_fsid; /* file system id */
+ long va_fileid; /* file id */
+ u_quad_t va_size; /* file size in bytes */
+ long va_blocksize; /* blocksize preferred for i/o */
+ struct timespec va_atime; /* time of last access */
+ struct timespec va_mtime; /* time of last modification */
+ struct timespec va_ctime; /* time file changed */
+ u_long va_gen; /* generation number of file */
+ u_long va_flags; /* flags defined for file */
+ dev_t va_rdev; /* device the vnode represents */
+ u_quad_t va_bytes; /* bytes of held disk space */
+ u_quad_t va_filerev; /* file modification number */
+ u_int va_vaflags; /* operations flags */
+ long va_spare; /* remain quad aligned */
+};
+.Ed
.Pp
.It Fn VOP_INACTIVE vp p
Notify the underlying file system that the locked vnode