diff options
author | avg <avg@FreeBSD.org> | 2016-07-13 10:32:24 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2016-07-13 10:32:24 +0000 |
commit | 6511a6ba4e2e5a4cefe296207db2a3891b87121e (patch) | |
tree | b5a963169b78c15fa34634d6572f2304a7075182 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c | |
parent | 47ee1070eda527689702b3043dda3ca1d7730c9d (diff) | |
download | FreeBSD-src-6511a6ba4e2e5a4cefe296207db2a3891b87121e.zip FreeBSD-src-6511a6ba4e2e5a4cefe296207db2a3891b87121e.tar.gz |
MFC r299949: try to recycle "snap" vnodes as soon as possible
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c index 14d39b9..1f92459 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c @@ -1536,17 +1536,28 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uint64_t objset) 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); + 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; @@ -1589,8 +1600,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); } @@ -1658,7 +1668,7 @@ zfsctl_snaphot_print(ap) */ 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, .vop_print = zfsctl_snaphot_print, |