Print this page
2882 implement libzfs_core
2883 changing "canmount" property to "on" should not always remount dataset
2900 "zfs snapshot" should be able to create multiple, arbitrary snapshots at once
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Chris Siden <christopher.siden@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Bill Pijewski <wdp@joyent.com>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zvol.c
          +++ new/usr/src/uts/common/fs/zfs/zvol.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   *
  24   24   * Portions Copyright 2010 Robert Milkowski
  25   25   *
  26   26   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
       27 + * Copyright (c) 2012 by Delphix. All rights reserved.
  27   28   */
  28   29  
  29   30  /*
  30   31   * ZFS volume emulation driver.
  31   32   *
  32   33   * Makes a DMU object look like a volume of arbitrary size, up to 2^64 bytes.
  33   34   * Volumes are accessed through the symbolic links named:
  34   35   *
  35   36   * /dev/zvol/dsk/<pool_name>/<dataset_name>
  36   37   * /dev/zvol/rdsk/<pool_name>/<dataset_name>
↓ open down ↓ 91 lines elided ↑ open up ↑
 128  129  #define ZVOL_DUMPIFIED  0x2
 129  130  #define ZVOL_EXCL       0x4
 130  131  #define ZVOL_WCE        0x8
 131  132  
 132  133  /*
 133  134   * zvol maximum transfer in one DMU tx.
 134  135   */
 135  136  int zvol_maxphys = DMU_MAX_ACCESS/2;
 136  137  
 137  138  extern int zfs_set_prop_nvlist(const char *, zprop_source_t,
 138      -    nvlist_t *, nvlist_t **);
      139 +    nvlist_t *, nvlist_t *);
 139  140  static int zvol_remove_zv(zvol_state_t *);
 140  141  static int zvol_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio);
 141  142  static int zvol_dumpify(zvol_state_t *zv);
 142  143  static int zvol_dump_fini(zvol_state_t *zv);
 143  144  static int zvol_dump_init(zvol_state_t *zv, boolean_t resize);
 144  145  
 145  146  static void
 146  147  zvol_size_changed(uint64_t volsize, major_t maj, minor_t min)
 147  148  {
 148  149          dev_t dev = makedevice(maj, min);
↓ open down ↓ 1729 lines elided ↑ open up ↑
1878 1879          int error = 0;
1879 1880          uint64_t dumpsize = 0;
1880 1881          dmu_tx_t *tx;
1881 1882          objset_t *os = zv->zv_objset;
1882 1883  
1883 1884          if (zv->zv_flags & ZVOL_RDONLY)
1884 1885                  return (EROFS);
1885 1886  
1886 1887          if (zap_lookup(zv->zv_objset, ZVOL_ZAP_OBJ, ZVOL_DUMPSIZE,
1887 1888              8, 1, &dumpsize) != 0 || dumpsize != zv->zv_volsize) {
1888      -                boolean_t resize = (dumpsize > 0) ? B_TRUE : B_FALSE;
     1889 +                boolean_t resize = (dumpsize > 0);
1889 1890  
1890 1891                  if ((error = zvol_dump_init(zv, resize)) != 0) {
1891 1892                          (void) zvol_dump_fini(zv);
1892 1893                          return (error);
1893 1894                  }
1894 1895          }
1895 1896  
1896 1897          /*
1897 1898           * Build up our lba mapping.
1898 1899           */
↓ open down ↓ 100 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX