svn commit: r302745 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Andriy Gapon
avg at FreeBSD.org
Wed Jul 13 10:06:18 UTC 2016
Author: avg
Date: Wed Jul 13 10:06:17 2016
New Revision: 302745
URL: https://svnweb.freebsd.org/changeset/base/302745
Log:
MFC r299914: zfsctl_ops_snapshot: remove methods should never be called
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 10:03:14 2016 (r302744)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jul 13 10:06:17 2016 (r302745)
@@ -1497,92 +1497,6 @@ end:
}
static int
-zfsctl_traverse_begin(vnode_t **vpp, int lktype)
-{
-
- VN_HOLD(*vpp);
- /* Snapshot should be already mounted, but just in case. */
- if (vn_mountedvfs(*vpp) == NULL)
- return (ENOENT);
- return (traverse(vpp, lktype));
-}
-
-static void
-zfsctl_traverse_end(vnode_t *vp, int err)
-{
-
- if (err == 0)
- vput(vp);
- else
- VN_RELE(vp);
-}
-
-static int
-zfsctl_snapshot_getattr(ap)
- struct vop_getattr_args /* {
- struct vnode *a_vp;
- struct vattr *a_vap;
- struct ucred *a_cred;
- } */ *ap;
-{
- vnode_t *vp = ap->a_vp;
- int err;
-
- err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY);
- if (err == 0)
- err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred);
- zfsctl_traverse_end(vp, err);
- return (err);
-}
-
-static int
-zfsctl_snapshot_fid(ap)
- struct vop_fid_args /* {
- struct vnode *a_vp;
- struct fid *a_fid;
- } */ *ap;
-{
- vnode_t *vp = ap->a_vp;
- int err;
-
- err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY);
- if (err == 0)
- err = VOP_VPTOFH(vp, (void *)ap->a_fid);
- zfsctl_traverse_end(vp, err);
- return (err);
-}
-
-static int
-zfsctl_snapshot_lookup(ap)
- struct vop_lookup_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- } */ *ap;
-{
- vnode_t *dvp = ap->a_dvp;
- vnode_t **vpp = ap->a_vpp;
- struct componentname *cnp = ap->a_cnp;
- cred_t *cr = ap->a_cnp->cn_cred;
- zfsvfs_t *zfsvfs = dvp->v_vfsp->vfs_data;
- int error;
-
- if (cnp->cn_namelen != 2 || cnp->cn_nameptr[0] != '.' ||
- cnp->cn_nameptr[1] != '.') {
- return (ENOENT);
- }
-
- ASSERT(dvp->v_type == VDIR);
- ASSERT(zfsvfs->z_ctldir != NULL);
-
- error = zfsctl_root_lookup(zfsvfs->z_ctldir, "snapshot", vpp,
- NULL, 0, NULL, cr, NULL, NULL, NULL);
- if (error == 0)
- vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
- return (error);
-}
-
-static int
zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap)
{
zfsvfs_t *zfsvfs = ap->a_vp->v_vfsp->vfs_data;
@@ -1631,10 +1545,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc
static struct vop_vector zfsctl_ops_snapshot = {
.vop_default = &default_vnodeops,
.vop_inactive = zfsctl_snapshot_inactive,
- .vop_lookup = zfsctl_snapshot_lookup,
.vop_reclaim = zfsctl_common_reclaim,
- .vop_getattr = zfsctl_snapshot_getattr,
- .vop_fid = zfsctl_snapshot_fid,
.vop_vptocnp = zfsctl_snapshot_vptocnp,
};
More information about the svn-src-stable-9
mailing list