Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Move vnode members v_dnclist and v_nclist as vi_dnclist and
details: https://anonhg.NetBSD.org/src/rev/052de1d6eea4
branches: trunk
changeset: 820550:052de1d6eea4
user: hannken <hannken%NetBSD.org@localhost>
date: Wed Jan 11 09:04:37 2017 +0000
description:
Move vnode members v_dnclist and v_nclist as vi_dnclist and
vi_nclist to vnode_impl.h.
diffstat:
share/man/man9/vnode.9 | 15 ++-------------
sys/kern/vfs_cache.c | 16 ++++++++--------
sys/kern/vfs_vnode.c | 8 ++++----
sys/sys/vnode.h | 6 +-----
sys/sys/vnode_impl.h | 7 ++++++-
5 files changed, 21 insertions(+), 31 deletions(-)
diffs (196 lines):
diff -r 5e1e1c4b9a3d -r 052de1d6eea4 share/man/man9/vnode.9
--- a/share/man/man9/vnode.9 Wed Jan 11 07:32:36 2017 +0000
+++ b/share/man/man9/vnode.9 Wed Jan 11 09:04:37 2017 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: vnode.9,v 1.74 2017/01/02 10:33:28 hannken Exp $
+.\" $NetBSD: vnode.9,v 1.75 2017/01/11 09:04:37 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 January 2, 2017
+.Dd January 11, 2017
.Dt VNODE 9
.Os
.Sh NAME
@@ -174,8 +174,6 @@
struct buflists v_cleanblkhd; /* clean blocklist head */
struct buflists v_dirtyblkhd; /* dirty blocklist head */
TAILQ_ENTRY(vnode) v_synclist; /* vnodes with dirty bufs */
- LIST_HEAD(, namecache) v_dnclist; /* namecaches (children) */
- LIST_HEAD(, namecache) v_nclist; /* namecaches (parent) */
union {
struct mount *vu_mountedhere;/* ptr to vfs (VDIR) */
struct socket *vu_socket; /* unix ipc (VSOCK) */
@@ -316,15 +314,6 @@
It does not track the number of dirty buffers attached to the
vnode.
.Pp
-.Em v_dnclist
-and
-.Em v_nclist
-are used by
-.Xr namecache 9
-to maintain the list of associated entries so that
-.Xr cache_purge 9
-can purge them.
-.Pp
The link to the file system which owns the vnode is recorded by
.Em v_mount .
See
diff -r 5e1e1c4b9a3d -r 052de1d6eea4 sys/kern/vfs_cache.c
--- a/sys/kern/vfs_cache.c Wed Jan 11 07:32:36 2017 +0000
+++ b/sys/kern/vfs_cache.c Wed Jan 11 09:04:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_cache.c,v 1.111 2017/01/02 10:33:28 hannken Exp $ */
+/* $NetBSD: vfs_cache.c,v 1.112 2017/01/11 09:04:37 hannken Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.111 2017/01/02 10:33:28 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.112 2017/01/11 09:04:37 hannken Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -844,9 +844,9 @@
/* Fill in cache info. */
ncp->nc_dvp = dvp;
- LIST_INSERT_HEAD(&dvp->v_dnclist, ncp, nc_dvlist);
+ LIST_INSERT_HEAD(&VNODE_TO_VIMPL(dvp)->vi_dnclist, ncp, nc_dvlist);
if (vp)
- LIST_INSERT_HEAD(&vp->v_nclist, ncp, nc_vlist);
+ LIST_INSERT_HEAD(&VNODE_TO_VIMPL(vp)->vi_nclist, ncp, nc_vlist);
else {
ncp->nc_vlist.le_prev = NULL;
ncp->nc_vlist.le_next = NULL;
@@ -1031,8 +1031,8 @@
if (flags & PURGE_PARENTS) {
SDT_PROBE(vfs, namecache, purge, parents, vp, 0, 0, 0, 0);
- for (ncp = LIST_FIRST(&vp->v_nclist); ncp != NULL;
- ncp = ncnext) {
+ for (ncp = LIST_FIRST(&VNODE_TO_VIMPL(vp)->vi_nclist);
+ ncp != NULL; ncp = ncnext) {
ncnext = LIST_NEXT(ncp, nc_vlist);
mutex_enter(&ncp->nc_lock);
cache_invalidate(ncp);
@@ -1042,8 +1042,8 @@
}
if (flags & PURGE_CHILDREN) {
SDT_PROBE(vfs, namecache, purge, children, vp, 0, 0, 0, 0);
- for (ncp = LIST_FIRST(&vp->v_dnclist); ncp != NULL;
- ncp = ncnext) {
+ for (ncp = LIST_FIRST(&VNODE_TO_VIMPL(vp)->vi_dnclist);
+ ncp != NULL; ncp = ncnext) {
ncnext = LIST_NEXT(ncp, nc_dvlist);
mutex_enter(&ncp->nc_lock);
cache_invalidate(ncp);
diff -r 5e1e1c4b9a3d -r 052de1d6eea4 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c Wed Jan 11 07:32:36 2017 +0000
+++ b/sys/kern/vfs_vnode.c Wed Jan 11 09:04:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.70 2017/01/05 10:05:11 hannken Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.71 2017/01/11 09:04:37 hannken Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -156,7 +156,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.70 2017/01/05 10:05:11 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.71 2017/01/11 09:04:37 hannken Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1023,12 +1023,12 @@
memset(vip, 0, sizeof(*vip));
/* SLIST_INIT(&vip->vi_hash); */
+ /* LIST_INIT(&vip->vi_nclist); */
+ /* LIST_INIT(&vip->vi_dnclist); */
vp = VIMPL_TO_VNODE(vip);
uvm_obj_init(&vp->v_uobj, &uvm_vnodeops, true, 0);
cv_init(&vp->v_cv, "vnode");
- /* LIST_INIT(&vp->v_nclist); */
- /* LIST_INIT(&vp->v_dnclist); */
rw_init(&vp->v_lock);
vp->v_usecount = 1;
diff -r 5e1e1c4b9a3d -r 052de1d6eea4 sys/sys/vnode.h
--- a/sys/sys/vnode.h Wed Jan 11 07:32:36 2017 +0000
+++ b/sys/sys/vnode.h Wed Jan 11 09:04:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vnode.h,v 1.268 2017/01/02 10:33:28 hannken Exp $ */
+/* $NetBSD: vnode.h,v 1.269 2017/01/11 09:04:37 hannken Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -74,7 +74,6 @@
#include <uvm/uvm_object.h> /* XXX */
#include <uvm/uvm_extern.h> /* XXX */
-struct namecache;
struct uvm_ractx;
#endif
@@ -128,7 +127,6 @@
* f vnode_free_list_lock, or vrele_lock for vrele_list
* i v_interlock
* m mntvnode_lock
- * n namecache_lock
* s syncer_data_lock
* u locked by underlying filesystem
* v vnode lock
@@ -155,8 +153,6 @@
struct buflists v_cleanblkhd; /* x: clean blocklist head */
struct buflists v_dirtyblkhd; /* x: dirty blocklist head */
TAILQ_ENTRY(vnode) v_synclist; /* s: vnodes with dirty bufs */
- LIST_HEAD(, namecache) v_dnclist; /* n: namecaches (children) */
- LIST_HEAD(, namecache) v_nclist; /* n: namecaches (parent) */
union {
struct mount *vu_mountedhere;/* v: ptr to vfs (VDIR) */
struct socket *vu_socket; /* v: unix ipc (VSOCK) */
diff -r 5e1e1c4b9a3d -r 052de1d6eea4 sys/sys/vnode_impl.h
--- a/sys/sys/vnode_impl.h Wed Jan 11 07:32:36 2017 +0000
+++ b/sys/sys/vnode_impl.h Wed Jan 11 09:04:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vnode_impl.h,v 1.7 2017/01/05 10:05:11 hannken Exp $ */
+/* $NetBSD: vnode_impl.h,v 1.8 2017/01/11 09:04:37 hannken Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -34,6 +34,8 @@
#include <sys/vnode.h>
+struct namecache;
+
enum vnode_state {
VS_MARKER, /* Stable, used as marker. Will not change. */
VS_LOADING, /* Intermediate, initialising the fs node. */
@@ -59,12 +61,15 @@
* c vcache_lock
* d vdrain_lock
* i v_interlock
+ * n namecache_lock
*/
struct vnode_impl {
struct vnode vi_vnode;
enum vnode_state vi_state; /* i: current state */
struct vnodelst *vi_lrulisthd; /* d: current lru list head */
TAILQ_ENTRY(vnode_impl) vi_lrulist; /* d: lru list */
+ LIST_HEAD(, namecache) vi_dnclist; /* n: namecaches (children) */
+ LIST_HEAD(, namecache) vi_nclist; /* n: namecaches (parent) */
SLIST_ENTRY(vnode_impl) vi_hash; /* c: vnode cache list */
struct vcache_key vi_key; /* c: vnode cache key */
};
Home |
Main Index |
Thread Index |
Old Index