summaryrefslogtreecommitdiffstats
path: root/module/zfs/zvol.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2013-09-04 07:00:57 -0500
committerBrian Behlendorf <[email protected]>2013-09-04 16:01:24 -0700
commit13fe019870c8779bf2f5b3ff731b512cf89133ef (patch)
tree67a9c6989bcb7c2ca6d0455c14713bcbf1899da6 /module/zfs/zvol.c
parent6f1ffb06655008c9b519108ed29fbf03acd6e5de (diff)
Illumos #3464
3464 zfs synctask code needs restructuring Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Christopher Siden <[email protected]> Approved by: Garrett D'Amore <[email protected]> References: https://www.illumos.org/issues/3464 illumos/illumos-gate@3b2aab18808792cbd248a12f1edf139b89833c13 Ported-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1495
Diffstat (limited to 'module/zfs/zvol.c')
-rw-r--r--module/zfs/zvol.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
index b51615637..f52d8bbc1 100644
--- a/module/zfs/zvol.c
+++ b/module/zfs/zvol.c
@@ -315,6 +315,13 @@ zvol_set_volsize(const char *name, uint64_t volsize)
uint64_t readonly;
int error;
+ error = dsl_prop_get_integer(name,
+ zfs_prop_to_name(ZFS_PROP_READONLY), &readonly, NULL);
+ if (error != 0)
+ return (error);
+ if (readonly)
+ return (EROFS);
+
mutex_enter(&zvol_state_lock);
zv = zvol_find_by_name(name);
@@ -1459,8 +1466,7 @@ zvol_remove_minor(const char *name)
}
static int
-zvol_create_minors_cb(spa_t *spa, uint64_t dsobj,
- const char *dsname, void *arg)
+zvol_create_minors_cb(const char *dsname, void *arg)
{
if (strchr(dsname, '/') == NULL)
return 0;
@@ -1474,7 +1480,7 @@ zvol_create_minors_cb(spa_t *spa, uint64_t dsobj,
* for all available pools.
*/
int
-zvol_create_minors(const char *pool)
+zvol_create_minors(char *pool)
{
spa_t *spa = NULL;
int error = 0;
@@ -1484,13 +1490,12 @@ zvol_create_minors(const char *pool)
mutex_enter(&zvol_state_lock);
if (pool) {
- error = dmu_objset_find_spa(NULL, pool, zvol_create_minors_cb,
+ error = dmu_objset_find(pool, zvol_create_minors_cb,
NULL, DS_FIND_CHILDREN | DS_FIND_SNAPSHOTS);
} else {
mutex_enter(&spa_namespace_lock);
while ((spa = spa_next(spa)) != NULL) {
- error = dmu_objset_find_spa(NULL,
- spa_name(spa), zvol_create_minors_cb, NULL,
+ error = dmu_objset_find(spa_name(spa), zvol_create_minors_cb, NULL,
DS_FIND_CHILDREN | DS_FIND_SNAPSHOTS);
if (error)
break;