From owner-svn-src-all@freebsd.org Wed Jul 13 11:18:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D195B972B7; Wed, 13 Jul 2016 11:18:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEB9519C2; Wed, 13 Jul 2016 11:18:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6DBIcB0031178; Wed, 13 Jul 2016 11:18:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6DBIcZD031177; Wed, 13 Jul 2016 11:18:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201607131118.u6DBIcZD031177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 Jul 2016 11:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r302766 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2016 11:18:39 -0000 Author: avg Date: Wed Jul 13 11:18:37 2016 New Revision: 302766 URL: https://svnweb.freebsd.org/changeset/base/302766 Log: MFC r300145: add vop_print methods to vnode operatios of various zfsctl node types Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jul 13 11:16:12 2016 (r302765) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jul 13 11:18:37 2016 (r302766) @@ -293,6 +293,22 @@ zfsctl_root(znode_t *zp) return (zp->z_zfsvfs->z_ctldir); } +static int +zfsctl_common_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + gfs_file_t *fp = vp->v_data; + + printf(" parent = %p\n", fp->gfs_parent); + printf(" type = %d\n", fp->gfs_type); + printf(" index = %d\n", fp->gfs_index); + printf(" ino = %ju\n", (uintmax_t)fp->gfs_ino); + return (0); +} + /* * Common open routine. Disallow any write access. */ @@ -583,6 +599,17 @@ relookup: return (err); } +static int +zfsctl_root_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + printf(" .zfs node\n"); + zfsctl_common_print(ap); + return (0); +} + #ifdef illumos static int zfsctl_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr, @@ -633,6 +660,7 @@ static struct vop_vector zfsctl_ops_root .vop_pathconf = zfsctl_pathconf, #endif .vop_fid = zfsctl_common_fid, + .vop_print = zfsctl_root_print, }; /* @@ -1366,6 +1394,32 @@ zfsctl_snapdir_reclaim(ap) return (0); } +static int +zfsctl_shares_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + printf(" .zfs/shares node\n"); + zfsctl_common_print(ap); + return (0); +} + +static int +zfsctl_snapdir_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + zfsctl_snapdir_t *sdp = vp->v_data; + + printf(" .zfs/snapshot node\n"); + printf(" number of children = %lu\n", avl_numnodes(&sdp->sd_snaps)); + zfsctl_common_print(ap); + return (0); +} + #ifdef sun static const fs_operation_def_t zfsctl_tops_snapdir[] = { { VOPNAME_OPEN, { .vop_open = zfsctl_common_open } }, @@ -1411,6 +1465,7 @@ static struct vop_vector zfsctl_ops_snap .vop_inactive = VOP_NULL, .vop_reclaim = zfsctl_snapdir_reclaim, .vop_fid = zfsctl_common_fid, + .vop_print = zfsctl_snapdir_print, }; static struct vop_vector zfsctl_ops_shares = { @@ -1425,6 +1480,7 @@ static struct vop_vector zfsctl_ops_shar .vop_inactive = VOP_NULL, .vop_reclaim = gfs_vop_reclaim, .vop_fid = zfsctl_shares_fid, + .vop_print = zfsctl_shares_print, }; #endif /* !sun */ @@ -1561,6 +1617,21 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc return (error); } +static int +zfsctl_snaphot_print(ap) + struct vop_print_args /* { + struct vnode *a_vp; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + zfsctl_node_t *zcp = vp->v_data; + + printf(" .zfs/snapshot/ node\n"); + printf(" id = %ju\n", (uintmax_t)zcp->zc_id); + zfsctl_common_print(ap); + return (0); +} + /* * These VP's should never see the light of day. They should always * be covered. @@ -1570,6 +1641,7 @@ static struct vop_vector zfsctl_ops_snap .vop_inactive = zfsctl_snapshot_inactive, .vop_reclaim = zfsctl_snapshot_reclaim, .vop_vptocnp = zfsctl_snapshot_vptocnp, + .vop_print = zfsctl_snaphot_print, }; int