Date: Thu, 23 Mar 2017 08:22:28 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315849 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201703230822.v2N8MSkC098785@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Thu Mar 23 08:22:27 2017 New Revision: 315849 URL: https://svnweb.freebsd.org/changeset/base/315849 Log: MFC r315076: zfs: provide a special vptocnp method for the .zfs vnode Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Mar 23 08:22:11 2017 (r315848) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Mar 23 08:22:27 2017 (r315849) @@ -706,6 +706,28 @@ zfsctl_root_readdir(ap) return (0); } +static int +zfsctl_root_vptocnp(struct vop_vptocnp_args *ap) +{ + static const char dotzfs_name[4] = ".zfs"; + vnode_t *dvp; + int error; + + if (*ap->a_buflen < sizeof (dotzfs_name)) + return (SET_ERROR(ENOMEM)); + + error = vn_vget_ino_gen(ap->a_vp, zfsctl_fs_root_vnode, NULL, + LK_SHARED, &dvp); + if (error != 0) + return (SET_ERROR(error)); + + VOP_UNLOCK(dvp, 0); + *ap->a_vpp = dvp; + *ap->a_buflen -= sizeof (dotzfs_name); + bcopy(dotzfs_name, ap->a_buf + *ap->a_buflen, sizeof (dotzfs_name)); + return (0); +} + static struct vop_vector zfsctl_ops_root = { .vop_default = &default_vnodeops, .vop_open = zfsctl_common_open, @@ -719,6 +741,7 @@ static struct vop_vector zfsctl_ops_root .vop_reclaim = zfsctl_common_reclaim, .vop_fid = zfsctl_common_fid, .vop_print = zfsctl_common_print, + .vop_vptocnp = zfsctl_root_vptocnp, }; static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703230822.v2N8MSkC098785>