Print this page
3740 Poor ZFS send / receive performance due to snapshot hold / release processing
Submitted by: Steven Hartland <steven.hartland@multiplay.co.uk>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zfs/zfs_main.c
          +++ new/usr/src/cmd/zfs/zfs_main.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  25   25   * Copyright (c) 2012 by Delphix. All rights reserved.
  26   26   * Copyright 2012 Milan Jurik. All rights reserved.
  27   27   * Copyright (c) 2012, Joyent, Inc. All rights reserved.
       28 + * Copyright (c) 2013 Steven Hartland.  All rights reserved.
  28   29   */
  29   30  
  30   31  #include <assert.h>
  31   32  #include <ctype.h>
  32   33  #include <errno.h>
  33   34  #include <libgen.h>
  34   35  #include <libintl.h>
  35   36  #include <libuutil.h>
  36   37  #include <libnvpair.h>
  37   38  #include <locale.h>
↓ open down ↓ 5119 lines elided ↑ open up ↑
5157 5158                  (void) strncpy(parent, path, delim - path);
5158 5159                  parent[delim - path] = '\0';
5159 5160  
5160 5161                  zhp = zfs_open(g_zfs, parent,
5161 5162                      ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
5162 5163                  if (zhp == NULL) {
5163 5164                          ++errors;
5164 5165                          continue;
5165 5166                  }
5166 5167                  if (holding) {
5167      -                        if (zfs_hold(zhp, delim+1, tag, recursive,
5168      -                            B_FALSE, -1) != 0)
     5168 +                        if (zfs_hold(zhp, delim+1, tag, recursive, -1) != 0)
5169 5169                                  ++errors;
5170 5170                  } else {
5171 5171                          if (zfs_release(zhp, delim+1, tag, recursive) != 0)
5172 5172                                  ++errors;
5173 5173                  }
5174 5174                  zfs_close(zhp);
5175 5175          }
5176 5176  
5177 5177          return (errors != 0);
5178 5178  }
↓ open down ↓ 1436 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX