mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
Illumos #3464
3464 zfs synctask code needs restructuring Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Approved by: Garrett D'Amore <garrett@damore.org> References: https://www.illumos.org/issues/3464 illumos/illumos-gate@3b2aab1880 Ported-by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1495
This commit is contained in:
committed by
Brian Behlendorf
parent
6f1ffb0665
commit
13fe019870
+11
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user