diff options
author | pjd <pjd@FreeBSD.org> | 2011-03-05 22:31:03 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-03-05 22:31:03 +0000 |
commit | 683dbd85eab4513a44d599a3e6aa1a86762ab980 (patch) | |
tree | c7d10a0d94f8e4afdea8938c83adf21f5b550da4 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c | |
parent | b6fdc015ea1d9d3db5571a028c4895004bd8d9b0 (diff) | |
download | FreeBSD-src-683dbd85eab4513a44d599a3e6aa1a86762ab980.zip FreeBSD-src-683dbd85eab4513a44d599a3e6aa1a86762ab980.tar.gz |
Make renaming of a ZVOL, ZVOL's parent directory and ZVOL snapshot work.
Reported by: avg
MFC after: 1 month
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c index 1cd49c8..79f45f2 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c @@ -36,6 +36,7 @@ #include <sys/zio.h> #include <sys/arc.h> #include <sys/sunddi.h> +#include <sys/zvol.h> #include "zfs_namecheck.h" static uint64_t dsl_dir_space_towrite(dsl_dir_t *dd); @@ -1294,6 +1295,7 @@ dsl_dir_rename_check(void *arg1, void *arg2, dmu_tx_t *tx) static void dsl_dir_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx) { + char oldname[MAXPATHLEN], newname[MAXPATHLEN]; dsl_dir_t *dd = arg1; struct renamearg *ra = arg2; dsl_pool_t *dp = dd->dd_pool; @@ -1326,6 +1328,7 @@ dsl_dir_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx) dmu_buf_will_dirty(dd->dd_dbuf, tx); /* remove from old parent zapobj */ + dsl_dir_name(dd, oldname); err = zap_remove(mos, dd->dd_parent->dd_phys->dd_child_dir_zapobj, dd->dd_myname, tx); ASSERT3U(err, ==, 0); @@ -1340,6 +1343,8 @@ dsl_dir_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx) err = zap_add(mos, ra->newparent->dd_phys->dd_child_dir_zapobj, dd->dd_myname, 8, 1, &dd->dd_object, tx); ASSERT3U(err, ==, 0); + dsl_dir_name(dd, newname); + zvol_rename_minors(oldname, newname); spa_history_log_internal(LOG_DS_RENAME, dd->dd_pool->dp_spa, tx, "dataset = %llu", dd->dd_phys->dd_head_dataset_obj); |