HomeFreeBSD

Use long holds in zvol_set_volsize()

Description

Use long holds in zvol_set_volsize()

Under Linux the zvol_set_volsize() function was originally written
to use dmu_objset_hold()/dmu_objset_rele(). Subsequently, the
dmu_objset_own()/dmu_objset_disown() interfaces were added but
the ZVOL code wasn't updated to take advantage of them.

This was never an issue but after the dsl_pool_config changes
the code now takes the config lock twice. The cleanest solution
is to shift to using dmu_objset_own() which takes a long hold
on the dataset and does not hold the dsl pool lock.

This patch also slightly restructures the existing code such
that it more closely resembles the upstream Illumos code.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2039

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jan 13 2014, 10:27 PM
Parents
rG0f62f3f9abc4: Disable GCCs aggressive loop optimization
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG35d3e32274ff: Use long holds in zvol_set_volsize() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jan 14 2014, 10:46 PM