svn commit: r302759 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Wed Jul 13 11:00:45 UTC 2016


Author: avg
Date: Wed Jul 13 11:00:44 2016
New Revision: 302759
URL: https://svnweb.freebsd.org/changeset/base/302759

Log:
  MFC r299949: try to recycle "snap" vnodes as soon as possible

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:58:52 2016	(r302758)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c	Wed Jul 13 11:00:44 2016	(r302759)
@@ -1479,17 +1479,28 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin
 	return (vp);
 }
 
+static int
+zfsctl_snapshot_inactive(ap)
+	struct vop_inactive_args /* {
+		struct vnode *a_vp;
+		struct thread *a_td;
+	} */ *ap;
+{
+	vnode_t *vp = ap->a_vp;
+
+	vrecycle(vp, curthread);
+	return (0);
+}
 
 static int
 zfsctl_snapshot_reclaim(ap)
-	struct vop_inactive_args /* {
+	struct vop_reclaim_args /* {
 		struct vnode *a_vp;
 		struct thread *a_td;
 	} */ *ap;
 {
 	vnode_t *vp = ap->a_vp;
 	cred_t *cr = ap->a_td->td_ucred;
-	struct vop_reclaim_args iap;
 	zfsctl_snapdir_t *sdp;
 	zfs_snapentry_t *sep, *next;
 	int locked;
@@ -1532,8 +1543,7 @@ zfsctl_snapshot_reclaim(ap)
 	 * "active".  If we lookup the same name again we will end up
 	 * creating a new vnode.
 	 */
-	iap.a_vp = vp;
-	gfs_vop_reclaim(&iap);
+	gfs_vop_reclaim(ap);
 	return (0);
 
 }
@@ -1586,7 +1596,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc
  */
 static struct vop_vector zfsctl_ops_snapshot = {
 	.vop_default =	&default_vnodeops,
-	.vop_inactive =	VOP_NULL,
+	.vop_inactive =	zfsctl_snapshot_inactive,
 	.vop_reclaim =	zfsctl_snapshot_reclaim,
 	.vop_vptocnp =	zfsctl_snapshot_vptocnp,
 };


More information about the svn-src-stable-9 mailing list