Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Name all "vnode_impl_t" variables "vip".
details: https://anonhg.NetBSD.org/src/rev/78df2be9f235
branches: trunk
changeset: 350129:78df2be9f235
user: hannken <hannken%NetBSD.org@localhost>
date: Thu Jan 05 10:05:11 2017 +0000
description:
Name all "vnode_impl_t" variables "vip".
No functional change.
diffstat:
sys/kern/vfs_subr.c | 18 +-
sys/kern/vfs_vnode.c | 275 +++++++++++++++++++++++++-------------------------
sys/sys/vnode_impl.h | 4 +-
3 files changed, 148 insertions(+), 149 deletions(-)
diffs (truncated from 734 to 300 lines):
diff -r 46916739bcdb -r 78df2be9f235 sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c Thu Jan 05 09:55:01 2017 +0000
+++ b/sys/kern/vfs_subr.c Thu Jan 05 10:05:11 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_subr.c,v 1.453 2017/01/02 10:33:28 hannken Exp $ */
+/* $NetBSD: vfs_subr.c,v 1.454 2017/01/05 10:05:11 hannken Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.453 2017/01/02 10:33:28 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.454 2017/01/05 10:05:11 hannken Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -1091,7 +1091,7 @@
int n;
char bf[96];
const uint8_t *cp;
- vnode_impl_t *node;
+ vnode_impl_t *vip;
const char * const vnode_tags[] = { VNODE_TAGS };
const char * const vnode_types[] = { VNODE_TYPES };
const char vnode_flagbits[] = VNODE_FLAGBITS;
@@ -1100,7 +1100,7 @@
#define ARRAY_PRINT(idx, arr) \
((unsigned int)(idx) < ARRAY_SIZE(arr) ? (arr)[(idx)] : "UNKNOWN")
- node = VNODE_TO_VIMPL(vp);
+ vip = VNODE_TO_VIMPL(vp);
snprintb(bf, sizeof(bf),
vnode_flagbits, vp->v_iflag | vp->v_vflag | vp->v_uflag);
@@ -1116,14 +1116,14 @@
prefix, vp->v_size, vp->v_writesize, vp->v_numoutput);
(*pr)("%sdata %p lock %p\n", prefix, vp->v_data, &vp->v_lock);
- (*pr)("%sstate %s key(%p %zd)", prefix, vstate_name(node->vi_state),
- node->vi_key.vk_mount, node->vi_key.vk_key_len);
- n = node->vi_key.vk_key_len;
- cp = node->vi_key.vk_key;
+ (*pr)("%sstate %s key(%p %zd)", prefix, vstate_name(vip->vi_state),
+ vip->vi_key.vk_mount, vip->vi_key.vk_key_len);
+ n = vip->vi_key.vk_key_len;
+ cp = vip->vi_key.vk_key;
while (n-- > 0)
(*pr)(" %02x", *cp++);
(*pr)("\n");
- (*pr)("%slrulisthd %p\n", prefix, node->vi_lrulisthd);
+ (*pr)("%slrulisthd %p\n", prefix, vip->vi_lrulisthd);
#undef ARRAY_PRINT
#undef ARRAY_SIZE
diff -r 46916739bcdb -r 78df2be9f235 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c Thu Jan 05 09:55:01 2017 +0000
+++ b/sys/kern/vfs_vnode.c Thu Jan 05 10:05:11 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.69 2017/01/04 17:13:50 hannken Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.70 2017/01/05 10:05:11 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.69 2017/01/04 17:13:50 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.70 2017/01/05 10:05:11 hannken Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -241,52 +241,52 @@
static void
vstate_assert(vnode_t *vp, enum vnode_state state, const char *func, int line)
{
- vnode_impl_t *node = VNODE_TO_VIMPL(vp);
+ vnode_impl_t *vip = VNODE_TO_VIMPL(vp);
KASSERTMSG(mutex_owned(vp->v_interlock), "at %s:%d", func, line);
- if (__predict_true(node->vi_state == state))
+ if (__predict_true(vip->vi_state == state))
return;
vnpanic(vp, "state is %s, expected %s at %s:%d",
- vstate_name(node->vi_state), vstate_name(state), func, line);
+ vstate_name(vip->vi_state), vstate_name(state), func, line);
}
static enum vnode_state
vstate_assert_get(vnode_t *vp, const char *func, int line)
{
- vnode_impl_t *node = VNODE_TO_VIMPL(vp);
+ vnode_impl_t *vip = VNODE_TO_VIMPL(vp);
KASSERTMSG(mutex_owned(vp->v_interlock), "at %s:%d", func, line);
- if (node->vi_state == VS_MARKER)
+ if (vip->vi_state == VS_MARKER)
vnpanic(vp, "state is %s at %s:%d",
- vstate_name(node->vi_state), func, line);
+ vstate_name(vip->vi_state), func, line);
- return node->vi_state;
+ return vip->vi_state;
}
static void
vstate_assert_wait_stable(vnode_t *vp, const char *func, int line)
{
- vnode_impl_t *node = VNODE_TO_VIMPL(vp);
+ vnode_impl_t *vip = VNODE_TO_VIMPL(vp);
KASSERTMSG(mutex_owned(vp->v_interlock), "at %s:%d", func, line);
- if (node->vi_state == VS_MARKER)
+ if (vip->vi_state == VS_MARKER)
vnpanic(vp, "state is %s at %s:%d",
- vstate_name(node->vi_state), func, line);
+ vstate_name(vip->vi_state), func, line);
- while (node->vi_state != VS_ACTIVE && node->vi_state != VS_RECLAIMED)
+ while (vip->vi_state != VS_ACTIVE && vip->vi_state != VS_RECLAIMED)
cv_wait(&vp->v_cv, vp->v_interlock);
- if (node->vi_state == VS_MARKER)
+ if (vip->vi_state == VS_MARKER)
vnpanic(vp, "state is %s at %s:%d",
- vstate_name(node->vi_state), func, line);
+ vstate_name(vip->vi_state), func, line);
}
static void
vstate_assert_change(vnode_t *vp, enum vnode_state from, enum vnode_state to,
const char *func, int line)
{
- vnode_impl_t *node = VNODE_TO_VIMPL(vp);
+ vnode_impl_t *vip = VNODE_TO_VIMPL(vp);
KASSERTMSG(mutex_owned(vp->v_interlock), "at %s:%d", func, line);
if (from == VS_LOADING)
@@ -298,15 +298,15 @@
if (to == VS_MARKER)
vnpanic(vp, "to is %s at %s:%d",
vstate_name(to), func, line);
- if (node->vi_state != from)
+ if (vip->vi_state != from)
vnpanic(vp, "from is %s, expected %s at %s:%d\n",
- vstate_name(node->vi_state), vstate_name(from), func, line);
+ vstate_name(vip->vi_state), vstate_name(from), func, line);
if ((from == VS_BLOCKED || to == VS_BLOCKED) && vp->v_usecount != 1)
vnpanic(vp, "%s to %s with usecount %d at %s:%d",
vstate_name(from), vstate_name(to), vp->v_usecount,
func, line);
- node->vi_state = to;
+ vip->vi_state = to;
if (from == VS_LOADING)
cv_broadcast(&vcache_cv);
if (to == VS_ACTIVE || to == VS_RECLAIMED)
@@ -326,18 +326,18 @@
static void
vstate_wait_stable(vnode_t *vp)
{
- vnode_impl_t *node = VNODE_TO_VIMPL(vp);
+ vnode_impl_t *vip = VNODE_TO_VIMPL(vp);
- while (node->vi_state != VS_ACTIVE && node->vi_state != VS_RECLAIMED)
+ while (vip->vi_state != VS_ACTIVE && vip->vi_state != VS_RECLAIMED)
cv_wait(&vp->v_cv, vp->v_interlock);
}
static void
vstate_change(vnode_t *vp, enum vnode_state from, enum vnode_state to)
{
- vnode_impl_t *node = VNODE_TO_VIMPL(vp);
+ vnode_impl_t *vip = VNODE_TO_VIMPL(vp);
- node->vi_state = to;
+ vip->vi_state = to;
if (from == VS_LOADING)
cv_broadcast(&vcache_cv);
if (to == VS_ACTIVE || to == VS_RECLAIMED)
@@ -375,16 +375,16 @@
vnode_t *
vnalloc_marker(struct mount *mp)
{
- vnode_impl_t *node;
+ vnode_impl_t *vip;
vnode_t *vp;
- node = pool_cache_get(vcache_pool, PR_WAITOK);
- memset(node, 0, sizeof(*node));
- vp = VIMPL_TO_VNODE(node);
+ vip = pool_cache_get(vcache_pool, PR_WAITOK);
+ memset(vip, 0, sizeof(*vip));
+ vp = VIMPL_TO_VNODE(vip);
uvm_obj_init(&vp->v_uobj, &uvm_vnodeops, true, 0);
vp->v_mount = mp;
vp->v_type = VBAD;
- node->vi_state = VS_MARKER;
+ vip->vi_state = VS_MARKER;
return vp;
}
@@ -395,12 +395,12 @@
void
vnfree_marker(vnode_t *vp)
{
- vnode_impl_t *node;
+ vnode_impl_t *vip;
- node = VNODE_TO_VIMPL(vp);
- KASSERT(node->vi_state == VS_MARKER);
+ vip = VNODE_TO_VIMPL(vp);
+ KASSERT(vip->vi_state == VS_MARKER);
uvm_obj_destroy(&vp->v_uobj, true);
- pool_cache_put(vcache_pool, node);
+ pool_cache_put(vcache_pool, vip);
}
/*
@@ -436,17 +436,17 @@
static void
lru_requeue(vnode_t *vp, vnodelst_t *listhd)
{
- vnode_impl_t *node;
+ vnode_impl_t *vip;
mutex_enter(&vdrain_lock);
- node = VNODE_TO_VIMPL(vp);
- if (node->vi_lrulisthd != NULL)
- TAILQ_REMOVE(node->vi_lrulisthd, node, vi_lrulist);
+ vip = VNODE_TO_VIMPL(vp);
+ if (vip->vi_lrulisthd != NULL)
+ TAILQ_REMOVE(vip->vi_lrulisthd, vip, vi_lrulist);
else
numvnodes++;
- node->vi_lrulisthd = listhd;
- if (node->vi_lrulisthd != NULL)
- TAILQ_INSERT_TAIL(node->vi_lrulisthd, node, vi_lrulist);
+ vip->vi_lrulisthd = listhd;
+ if (vip->vi_lrulisthd != NULL)
+ TAILQ_INSERT_TAIL(vip->vi_lrulisthd, vip, vi_lrulist);
else
numvnodes--;
if (numvnodes > desiredvnodes || listhd == &lru_vrele_list)
@@ -498,7 +498,7 @@
static __inline void
vdrain_vrele(vnode_t *vp)
{
- vnode_impl_t *node = VNODE_TO_VIMPL(vp);
+ vnode_impl_t *vip = VNODE_TO_VIMPL(vp);
struct mount *mp;
KASSERT(mutex_owned(&vdrain_lock));
@@ -513,10 +513,10 @@
* will put it back onto the right list before
* its v_usecount reaches zero.
*/
- KASSERT(node->vi_lrulisthd == &lru_vrele_list);
- TAILQ_REMOVE(node->vi_lrulisthd, node, vi_lrulist);
- node->vi_lrulisthd = &lru_hold_list;
- TAILQ_INSERT_TAIL(node->vi_lrulisthd, node, vi_lrulist);
+ KASSERT(vip->vi_lrulisthd == &lru_vrele_list);
+ TAILQ_REMOVE(vip->vi_lrulisthd, vip, vi_lrulist);
+ vip->vi_lrulisthd = &lru_hold_list;
+ TAILQ_INSERT_TAIL(vip->vi_lrulisthd, vip, vi_lrulist);
vdrain_retry = true;
mutex_exit(&vdrain_lock);
@@ -540,7 +540,7 @@
};
int i;
u_int target;
- vnode_impl_t *node, *marker;
+ vnode_impl_t *vip, *marker;
marker = VNODE_TO_VIMPL(vnalloc_marker(NULL));
@@ -552,16 +552,16 @@
for (i = 0; i < __arraycount(listhd); i++) {
TAILQ_INSERT_HEAD(listhd[i], marker, vi_lrulist);
- while ((node = TAILQ_NEXT(marker, vi_lrulist))) {
+ while ((vip = TAILQ_NEXT(marker, vi_lrulist))) {
TAILQ_REMOVE(listhd[i], marker, vi_lrulist);
- TAILQ_INSERT_AFTER(listhd[i], node, marker,
+ TAILQ_INSERT_AFTER(listhd[i], vip, marker,
vi_lrulist);
if (listhd[i] == &lru_vrele_list)
- vdrain_vrele(VIMPL_TO_VNODE(node));
+ vdrain_vrele(VIMPL_TO_VNODE(vip));
else if (numvnodes < target)
break;
else
- vdrain_remove(VIMPL_TO_VNODE(node));
+ vdrain_remove(VIMPL_TO_VNODE(vip));
}
TAILQ_REMOVE(listhd[i], marker, vi_lrulist);
Home |
Main Index |
Thread Index |
Old Index