Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs Redo previous again, v_specnode is invariant but ...



details:   https://anonhg.NetBSD.org/src/rev/3acc6bdb5ca1
branches:  trunk
changeset: 809298:3acc6bdb5ca1
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Jun 30 06:19:21 2015 +0000

description:
Redo previous again, v_specnode is invariant but not unique.

Set "vp->v_data = vp" and use v_data as key.

diffstat:

 sys/miscfs/deadfs/dead_vfsops.c |  9 +++++----
 sys/miscfs/specfs/spec_vnops.c  |  7 ++++---
 2 files changed, 9 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r 5f984c37b419 -r 3acc6bdb5ca1 sys/miscfs/deadfs/dead_vfsops.c
--- a/sys/miscfs/deadfs/dead_vfsops.c   Tue Jun 30 06:01:04 2015 +0000
+++ b/sys/miscfs/deadfs/dead_vfsops.c   Tue Jun 30 06:19:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dead_vfsops.c,v 1.5 2015/06/29 16:48:20 hannken Exp $  */
+/*     $NetBSD: dead_vfsops.c,v 1.6 2015/06/30 06:19:22 hannken Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.5 2015/06/29 16:48:20 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.6 2015/06/30 06:19:22 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -108,8 +108,9 @@
        uvm_vnp_setsize(vp, 0);
        spec_node_init(vp, vap->va_rdev);
 
-       *key_len = sizeof(vp->v_specnode);
-       *new_key = &vp->v_specnode;
+       vp->v_data = vp;
+       *key_len = sizeof(vp->v_data);
+       *new_key = &vp->v_data;
 
        return 0;
 }
diff -r 5f984c37b419 -r 3acc6bdb5ca1 sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Tue Jun 30 06:01:04 2015 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Tue Jun 30 06:19:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.151 2015/06/29 16:48:20 hannken Exp $ */
+/*     $NetBSD: spec_vnops.c,v 1.152 2015/06/30 06:19:21 hannken Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.151 2015/06/29 16:48:20 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.152 2015/06/30 06:19:21 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -1097,7 +1097,8 @@
        struct vnode *vp = ap->a_vp;
 
        KASSERT(vp->v_mount == dead_rootmount);
-       vcache_remove(vp->v_mount, &vp->v_specnode, sizeof(vp->v_specnode));
+       vcache_remove(vp->v_mount, &vp->v_data, sizeof(vp->v_data));
+       vp->v_data = NULL;
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index