diff options
author | Mark Maybee <[email protected]> | 2021-01-27 22:31:51 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-27 21:31:51 -0800 |
commit | b2c5904a7839b93fa30bba261a5981161acea336 (patch) | |
tree | c82a3a48a21db7573f96bd4475a7beb0f7fb1c14 /module/zfs/dsl_dataset.c | |
parent | 2921ad6cba54522a33fc95f90237c6e5ead80de7 (diff) |
Revert special case code from pre-hashtable nvlist era
Before a hash table was added on top of the nvlist code, there were
cases where the nvlist allocation was changed from fnvlist_alloc()
to nvlist_alloc() to avoid expensive NV_UNIQUE_NAME checks. Now
this is no longer necessary. These changes should be reverted to be
consistent with other code. There are some cases where this change
will also reduce the number of iterations.
Reviewed-by: Serapheim Dimitropoulos <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mark Maybee <[email protected]>
Closes #11464
Diffstat (limited to 'module/zfs/dsl_dataset.c')
-rw-r--r-- | module/zfs/dsl_dataset.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index de60c3358..6da5faf01 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -2322,18 +2322,7 @@ void get_clones_stat(dsl_dataset_t *ds, nvlist_t *nv) { nvlist_t *propval = fnvlist_alloc(); - nvlist_t *val; - - /* - * We use nvlist_alloc() instead of fnvlist_alloc() because the - * latter would allocate the list with NV_UNIQUE_NAME flag. - * As a result, every time a clone name is appended to the list - * it would be (linearly) searched for a duplicate name. - * We already know that all clone names must be unique and we - * want avoid the quadratic complexity of double-checking that - * because we can have a large number of clones. - */ - VERIFY0(nvlist_alloc(&val, 0, KM_SLEEP)); + nvlist_t *val = fnvlist_alloc(); if (get_clones_stat_impl(ds, val) == 0) { fnvlist_add_nvlist(propval, ZPROP_VALUE, val); |