Print this page
zpool import speedup
*** 1001,1023 ****
* dmu_objset_{hold,rele}() are convenience routines that also do the pool
* hold/rele.
*/
int
! dsl_pool_hold(const char *name, void *tag, dsl_pool_t **dp)
{
spa_t *spa;
int error;
! error = spa_open(name, &spa, tag);
if (error == 0) {
*dp = spa_get_dsl(spa);
dsl_pool_config_enter(*dp, tag);
}
return (error);
}
void
dsl_pool_rele(dsl_pool_t *dp, void *tag)
{
dsl_pool_config_exit(dp, tag);
spa_close(dp->dp_spa, tag);
--- 1001,1029 ----
* dmu_objset_{hold,rele}() are convenience routines that also do the pool
* hold/rele.
*/
int
! dsl_pool_hold_lock(const char *name, void *tag, dsl_pool_t **dp, int lock)
{
spa_t *spa;
int error;
! error = spa_open_lock(name, &spa, tag, lock);
if (error == 0) {
*dp = spa_get_dsl(spa);
dsl_pool_config_enter(*dp, tag);
}
return (error);
}
+ int
+ dsl_pool_hold(const char *name, void *tag, dsl_pool_t **dp)
+ {
+ return (dsl_pool_hold_lock(name, tag, dp, 1));
+ }
+
void
dsl_pool_rele(dsl_pool_t *dp, void *tag)
{
dsl_pool_config_exit(dp, tag);
spa_close(dp->dp_spa, tag);