Author: pjd
Date: Mon Oct 24 21:31:53 2011
New Revision: 226707
URL: http://svn.freebsd.org/changeset/base/226707

Log:
  - Use better naming now that we allow to rename any mounted file system (not
    only legacy).
  - Update copyright to include myself.
  
  MFC after:    2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   Mon Oct 
24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c   Mon Oct 
24 21:31:53 2011        (r226707)
@@ -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 <[email protected]>.
+ * All rights reserved.
  */
 
 #include <sys/dmu_objset.h>

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c       Mon Oct 
24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c       Mon Oct 
24 21:31:53 2011        (r226707)
@@ -20,6 +20,8 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 Pawel Jakub Dawidek <[email protected]>.
+ * All rights reserved.
  */
 
 #include <sys/dmu.h>
@@ -1248,7 +1250,7 @@ would_change(dsl_dir_t *dd, int64_t delt
 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 *a
         * 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 *ar
        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
                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);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h       
Mon Oct 24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h       
Mon Oct 24 21:31:53 2011        (r226707)
@@ -20,6 +20,8 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 Pawel Jakub Dawidek <[email protected]>.
+ * 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)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h   Mon Oct 
24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h   Mon Oct 
24 21:31:53 2011        (r226707)
@@ -20,6 +20,8 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 Pawel Jakub Dawidek <[email protected]>.
+ * All rights reserved.
  */
 
 #ifndef        _SYS_DSL_DIR_H

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h        
Mon Oct 24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h        
Mon Oct 24 21:31:53 2011        (r226707)
@@ -20,6 +20,8 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 Pawel Jakub Dawidek <[email protected]>.
+ * All rights reserved.
  */
 
 #ifndef        _SYS_FS_ZFS_VFSOPS_H

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c    Mon Oct 
24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c    Mon Oct 
24 21:31:53 2011        (r226707)
@@ -20,6 +20,8 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 Pawel Jakub Dawidek <[email protected]>.
+ * All rights reserved.
  */
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c     Mon Oct 
24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c     Mon Oct 
24 21:31:53 2011        (r226707)
@@ -20,6 +20,8 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 Pawel Jakub Dawidek <[email protected]>.
+ * 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 ||

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c    Mon Oct 
24 21:22:55 2011        (r226706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c    Mon Oct 
24 21:31:53 2011        (r226707)
@@ -20,6 +20,8 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011 Pawel Jakub Dawidek <[email protected]>.
+ * All rights reserved.
  */
 
 /* Portions Copyright 2010 Robert Milkowski */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to