Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Operations getnewvnode() and ungetnewvnode() have been repla...



details:   https://anonhg.NetBSD.org/src/rev/b1f643b6e1f8
branches:  trunk
changeset: 809464:b1f643b6e1f8
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Jul 12 08:11:27 2015 +0000

description:
Operations getnewvnode() and ungetnewvnode() have been replaced with vcache.
- Remove now obsolete functions getnewvnode() and ungetnewvnode().
- Document vcache operations.

Welcome to 7.99.20

diffstat:

 distrib/sets/lists/comp/mi |   35 +++++++++--
 share/man/man9/Makefile    |   11 ++-
 share/man/man9/vfsops.9    |   54 +++++++++++++++++-
 share/man/man9/vnode.9     |  137 +++++++++++++++++++++++++++++---------------
 sys/kern/vfs_vnode.c       |   89 +----------------------------
 sys/sys/param.h            |    4 +-
 sys/sys/vnode.h            |    5 +-
 7 files changed, 185 insertions(+), 150 deletions(-)

diffs (truncated from 598 to 300 lines):

diff -r 9fe25729f240 -r b1f643b6e1f8 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Sun Jul 12 05:57:06 2015 +0000
+++ b/distrib/sets/lists/comp/mi        Sun Jul 12 08:11:27 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.1969 2015/06/27 15:47:29 matt Exp $
+#      $NetBSD: mi,v 1.1970 2015/07/12 08:11:27 hannken Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -9790,7 +9790,9 @@
 ./usr/share/man/cat9/VATTR_NULL.0              comp-obsolete           obsolete
 ./usr/share/man/cat9/VFS_CHECKEXP.0            comp-sys-catman         .cat
 ./usr/share/man/cat9/VFS_FHTOVP.0              comp-sys-catman         .cat
+./usr/share/man/cat9/VFS_LOADVNODE.0           comp-sys-catman         .cat
 ./usr/share/man/cat9/VFS_MOUNT.0               comp-sys-catman         .cat
+./usr/share/man/cat9/VFS_NEWVNODE.0            comp-sys-catman         .cat
 ./usr/share/man/cat9/VFS_QUOTACTL.0            comp-sys-catman         .cat
 ./usr/share/man/cat9/VFS_ROOT.0                        comp-sys-catman         .cat
 ./usr/share/man/cat9/VFS_SNAPSHOT.0            comp-sys-catman         .cat
@@ -10311,7 +10313,7 @@
 ./usr/share/man/cat9/getmicrouptime.0          comp-sys-catman         .cat
 ./usr/share/man/cat9/getnanotime.0             comp-sys-catman         .cat
 ./usr/share/man/cat9/getnanouptime.0           comp-sys-catman         .cat
-./usr/share/man/cat9/getnewvnode.0             comp-sys-catman         .cat
+./usr/share/man/cat9/getnewvnode.0             comp-obsolete           obsolete
 ./usr/share/man/cat9/gsignal.0                 comp-obsolete           obsolete
 ./usr/share/man/cat9/hardclock.0               comp-sys-catman         .cat
 ./usr/share/man/cat9/hash.0                    comp-sys-catman         .cat
@@ -11048,7 +11050,7 @@
 ./usr/share/man/cat9/ucas.0                    comp-sys-catman         .cat
 ./usr/share/man/cat9/ucom.0                    comp-sys-catman         .cat
 ./usr/share/man/cat9/uiomove.0                 comp-sys-catman         .cat
-./usr/share/man/cat9/ungetnewvnode.0           comp-sys-catman         .cat
+./usr/share/man/cat9/ungetnewvnode.0           comp-obsolete           obsolete
 ./usr/share/man/cat9/untimeout.0               comp-sys-catman         .cat
 ./usr/share/man/cat9/uprintf.0                 comp-sys-catman         .cat
 ./usr/share/man/cat9/usbd_status.0             comp-sys-catman         .cat
@@ -11113,6 +11115,11 @@
 ./usr/share/man/cat9/vaccess.0                 comp-sys-catman         .cat
 ./usr/share/man/cat9/vattr.0                   comp-sys-catman         .cat
 ./usr/share/man/cat9/vattr_null.0              comp-sys-catman         .cat
+./usr/share/man/cat9/vcache_get.0              comp-sys-catman         .cat
+./usr/share/man/cat9/vcache_new.0              comp-sys-catman         .cat
+./usr/share/man/cat9/vcache_rekey_enter.0      comp-sys-catman         .cat
+./usr/share/man/cat9/vcache_rekey_exit.0       comp-sys-catman         .cat
+./usr/share/man/cat9/vcache_remove.0           comp-sys-catman         .cat
 ./usr/share/man/cat9/vcons.0                   comp-sys-catman         .cat
 ./usr/share/man/cat9/vcount.0                  comp-obsolete           obsolete
 ./usr/share/man/cat9/vdead_check.0             comp-sys-catman         .cat
@@ -16624,7 +16631,9 @@
 ./usr/share/man/html9/VATTR_NULL.html          comp-obsolete   obsolete
 ./usr/share/man/html9/VFS_CHECKEXP.html                comp-sys-htmlman        html
 ./usr/share/man/html9/VFS_FHTOVP.html          comp-sys-htmlman        html
+./usr/share/man/html9/VFS_LOADVNODE.html       comp-sys-htmlman        html
 ./usr/share/man/html9/VFS_MOUNT.html           comp-sys-htmlman        html
+./usr/share/man/html9/VFS_NEWVNODE.html                comp-sys-htmlman        html
 ./usr/share/man/html9/VFS_QUOTACTL.html                comp-sys-htmlman        html
 ./usr/share/man/html9/VFS_ROOT.html            comp-sys-htmlman        html
 ./usr/share/man/html9/VFS_SNAPSHOT.html                comp-sys-htmlman        html
@@ -17114,7 +17123,7 @@
 ./usr/share/man/html9/getmicrouptime.html      comp-sys-htmlman        html
 ./usr/share/man/html9/getnanotime.html         comp-sys-htmlman        html
 ./usr/share/man/html9/getnanouptime.html       comp-sys-htmlman        html
-./usr/share/man/html9/getnewvnode.html         comp-sys-htmlman        html
+./usr/share/man/html9/getnewvnode.html         comp-obsolete           obsolete
 ./usr/share/man/html9/gsignal.html             comp-obsolete           obsolete
 ./usr/share/man/html9/hardclock.html           comp-sys-htmlman        html
 ./usr/share/man/html9/hash.html                        comp-sys-htmlman        html
@@ -17821,7 +17830,7 @@
 ./usr/share/man/html9/ucas.html                        comp-sys-htmlman        html
 ./usr/share/man/html9/ucom.html                        comp-sys-htmlman        html
 ./usr/share/man/html9/uiomove.html             comp-sys-htmlman        html
-./usr/share/man/html9/ungetnewvnode.html       comp-sys-htmlman        html
+./usr/share/man/html9/ungetnewvnode.html       comp-obsolete           obsolete
 ./usr/share/man/html9/untimeout.html           comp-sys-htmlman        html
 ./usr/share/man/html9/uprintf.html             comp-sys-htmlman        html
 ./usr/share/man/html9/usbd_status.html         comp-sys-htmlman        html
@@ -17873,6 +17882,11 @@
 ./usr/share/man/html9/vaccess.html             comp-sys-htmlman        html
 ./usr/share/man/html9/vattr.html               comp-sys-htmlman        html
 ./usr/share/man/html9/vattr_null.html          comp-sys-htmlman        html
+./usr/share/man/html9/vcache_get.html          comp-sys-htmlman        html
+./usr/share/man/html9/vcache_new.html          comp-sys-htmlman        html
+./usr/share/man/html9/vcache_rekey_enter.html  comp-sys-htmlman        html
+./usr/share/man/html9/vcache_rekey_exit.html   comp-sys-htmlman        html
+./usr/share/man/html9/vcache_remove.html       comp-sys-htmlman        html
 ./usr/share/man/html9/vcons.html               comp-sys-htmlman        html
 ./usr/share/man/html9/vcount.html              comp-obsolete   obsolete
 ./usr/share/man/html9/vdead_check.html         comp-sys-htmlman        html
@@ -23549,7 +23563,9 @@
 ./usr/share/man/man9/VATTR_NULL.9              comp-obsolete           obsolete
 ./usr/share/man/man9/VFS_CHECKEXP.9            comp-sys-man            .man
 ./usr/share/man/man9/VFS_FHTOVP.9              comp-sys-man            .man
+./usr/share/man/man9/VFS_LOADVNODE.9           comp-sys-man            .man
 ./usr/share/man/man9/VFS_MOUNT.9               comp-sys-man            .man
+./usr/share/man/man9/VFS_NEWVNODE.9            comp-sys-man            .man
 ./usr/share/man/man9/VFS_QUOTACTL.9            comp-sys-man            .man
 ./usr/share/man/man9/VFS_ROOT.9                        comp-sys-man            .man
 ./usr/share/man/man9/VFS_SNAPSHOT.9            comp-sys-man            .man
@@ -24070,7 +24086,7 @@
 ./usr/share/man/man9/getmicrouptime.9          comp-sys-man            .man
 ./usr/share/man/man9/getnanotime.9             comp-sys-man            .man
 ./usr/share/man/man9/getnanouptime.9           comp-sys-man            .man
-./usr/share/man/man9/getnewvnode.9             comp-sys-man            .man
+./usr/share/man/man9/getnewvnode.9             comp-obsolete           obsolete
 ./usr/share/man/man9/gsignal.9                 comp-obsolete           obsolete
 ./usr/share/man/man9/hardclock.9               comp-sys-man            .man
 ./usr/share/man/man9/hash.9                    comp-sys-man            .man
@@ -24807,7 +24823,7 @@
 ./usr/share/man/man9/ucas.9                    comp-sys-man            .man
 ./usr/share/man/man9/ucom.9                    comp-sys-man            .man
 ./usr/share/man/man9/uiomove.9                 comp-sys-man            .man
-./usr/share/man/man9/ungetnewvnode.9           comp-sys-man            .man
+./usr/share/man/man9/ungetnewvnode.9           comp-obsolete           obsolete
 ./usr/share/man/man9/untimeout.9               comp-sys-man            .man
 ./usr/share/man/man9/uprintf.9                 comp-sys-man            .man
 ./usr/share/man/man9/usbd_status.9             comp-sys-man            .man
@@ -24872,6 +24888,11 @@
 ./usr/share/man/man9/vaccess.9                 comp-sys-man            .man
 ./usr/share/man/man9/vattr.9                   comp-sys-man            .man
 ./usr/share/man/man9/vattr_null.9              comp-sys-man            .man
+./usr/share/man/man9/vcache_get.9              comp-sys-man            .man
+./usr/share/man/man9/vcache_new.9              comp-sys-man            .man
+./usr/share/man/man9/vcache_rekey_enter.9      comp-sys-man            .man
+./usr/share/man/man9/vcache_rekey_exit.9       comp-sys-man            .man
+./usr/share/man/man9/vcache_remove.9           comp-sys-man            .man
 ./usr/share/man/man9/vcons.9                   comp-sys-man            .man
 ./usr/share/man/man9/vcount.9                  comp-obsolete           obsolete
 ./usr/share/man/man9/vdead_check.9             comp-sys-man            .man
diff -r 9fe25729f240 -r b1f643b6e1f8 share/man/man9/Makefile
--- a/share/man/man9/Makefile   Sun Jul 12 05:57:06 2015 +0000
+++ b/share/man/man9/Makefile   Sun Jul 12 08:11:27 2015 +0000
@@ -1,4 +1,4 @@
-#       $NetBSD: Makefile,v 1.387 2015/05/14 00:08:44 pgoyette Exp $
+#       $NetBSD: Makefile,v 1.388 2015/07/12 08:11:27 hannken Exp $
 
 #      Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -879,6 +879,8 @@
        vfsops.9 VFS_STATVFS.9 \
        vfsops.9 VFS_SYNC.9 \
        vfsops.9 VFS_VGET.9 \
+       vfsops.9 VFS_LOADVNODE.9 \
+       vfsops.9 VFS_NEWVNODE.9 \
        vfsops.9 VFS_FHTOVP.9 \
        vfsops.9 VFS_VPTOFH.9 \
        vfsops.9 VFS_CHECKEXP.9 \
@@ -920,8 +922,11 @@
        vnode.9 vput.9 \
        vnode.9 vhold.9 \
        vnode.9 holdrele.9 \
-       vnode.9 getnewvnode.9 \
-       vnode.9 ungetnewvnode.9 \
+       vnode.9 vcache_get.9 \
+       vnode.9 vcache_new.9 \
+       vnode.9 vcache_rekey_enter.9 \
+       vnode.9 vcache_rekey_exit.9 \
+       vnode.9 vcache_remove.9 \
        vnode.9 vrecycle.9 \
        vnode.9 vgone.9 \
        vnode.9 vgonel.9 \
diff -r 9fe25729f240 -r b1f643b6e1f8 share/man/man9/vfsops.9
--- a/share/man/man9/vfsops.9   Sun Jul 12 05:57:06 2015 +0000
+++ b/share/man/man9/vfsops.9   Sun Jul 12 08:11:27 2015 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: vfsops.9,v 1.46 2012/02/13 13:24:18 wiz Exp $
+.\"     $NetBSD: vfsops.9,v 1.47 2015/07/12 08:11:27 hannken Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 13, 2012
+.Dd July 12, 2015
 .Dt VFSOPS 9
 .Os
 .Sh NAME
@@ -40,6 +40,8 @@
 .Nm VFS_STATVFS ,
 .Nm VFS_SYNC ,
 .Nm VFS_VGET ,
+.Nm VFS_LOADVNODE ,
+.Nm VFS_NEWVNODE ,
 .Nm VFS_FHTOVP ,
 .Nm VFS_VPTOFH ,
 .Nm VFS_SNAPSHOT ,
@@ -68,6 +70,10 @@
 .Ft int
 .Fn VFS_VGET "struct mount *mp" "ino_t ino" "struct vnode **vpp"
 .Ft int
+.Fn VFS_LOADVNODE "struct mount *mp" "struct vnode *vp" "const void *key" "size_t key_len" "const void **new_key"
+.Ft int
+.Fn VFS_NEWVNODE "struct mount *mp" "struct vnode *dvp" "struct vnode *vp" "struct vattr *vap" "kauth_cred_t cred" "size_t *key_len" "const void **new_key"
+.Ft int
 .Fn VFS_FHTOVP "struct mount *mp" "struct fid *fhp" "struct vnode **vpp"
 .Ft int
 .Fn VFS_VPTOFH "struct vnode *vp" "struct fid *fhp" "size_t *fh_size"
@@ -132,6 +138,14 @@
 Ta Dv VFS_VGET \
 Ta Get vnode from file id
 .\"
+.It int (*vfs_loadvnode)() \
+Ta Dv VFS_LOADVNODE \
+Ta Initialze vnode with file
+.\"
+.It int (*vfs_loadvnode)() \
+Ta Dv VFS_NEWVNODE \
+Ta Initialze vnode with new file
+.\"
 .It int (*vfs_fhtovp)() \
 Ta Dv VFS_FHTOVP \
 Ta NFS file handle to vnode lookup
@@ -332,6 +346,42 @@
 server to implement the READDIRPLUS NFS call.
 If the file system does not support this function, it should return
 .Er EOPNOTSUPP .
+.It Fn VFS_LOADVNODE "mp" "vp" "key" "key_len" "new_key"
+Initialise the vnode
+.Fa vp
+with the file identified by the arguments
+.Fa key
+and
+.Fa key_len
+for the file system specified by the mount structure
+.Fa mp .
+.Pp
+The new key is returned in the address specified by
+.Fa new_key .
+.Pp
+Caller of this function assures no other thread will try to load this file.
+.It Fn VFS_NEWVNODE "mp" "dvp" "vp" "vap" "cred" "key_len" "new_key"
+Initialise the vnode
+.Fa vp
+with a new file for the file system specified by the mount structure
+.Fa mp .
+.Pp
+The argument
+.Fa dvp
+points to the directory to create the file in.
+.Pp
+The argument
+.Fa vap
+points to the attributes for the file to create.
+.Pp
+The argument
+.Fa cred
+holds the credentials for the file to create.
+.Pp
+The key for the file is returned in the addresses specified by
+.Fa key_len
+and
+.Fa new_key .
 .It Fn VFS_FHTOVP "mp" "fhp" "vpp"
 Get the vnode for the file handle
 .Fa fhp
diff -r 9fe25729f240 -r b1f643b6e1f8 share/man/man9/vnode.9
--- a/share/man/man9/vnode.9    Sun Jul 12 05:57:06 2015 +0000
+++ b/share/man/man9/vnode.9    Sun Jul 12 08:11:27 2015 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: vnode.9,v 1.68 2015/04/20 19:36:55 riastradh Exp $
+.\"     $NetBSD: vnode.9,v 1.69 2015/07/12 08:11:27 hannken Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 20, 2015
+.Dd July 12, 2015
 .Dt VNODE 9
 .Os
 .Sh NAME
@@ -39,8 +39,11 @@
 .Nm vput ,
 .Nm vhold ,
 .Nm holdrele ,
-.Nm getnewvnode ,
-.Nm ungetnewvnode ,
+.Nm vcache_get ,
+.Nm vcache_new ,
+.Nm vcache_rekey_enter ,
+.Nm vcache_rekey_exit ,
+.Nm vcache_remove ,
 .Nm vrecycle ,
 .Nm vgone ,
 .Nm vgonel ,
@@ -75,10 +78,15 @@
 .Ft void
 .Fn holdrele "struct vnode *vp"
 .Ft int
-.Fn getnewvnode "enum vtagtype tag" "struct mount *mp" "int (**vops)(void *)" \
-"kmutex_t *slock" "struct vnode **vpp"
+.Fn vcache_get "struct mount *mp" "const void *key" "size_t key_len" "struct vnode **vpp"
+.Ft int
+.Fn vcache_new "struct mount *mp" "struct vnode *dvp" "struct vattr *vap" "kauth_cred_t cred" "struct vnode **vpp"
+.Ft int
+.Fn vcache_rekey_enter "struct mount *mp" "struct vnode *vp" "const void *old_key" "size_t old_key_len" "const void *new_key" "size_t new_key_len"



Home | Main Index | Thread Index | Old Index