Skip to content

Commit

Permalink
matt feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
pcd1193182 committed Feb 26, 2020
1 parent 291d080 commit 892dd68
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion man/man8/zfs-wait.8
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
Waits until all background activity of the given types has ceased in the given
filesystem.
The activity could cease because it has completed or because the filesystem has
been destroyed.
been destroyed or unmounted.
If no activities are specified, the command waits until background activity of
every type listed below has ceased.
If there is no activity of the given types in progress, the command returns
Expand Down
2 changes: 0 additions & 2 deletions module/zfs/dsl_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -3235,8 +3235,6 @@ dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx)

VERIFY0(dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds));

dsl_dir_cancel_waiters(ds->ds_dir);

dsl_dataset_name(ds->ds_prev, namebuf);
fnvlist_add_string(ddra->ddra_result, "target", namebuf);

Expand Down
11 changes: 4 additions & 7 deletions module/zfs/dsl_destroy.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,14 +763,11 @@ dsl_destroy_head_check_impl(dsl_dataset_t *ds, int expected_holds)
if (ds->ds_is_snapshot)
return (SET_ERROR(EINVAL));

dsl_dir_t *dd = ds->ds_dir;
mutex_enter(&dd->dd_activity_lock);
if (zfs_refcount_count(&ds->ds_longholds) != expected_holds +
dd->dd_activity_count) {
mutex_exit(&dd->dd_activity_lock);
if (zfs_refcount_count(&ds->ds_longholds) != expected_holds)
return (SET_ERROR(EBUSY));
}
mutex_exit(&dd->dd_activity_lock);

ASSERT0(ds->ds_dir->dd_activity_count);
mutex_exit(&ds->ds_dir->dd_activity_lock);

mos = ds->ds_dir->dd_pool->dp_meta_objset;

Expand Down
2 changes: 1 addition & 1 deletion module/zfs/dsl_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,7 @@ dsl_dir_activity_in_progress(dsl_dir_t *dd, dsl_dataset_t *ds,
break;

if (dmu_objset_type(os) != DMU_OST_ZFS ||
dmu_objset_get_user(os) == NULL ||
zfs_get_vfs_flag_unmounted(os)) {
*in_progress = B_FALSE;
return (0);
Expand Down Expand Up @@ -2392,5 +2393,4 @@ dsl_dir_cancel_waiters(dsl_dir_t *dd)
#if defined(_KERNEL)
EXPORT_SYMBOL(dsl_dir_set_quota);
EXPORT_SYMBOL(dsl_dir_set_reservation);
EXPORT_SYMBOL(dsl_dir_cancel_waiters);
#endif
9 changes: 2 additions & 7 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4126,17 +4126,12 @@ zfs_ioc_wait_fs(const char *name, nvlist_t *innvl, nvlist_t *outnvl)
if ((error = dsl_pool_hold(name, FTAG, &dp)) != 0)
return (error);

if ((error = dsl_dir_hold(dp, name, FTAG, &dd, NULL)) != 0) {
if ((error = dsl_dataset_hold(dp, name, FTAG, &ds)) != 0) {
dsl_pool_rele(dp, FTAG);
return (error);
}

if ((error = dsl_dataset_hold_obj(dd->dd_pool,
dsl_dir_phys(dd)->dd_head_dataset_obj, FTAG, &ds)) != 0) {
dsl_pool_rele(dp, FTAG);
dsl_dir_rele(dd, FTAG);
return (error);
}
dd = ds->ds_dir;
mutex_enter(&dd->dd_activity_lock);
dd->dd_activity_count++;

Expand Down

0 comments on commit 892dd68

Please sign in to comment.