X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=lib%2Flibzfs%2Flibzfs_changelist.c;h=3a83e2d71ccde0f5cdc5a91383291fc3c0b677a1;hb=50fe577d1f3bd06e15fe2006459debd9fdffd04a;hp=6f067d563631bfa7e6ef0a020789e9a19cb093d4;hpb=d603ed6c278f9c25b17ba8e75e9bce6e5d715ac0;p=zfs.git diff --git a/lib/libzfs/libzfs_changelist.c b/lib/libzfs/libzfs_changelist.c index 6f067d5..3a83e2d 100644 --- a/lib/libzfs/libzfs_changelist.c +++ b/lib/libzfs/libzfs_changelist.c @@ -93,7 +93,6 @@ struct prop_changelist { int changelist_prefix(prop_changelist_t *clp) { -#ifdef HAVE_ZPL prop_changenode_t *cn; int ret = 0; @@ -142,9 +141,6 @@ changelist_prefix(prop_changelist_t *clp) (void) changelist_postfix(clp); return (ret); -#else - return 0; -#endif /* HAVE_ZPL */ } /* @@ -159,7 +155,6 @@ changelist_prefix(prop_changelist_t *clp) int changelist_postfix(prop_changelist_t *clp) { -#ifdef HAVE_ZPL prop_changenode_t *cn; char shareopts[ZFS_MAXPROPLEN]; int errors = 0; @@ -260,9 +255,6 @@ changelist_postfix(prop_changelist_t *clp) } return (errors ? -1 : 0); -#else - return 0; -#endif /* HAVE_ZPL */ } /* @@ -299,22 +291,30 @@ changelist_rename(prop_changelist_t *clp, const char *src, const char *dst) for (cn = uu_list_first(clp->cl_list); cn != NULL; cn = uu_list_next(clp->cl_list, cn)) { + zfs_handle_t *hdl; + + hdl = cn->cn_handle; + /* * Do not rename a clone that's not in the source hierarchy. */ - if (!isa_child_of(cn->cn_handle->zfs_name, src)) + if (!isa_child_of(hdl->zfs_name, src)) continue; /* * Destroy the previous mountpoint if needed. */ - remove_mountpoint(cn->cn_handle); + remove_mountpoint(hdl); (void) strlcpy(newname, dst, sizeof (newname)); - (void) strcat(newname, cn->cn_handle->zfs_name + strlen(src)); + (void) strcat(newname, hdl->zfs_name + strlen(src)); + + if (ZFS_IS_VOLUME(hdl)) { + (void) zvol_remove_link(hdl->zfs_hdl, hdl->zfs_name); + (void) zvol_create_link(hdl->zfs_hdl, newname); + } - (void) strlcpy(cn->cn_handle->zfs_name, newname, - sizeof (cn->cn_handle->zfs_name)); + (void) strlcpy(hdl->zfs_name, newname, sizeof (hdl->zfs_name)); } } @@ -325,7 +325,6 @@ changelist_rename(prop_changelist_t *clp, const char *src, const char *dst) int changelist_unshare(prop_changelist_t *clp, zfs_share_proto_t *proto) { -#ifdef HAVE_ZPL prop_changenode_t *cn; int ret = 0; @@ -340,9 +339,6 @@ changelist_unshare(prop_changelist_t *clp, zfs_share_proto_t *proto) } return (ret); -#else - return 0; -#endif } /*