Skip to content

Commit

Permalink
Use zfsctl_snapshot_hold() wrapper
Browse files Browse the repository at this point in the history
zfs_refcount_*() are to be wrapped by zfsctl_snapshot_*() in this file.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Tomohiro Kusumi <[email protected]>
Closes #9039
  • Loading branch information
kusumi authored and tonyhutter committed Sep 25, 2019
1 parent 984bfb3 commit 2b9f73e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static void
zfsctl_snapshot_add(zfs_snapentry_t *se)
{
ASSERT(RW_WRITE_HELD(&zfs_snapshot_lock));
zfs_refcount_add(&se->se_refcount, NULL);
zfsctl_snapshot_hold(se);
avl_add(&zfs_snapshots_by_name, se);
avl_add(&zfs_snapshots_by_objsetid, se);
}
Expand Down Expand Up @@ -269,7 +269,7 @@ zfsctl_snapshot_find_by_name(char *snapname)
search.se_name = snapname;
se = avl_find(&zfs_snapshots_by_name, &search, NULL);
if (se)
zfs_refcount_add(&se->se_refcount, NULL);
zfsctl_snapshot_hold(se);

return (se);
}
Expand All @@ -290,7 +290,7 @@ zfsctl_snapshot_find_by_objsetid(spa_t *spa, uint64_t objsetid)
search.se_objsetid = objsetid;
se = avl_find(&zfs_snapshots_by_objsetid, &search, NULL);
if (se)
zfs_refcount_add(&se->se_refcount, NULL);
zfsctl_snapshot_hold(se);

return (se);
}
Expand Down

0 comments on commit 2b9f73e

Please sign in to comment.