diff options
8 files changed, 24 insertions, 9 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c index 140af06..a306bb6 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c @@ -21,6 +21,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ #include <sys/dmu_objset.h> 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 858bf59..1213445 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 @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ #include <sys/dmu.h> @@ -1248,7 +1250,7 @@ would_change(dsl_dir_t *dd, int64_t delta, dsl_dir_t *ancestor) struct renamearg { dsl_dir_t *newparent; const char *mynewname; - boolean_t islegacy; + boolean_t allowmounted; }; static int @@ -1267,10 +1269,9 @@ dsl_dir_rename_check(void *arg1, void *arg2, dmu_tx_t *tx) * stats), but any that are present in open context will likely * be gone by syncing context, so only fail from syncing * context. - * Don't check if we are renaming dataset with mountpoint set to - * "legacy" or "none". + * Don't check if we allow renaming of busy (mounted) dataset. */ - if (!ra->islegacy && dmu_tx_is_syncing(tx) && + if (!ra->allowmounted && dmu_tx_is_syncing(tx) && dmu_buf_refcount(dd->dd_dbuf) > 1) { return (EBUSY); } @@ -1310,7 +1311,7 @@ dsl_dir_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx) objset_t *mos = dp->dp_meta_objset; int err; - ASSERT(ra->islegacy || dmu_buf_refcount(dd->dd_dbuf) <= 2); + ASSERT(ra->allowmounted || dmu_buf_refcount(dd->dd_dbuf) <= 2); if (ra->newparent != dd->dd_parent) { dsl_dir_diduse_space(dd->dd_parent, DD_USED_CHILD, @@ -1384,7 +1385,7 @@ dsl_dir_rename(dsl_dir_t *dd, const char *newname, int flags) goto out; } - ra.islegacy = !!(flags & ZFS_RENAME_IS_LEGACY); + ra.allowmounted = !!(flags & ZFS_RENAME_ALLOW_MOUNTED); err = dsl_sync_task_do(dd->dd_pool, dsl_dir_rename_check, dsl_dir_rename_sync, dd, &ra, 3); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h index ba2446e..e4b8127 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ #ifndef _SYS_DSL_DATASET_H @@ -181,8 +183,8 @@ struct dsl_ds_holdarg { /* * Flags for dsl_dataset_rename(). */ -#define ZFS_RENAME_RECURSIVE 0x01 -#define ZFS_RENAME_IS_LEGACY 0x02 +#define ZFS_RENAME_RECURSIVE 0x01 +#define ZFS_RENAME_ALLOW_MOUNTED 0x02 #define dsl_dataset_is_snapshot(ds) \ ((ds)->ds_phys->ds_num_children != 0) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h index 1ff03f4..9f2ddc6 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ #ifndef _SYS_DSL_DIR_H diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h index d4ef330..63cfb00 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ #ifndef _SYS_FS_ZFS_VFSOPS_H diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c index f7a4fb3..a880961 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ /* diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c index 8fe9287..f929c5e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ #include <sys/types.h> @@ -3266,7 +3268,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) if (zc->zc_cookie & 1) flags |= ZFS_RENAME_RECURSIVE; if (zc->zc_cookie & 2) - flags |= ZFS_RENAME_IS_LEGACY; + flags |= ZFS_RENAME_ALLOW_MOUNTED; zc->zc_value[sizeof (zc->zc_value) - 1] = '\0'; if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index c8f9bb9..211d73f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>. + * All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ |