Finish cleanup of vprint() which was begun with changing v_tag to a string.
Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
This commit is contained in:
parent
7e3263308b
commit
5a225ad933
@ -789,7 +789,6 @@ static struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
|
||||
{ &vop_ioctl_desc, (vop_t *) cd9660_ioctl },
|
||||
{ &vop_lookup_desc, (vop_t *) vfs_cache_lookup },
|
||||
{ &vop_pathconf_desc, (vop_t *) cd9660_pathconf },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_read_desc, (vop_t *) cd9660_read },
|
||||
{ &vop_readdir_desc, (vop_t *) cd9660_readdir },
|
||||
{ &vop_readlink_desc, (vop_t *) cd9660_readlink },
|
||||
@ -811,7 +810,6 @@ static struct vnodeopv_entry_desc cd9660_specop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) cd9660_access },
|
||||
{ &vop_getattr_desc, (vop_t *) cd9660_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) cd9660_inactive },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_reclaim_desc, (vop_t *) cd9660_reclaim },
|
||||
{ &vop_setattr_desc, (vop_t *) cd9660_setattr },
|
||||
{ NULL, NULL }
|
||||
@ -826,7 +824,6 @@ static struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) cd9660_access },
|
||||
{ &vop_getattr_desc, (vop_t *) cd9660_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) cd9660_inactive },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_reclaim_desc, (vop_t *) cd9660_reclaim },
|
||||
{ &vop_setattr_desc, (vop_t *) cd9660_setattr },
|
||||
{ NULL, NULL }
|
||||
|
@ -73,7 +73,6 @@ static struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
|
||||
{ &vop_open_desc, (vop_t *) dead_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_ebadf }, /* per pathconf(2) */
|
||||
{ &vop_poll_desc, (vop_t *) dead_poll },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_read_desc, (vop_t *) dead_read },
|
||||
{ &vop_readdir_desc, (vop_t *) vop_ebadf },
|
||||
{ &vop_readlink_desc, (vop_t *) vop_ebadf },
|
||||
|
@ -878,7 +878,6 @@ static struct vnodeopv_entry_desc devfs_vnodeop_entries[] = {
|
||||
{ &vop_lookup_desc, (vop_t *) devfs_lookup },
|
||||
{ &vop_mknod_desc, (vop_t *) devfs_mknod },
|
||||
{ &vop_pathconf_desc, (vop_t *) devfs_pathconf },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_read_desc, (vop_t *) devfs_read },
|
||||
{ &vop_readdir_desc, (vop_t *) devfs_readdir },
|
||||
{ &vop_readlink_desc, (vop_t *) devfs_readlink },
|
||||
@ -902,7 +901,6 @@ static struct vnodeopv_entry_desc devfs_specop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) devfs_access },
|
||||
{ &vop_getattr_desc, (vop_t *) devfs_getattr },
|
||||
{ &vop_pathconf_desc, (vop_t *) devfs_pathconf },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_reclaim_desc, (vop_t *) devfs_reclaim },
|
||||
{ &vop_remove_desc, (vop_t *) devfs_remove },
|
||||
{ &vop_revoke_desc, (vop_t *) devfs_revoke },
|
||||
|
@ -545,7 +545,6 @@ static struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
|
||||
{ &vop_open_desc, (vop_t *) fdesc_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
{ &vop_poll_desc, (vop_t *) fdesc_poll },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_readdir_desc, (vop_t *) fdesc_readdir },
|
||||
{ &vop_reclaim_desc, (vop_t *) fdesc_reclaim },
|
||||
{ &vop_setattr_desc, (vop_t *) fdesc_setattr },
|
||||
|
@ -628,7 +628,7 @@ hpfs_print(ap)
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct hpfsnode *hp = VTOHP(vp);
|
||||
|
||||
printf("ino 0x%x\n", hp->h_no);
|
||||
printf("\tino 0x%x\n", hp->h_no);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -1797,7 +1797,7 @@ msdosfs_print(ap)
|
||||
{
|
||||
struct denode *dep = VTODE(ap->a_vp);
|
||||
|
||||
printf("startcluster %lu, dircluster %lu, diroffset %lu, ",
|
||||
printf("\tstartcluster %lu, dircluster %lu, diroffset %lu, ",
|
||||
dep->de_StartCluster, dep->de_dirclust, dep->de_diroffset);
|
||||
printf("on dev (%d, %d)\n", major(dep->de_dev), minor(dep->de_dev));
|
||||
return (0);
|
||||
|
@ -761,7 +761,6 @@ struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = {
|
||||
{ &vop_getattr_desc, (vop_t *)ntfs_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *)ntfs_inactive },
|
||||
{ &vop_reclaim_desc, (vop_t *)ntfs_reclaim },
|
||||
{ &vop_print_desc, (vop_t *)vop_null },
|
||||
{ &vop_pathconf_desc, ntfs_pathconf },
|
||||
|
||||
{ &vop_cachedlookup_desc, (vop_t *)ntfs_lookup },
|
||||
|
@ -771,8 +771,7 @@ null_print(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
printf("\ttag %s, vp=%p, lowervp=%p\n", vp->v_tag, vp,
|
||||
NULLVPTOLOWERVP(vp));
|
||||
printf("\tvp=%p, lowervp=%p\n", vp, NULLVPTOLOWERVP(vp));
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -755,7 +755,7 @@ int nwfs_print (ap)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct nwnode *np = VTONW(vp);
|
||||
|
||||
printf("nwfs node: name = '%s', fid = %d, pfid = %d\n",
|
||||
printf("\tnwfs node: name = '%s', fid = %d, pfid = %d\n",
|
||||
np->n_name, np->n_fid.f_id, np->n_fid.f_parent);
|
||||
return (0);
|
||||
}
|
||||
|
@ -561,7 +561,6 @@ static struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
|
||||
{ &vop_lookup_desc, (vop_t *) portal_lookup },
|
||||
{ &vop_open_desc, (vop_t *) portal_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_readdir_desc, (vop_t *) portal_readdir },
|
||||
{ &vop_reclaim_desc, (vop_t *) portal_reclaim },
|
||||
{ &vop_setattr_desc, (vop_t *) portal_setattr },
|
||||
|
@ -846,7 +846,7 @@ int smbfs_print (ap)
|
||||
printf("no smbnode data\n");
|
||||
return (0);
|
||||
}
|
||||
printf("name = %s, parent = %p, opencount = %d\n", np->n_name,
|
||||
printf("\tname = %s, parent = %p, opencount = %d\n", np->n_name,
|
||||
np->n_parent ? np->n_parent : NULL, np->n_opencount);
|
||||
return (0);
|
||||
}
|
||||
|
@ -534,7 +534,7 @@ spec_strategy(ap)
|
||||
static int once;
|
||||
|
||||
if (!once) {
|
||||
vprint("\nVOP_STRATEGY on VCHR\n", ap->a_vp);
|
||||
vprint("VOP_STRATEGY on VCHR", ap->a_vp);
|
||||
backtrace();
|
||||
once++;
|
||||
}
|
||||
@ -667,8 +667,7 @@ spec_print(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
printf("tag %s, dev %s\n", ap->a_vp->v_tag,
|
||||
devtoname(ap->a_vp->v_rdev));
|
||||
printf("\tdev %s\n", devtoname(ap->a_vp->v_rdev));
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,6 @@ static int udf_read(struct vop_read_args *);
|
||||
static int udf_readdir(struct vop_readdir_args *);
|
||||
static int udf_readlink(struct vop_readlink_args *ap);
|
||||
static int udf_strategy(struct vop_strategy_args *);
|
||||
static int udf_print(struct vop_print_args *);
|
||||
static int udf_bmap(struct vop_bmap_args *);
|
||||
static int udf_lookup(struct vop_cachedlookup_args *);
|
||||
static int udf_reclaim(struct vop_reclaim_args *);
|
||||
@ -75,7 +74,6 @@ static struct vnodeopv_entry_desc udf_vnodeop_entries[] = {
|
||||
{ &vop_ioctl_desc, (vop_t *) udf_ioctl },
|
||||
{ &vop_lookup_desc, (vop_t *) vfs_cache_lookup },
|
||||
{ &vop_pathconf_desc, (vop_t *) udf_pathconf },
|
||||
{ &vop_print_desc, (vop_t *) udf_print },
|
||||
{ &vop_read_desc, (vop_t *) udf_read },
|
||||
{ &vop_readdir_desc, (vop_t *) udf_readdir },
|
||||
{ &vop_readlink_desc, (vop_t *) udf_readlink },
|
||||
@ -832,13 +830,6 @@ udf_strategy(struct vop_strategy_args *a)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
udf_print(struct vop_print_args *a)
|
||||
{
|
||||
printf("%s called\n", __FUNCTION__);
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
static int
|
||||
udf_bmap(struct vop_bmap_args *a)
|
||||
{
|
||||
|
@ -436,8 +436,7 @@ umap_print(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
printf("\ttag %s, vp=%p, lowervp=%p\n", vp->v_tag, vp,
|
||||
UMAPVPTOLOWERVP(vp));
|
||||
printf("\tvp=%p, lowervp=%p\n", vp, UMAPVPTOLOWERVP(vp));
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -1756,7 +1756,7 @@ union_print(ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
printf("\ttag %s, vp=%p, uppervp=%p, lowervp=%p\n", vp->v_tag,
|
||||
printf("\tvp=%p, uppervp=%p, lowervp=%p\n",
|
||||
vp, UPPERVP(vp), LOWERVP(vp));
|
||||
if (UPPERVP(vp) != NULLVP)
|
||||
vprint("union: upper", UPPERVP(vp));
|
||||
|
@ -1498,7 +1498,7 @@ ext2_print(ap)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
|
||||
printf("ino %lu, on dev %s (%d, %d)", (u_long)ip->i_number,
|
||||
printf("\tino %lu, on dev %s (%d, %d)", (u_long)ip->i_number,
|
||||
devtoname(ip->i_dev), major(ip->i_dev), minor(ip->i_dev));
|
||||
if (vp->v_type == VFIFO)
|
||||
fifo_printinfo(vp);
|
||||
|
@ -1498,7 +1498,7 @@ ext2_print(ap)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
|
||||
printf("ino %lu, on dev %s (%d, %d)", (u_long)ip->i_number,
|
||||
printf("\tino %lu, on dev %s (%d, %d)", (u_long)ip->i_number,
|
||||
devtoname(ip->i_dev), major(ip->i_dev), minor(ip->i_dev));
|
||||
if (vp->v_type == VFIFO)
|
||||
fifo_printinfo(vp);
|
||||
|
@ -789,7 +789,6 @@ static struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
|
||||
{ &vop_ioctl_desc, (vop_t *) cd9660_ioctl },
|
||||
{ &vop_lookup_desc, (vop_t *) vfs_cache_lookup },
|
||||
{ &vop_pathconf_desc, (vop_t *) cd9660_pathconf },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_read_desc, (vop_t *) cd9660_read },
|
||||
{ &vop_readdir_desc, (vop_t *) cd9660_readdir },
|
||||
{ &vop_readlink_desc, (vop_t *) cd9660_readlink },
|
||||
@ -811,7 +810,6 @@ static struct vnodeopv_entry_desc cd9660_specop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) cd9660_access },
|
||||
{ &vop_getattr_desc, (vop_t *) cd9660_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) cd9660_inactive },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_reclaim_desc, (vop_t *) cd9660_reclaim },
|
||||
{ &vop_setattr_desc, (vop_t *) cd9660_setattr },
|
||||
{ NULL, NULL }
|
||||
@ -826,7 +824,6 @@ static struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
|
||||
{ &vop_access_desc, (vop_t *) cd9660_access },
|
||||
{ &vop_getattr_desc, (vop_t *) cd9660_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) cd9660_inactive },
|
||||
{ &vop_print_desc, (vop_t *) vop_null },
|
||||
{ &vop_reclaim_desc, (vop_t *) cd9660_reclaim },
|
||||
{ &vop_setattr_desc, (vop_t *) cd9660_setattr },
|
||||
{ NULL, NULL }
|
||||
|
@ -2864,10 +2864,8 @@ vprint(label, vp)
|
||||
printf(" flags (%s),", &buf[1]);
|
||||
lockmgr_printinfo(vp->v_vnlock);
|
||||
printf("\n");
|
||||
if (vp->v_data != NULL) {
|
||||
printf("\t");
|
||||
if (vp->v_data != NULL)
|
||||
VOP_PRINT(vp);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DDB
|
||||
@ -2892,7 +2890,7 @@ DB_SHOW_COMMAND(lockedvnods, lockedvnodes)
|
||||
mtx_lock(&mntvnode_mtx);
|
||||
TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) {
|
||||
if (VOP_ISLOCKED(vp, NULL))
|
||||
vprint((char *)0, vp);
|
||||
vprint(NULL, vp);
|
||||
}
|
||||
mtx_unlock(&mntvnode_mtx);
|
||||
mtx_lock(&mountlist_mtx);
|
||||
@ -3392,7 +3390,6 @@ vn_pollgone(vp)
|
||||
static int sync_fsync(struct vop_fsync_args *);
|
||||
static int sync_inactive(struct vop_inactive_args *);
|
||||
static int sync_reclaim(struct vop_reclaim_args *);
|
||||
static int sync_print(struct vop_print_args *);
|
||||
|
||||
static vop_t **sync_vnodeop_p;
|
||||
static struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
|
||||
@ -3403,7 +3400,6 @@ static struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
|
||||
{ &vop_reclaim_desc, (vop_t *) sync_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, (vop_t *) vop_stdlock }, /* lock */
|
||||
{ &vop_unlock_desc, (vop_t *) vop_stdunlock }, /* unlock */
|
||||
{ &vop_print_desc, (vop_t *) sync_print }, /* print */
|
||||
{ &vop_islocked_desc, (vop_t *) vop_stdislocked }, /* islocked */
|
||||
{ NULL, NULL }
|
||||
};
|
||||
@ -3424,7 +3420,7 @@ vfs_allocate_syncvnode(mp)
|
||||
int error;
|
||||
|
||||
/* Allocate a new vnode */
|
||||
if ((error = getnewvnode("vfs", mp, sync_vnodeop_p, &vp)) != 0) {
|
||||
if ((error = getnewvnode("syncer", mp, sync_vnodeop_p, &vp)) != 0) {
|
||||
mp->mnt_syncer = NULL;
|
||||
return (error);
|
||||
}
|
||||
@ -3551,24 +3547,6 @@ sync_reclaim(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Print out a syncer vnode.
|
||||
*/
|
||||
static int
|
||||
sync_print(ap)
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
printf("syncer vnode");
|
||||
if (vp->v_vnlock != NULL)
|
||||
lockmgr_printinfo(vp->v_vnlock);
|
||||
printf("\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* extract the dev_t from a VCHR
|
||||
*/
|
||||
|
@ -2890,8 +2890,8 @@ nfs_print(struct vop_print_args *ap)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct nfsnode *np = VTONFS(vp);
|
||||
|
||||
printf("tag %s fileid %ld fsid 0x%x",
|
||||
vp->v_tag, np->n_vattr.va_fileid, np->n_vattr.va_fsid);
|
||||
printf("\tfileid %ld fsid 0x%x",
|
||||
np->n_vattr.va_fileid, np->n_vattr.va_fsid);
|
||||
if (vp->v_type == VFIFO)
|
||||
fifo_printinfo(vp);
|
||||
printf("\n");
|
||||
|
@ -1984,7 +1984,7 @@ ufs_print(ap)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
|
||||
printf("ino %lu, on dev %s (%d, %d)", (u_long)ip->i_number,
|
||||
printf("\tino %lu, on dev %s (%d, %d)", (u_long)ip->i_number,
|
||||
devtoname(ip->i_dev), major(ip->i_dev), minor(ip->i_dev));
|
||||
if (vp->v_type == VFIFO)
|
||||
fifo_printinfo(vp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user