Print this page
Use the LZ4 algorithm to compress metadata when the corresponding feature is enabled

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfs_ioctl.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_ioctl.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Portions Copyright 2011 Martin Matuska
  25   25   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  26   26   * Copyright (c) 2014, Joyent, Inc. All rights reserved.
  27   27   * Copyright (c) 2013 by Delphix. All rights reserved.
  28   28   * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  29   29   * Copyright (c) 2013 Steven Hartland. All rights reserved.
       30 + * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved.
  30   31   */
  31   32  
  32   33  /*
  33   34   * ZFS ioctls.
  34   35   *
  35   36   * This file handles the ioctls to /dev/zfs, used for configuring ZFS storage
  36   37   * pools and filesystems, e.g. with /sbin/zfs and /sbin/zpool.
  37   38   *
  38   39   * There are two ways that we handle ioctls: the legacy way where almost
  39   40   * all of the logic is in the ioctl callback, and the new way where most
↓ open down ↓ 2406 lines elided ↑ open up ↑
2446 2447                  if (err == 0 && intval >= ZPL_VERSION_USERSPACE) {
2447 2448                          zfs_cmd_t *zc;
2448 2449  
2449 2450                          zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP);
2450 2451                          (void) strcpy(zc->zc_name, dsname);
2451 2452                          (void) zfs_ioc_userspace_upgrade(zc);
2452 2453                          kmem_free(zc, sizeof (zfs_cmd_t));
2453 2454                  }
2454 2455                  break;
2455 2456          }
2456      -        case ZFS_PROP_COMPRESSION:
2457      -        {
2458      -                if (intval == ZIO_COMPRESS_LZ4) {
2459      -                        spa_t *spa;
2460      -
2461      -                        if ((err = spa_open(dsname, &spa, FTAG)) != 0)
2462      -                                return (err);
2463      -
2464      -                        /*
2465      -                         * Setting the LZ4 compression algorithm activates
2466      -                         * the feature.
2467      -                         */
2468      -                        if (!spa_feature_is_active(spa,
2469      -                            SPA_FEATURE_LZ4_COMPRESS)) {
2470      -                                if ((err = zfs_prop_activate_feature(spa,
2471      -                                    SPA_FEATURE_LZ4_COMPRESS)) != 0) {
2472      -                                        spa_close(spa, FTAG);
2473      -                                        return (err);
2474      -                                }
2475      -                        }
2476      -
2477      -                        spa_close(spa, FTAG);
2478      -                }
2479      -                /*
2480      -                 * We still want the default set action to be performed in the
2481      -                 * caller, we only performed zfeature settings here.
2482      -                 */
2483      -                err = -1;
2484      -                break;
2485      -        }
2486      -
2487 2457          default:
2488 2458                  err = -1;
2489 2459          }
2490 2460  
2491 2461          return (err);
2492 2462  }
2493 2463  
2494 2464  /*
2495 2465   * This function is best effort. If it fails to set any of the given properties,
2496 2466   * it continues to set as many as it can and returns the last error
↓ open down ↓ 3598 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX