]> granicus.if.org Git - zfs/commitdiff
Merge commit 'refs/top-bases/gcc-cast' into gcc-cast
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 2 Jul 2009 23:50:53 +0000 (16:50 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 2 Jul 2009 23:50:53 +0000 (16:50 -0700)
Conflicts:

cmd/zfs/zfs_main.c
lib/libzfs/libzfs_dataset.c

1  2 
cmd/zfs/zfs_main.c
cmd/zpool/zpool_main.c
lib/libzfs/libzfs_dataset.c
lib/libzfs/libzfs_pool.c
lib/libzfs/libzfs_sendrecv.c
lib/libzfs/libzfs_util.c
module/zfs/arc.c
module/zfs/zap.c
module/zfs/zfs_ioctl.c

index c73fb93219a2e17f0c2b99dc08c3049e97adfb1e,0752a4772e5c6077792d4e0fd9dbc2428f542061..fe0ca75985f5117d15e43d7897fd09f5c0f6f207
@@@ -1435,21 -1490,30 +1490,29 @@@ upgrade_set_callback(zfs_handle_t *zhp
  {
        upgrade_cbdata_t *cb = data;
        int version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
-       if (cb->cb_version >= ZPL_VERSION_FUID) {
-               int spa_version;
-               if (zfs_spa_version(zhp, &spa_version) < 0)
-                       return (-1);
-               if (spa_version < SPA_VERSION_FUID) {
-                       /* can't upgrade */
-                       (void) printf(gettext("%s: can not be upgraded; "
-                           "the pool version needs to first be upgraded\nto "
-                           "version %llu\n\n"),
-                           zfs_get_name(zhp), SPA_VERSION_FUID);
-                       cb->cb_numfailed++;
-                       return (0);
+       int i;
+       static struct { int zplver; int spaver; } table[] = {
+               {ZPL_VERSION_FUID, SPA_VERSION_FUID},
+               {ZPL_VERSION_USERSPACE, SPA_VERSION_USERSPACE},
+               {0, 0}
+       };
 -
+       for (i = 0; table[i].zplver; i++) {
+               if (cb->cb_version >= table[i].zplver) {
+                       int spa_version;
+                       if (zfs_spa_version(zhp, &spa_version) < 0)
+                               return (-1);
+                       if (spa_version < table[i].spaver) {
+                               /* can't upgrade */
+                               (void) printf(gettext("%s: can not be "
+                                   "upgraded; the pool version needs to first "
+                                   "be upgraded\nto version %d\n\n"),
+                                   zfs_get_name(zhp), table[i].spaver);
+                               cb->cb_numfailed++;
+                               return (0);
+                       }
                }
        }
  
@@@ -1561,9 -1627,9 +1626,9 @@@ zfs_do_upgrade(int argc, char **argv
                if (cb.cb_version == 0)
                        cb.cb_version = ZPL_VERSION;
                ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_FILESYSTEM,
-                   NULL, NULL, upgrade_set_callback, &cb);
+                   NULL, NULL, 0, upgrade_set_callback, &cb);
                (void) printf(gettext("%llu filesystems upgraded\n"),
 -                  cb.cb_numupgraded);
 +                  (u_longlong_t)cb.cb_numupgraded);
                if (cb.cb_numsamegraded) {
                        (void) printf(gettext("%llu filesystems already at "
                            "this version\n"),
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index aa7ffb59de25e0a6e1d8122bfaff27f845a574fd,07dd03c3544579a21f3a95156f80969da884a674..f74f5f9a8c10437efabdc4ae5f8a747dfb6c8c84
@@@ -2083,9 -2367,9 +2367,9 @@@ zfs_ioc_create(zfs_cmd_t *zc
            strchr(zc->zc_name, '%'))
                return (EINVAL);
  
 -      if (zc->zc_nvlist_src != NULL &&
 +      if (zc->zc_nvlist_src != 0 &&
            (error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
-           &nvprops)) != 0)
+           zc->zc_iflags, &nvprops)) != 0)
                return (error);
  
        zct.zct_zplprops = NULL;
@@@ -2227,31 -2491,25 +2491,25 @@@ zfs_ioc_snapshot(zfs_cmd_t *zc
        if (snapshot_namecheck(zc->zc_value, NULL, NULL) != 0)
                return (EINVAL);
  
 -      if (zc->zc_nvlist_src != NULL &&
 +      if (zc->zc_nvlist_src != 0 &&
            (error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
-           &nvprops)) != 0)
+           zc->zc_iflags, &nvprops)) != 0)
                return (error);
  
-       error = dmu_objset_snapshot(zc->zc_name, zc->zc_value, recursive);
+       error = zfs_check_userprops(zc->zc_name, nvprops);
+       if (error)
+               goto out;
  
-       /*
-        * It would be nice to do this atomically.
-        */
-       if (error == 0) {
-               struct snap_prop_arg snpa;
-               snpa.nvprops = nvprops;
-               snpa.snapname = zc->zc_value;
-               if (recursive) {
-                       error = dmu_objset_find(zc->zc_name,
-                           set_snap_props, &snpa, DS_FIND_CHILDREN);
-                       if (error) {
-                               (void) dmu_snapshots_destroy(zc->zc_name,
-                                   zc->zc_value);
-                       }
-               } else {
-                       error = set_snap_props(zc->zc_name, &snpa);
-               }
+       if (nvprops != NULL && nvlist_next_nvpair(nvprops, NULL) != NULL &&
+           zfs_earlier_version(zc->zc_name, SPA_VERSION_SNAP_PROPS)) {
+               error = ENOTSUP;
+               goto out;
        }
+       error = dmu_objset_snapshot(zc->zc_name, zc->zc_value,
+           nvprops, recursive);
+ out:
        nvlist_free(nvprops);
        return (error);
  }
@@@ -2482,9 -2728,9 +2728,9 @@@ zfs_ioc_recv(zfs_cmd_t *zc
        *tosnap = '\0';
        tosnap++;
  
 -      if (zc->zc_nvlist_src != NULL &&
 +      if (zc->zc_nvlist_src != 0 &&
            (error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
-           &props)) != 0)
+           zc->zc_iflags, &props)) != 0)
                return (error);
  
        fd = zc->zc_cookie;