X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fdsl_synctask.c;h=f807ccc692c7998a91a700cea14a1bcc57fef751;hb=0d8103d9561bd2314da320dd5d43f9d5e044b64d;hp=832685b0fcf18938c1e3073fe3328cdd720bc7c9;hpb=428870ff734fdaccc342b33fc53cf94724409a46;p=zfs.git diff --git a/module/zfs/dsl_synctask.c b/module/zfs/dsl_synctask.c index 832685b..f807ccc 100644 --- a/module/zfs/dsl_synctask.c +++ b/module/zfs/dsl_synctask.c @@ -147,7 +147,7 @@ dsl_sync_task_group_destroy(dsl_sync_task_group_t *dstg) { dsl_sync_task_t *dst; - while (dst = list_head(&dstg->dstg_tasks)) { + while ((dst = list_head(&dstg->dstg_tasks))) { list_remove(&dstg->dstg_tasks, dst); kmem_free(dst, sizeof (dsl_sync_task_t)); } @@ -213,6 +213,8 @@ dsl_sync_task_do(dsl_pool_t *dp, dsl_sync_task_group_t *dstg; int err; + ASSERT(spa_writeable(dp->dp_spa)); + dstg = dsl_sync_task_group_create(dp); dsl_sync_task_create(dstg, checkfunc, syncfunc, arg1, arg2, blocks_modified); @@ -228,8 +230,16 @@ dsl_sync_task_do_nowait(dsl_pool_t *dp, { dsl_sync_task_group_t *dstg; + if (!spa_writeable(dp->dp_spa)) + return; + dstg = dsl_sync_task_group_create(dp); dsl_sync_task_create(dstg, checkfunc, syncfunc, arg1, arg2, blocks_modified); dsl_sync_task_group_nowait(dstg, tx); } + +#if defined(_KERNEL) && defined(HAVE_SPL) +EXPORT_SYMBOL(dsl_sync_task_do); +EXPORT_SYMBOL(dsl_sync_task_do_nowait); +#endif