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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ndmpd/ndmp/ndmpd_chkpnt.c
          +++ new/usr/src/cmd/ndmpd/ndmp/ndmpd_chkpnt.c
   1    1  /*
   2    2   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
   3    3   * Copyright (c) 2013 by Delphix. All rights reserved.
        4 + * Copyright (c) 2013 Steven Hartland. All rights reserved.
   4    5   */
   5    6  
   6    7  /*
   7    8   * BSD 3 Clause License
   8    9   *
   9   10   * Copyright (c) 2007, The Storage Networking Industry Association.
  10   11   *
  11   12   * Redistribution and use in source and binary forms, with or without
  12   13   * modification, are permitted provided that the following conditions
  13   14   * are met:
↓ open down ↓ 182 lines elided ↑ open up ↑
 196  197          }
 197  198  
 198  199          if (cleanup_fd == -1 && (cleanup_fd = open(ZFS_DEV,
 199  200              O_RDWR|O_EXCL)) < 0) {
 200  201                  NDMP_LOG(LOG_ERR, "Cannot open dev %d", errno);
 201  202                  zfs_close(zhp);
 202  203                  return (-1);
 203  204          }
 204  205  
 205  206          p = strchr(snapname, '@') + 1;
 206      -        if (zfs_hold(zhp, p, jname, recursive, B_FALSE, cleanup_fd) != 0) {
      207 +        if (zfs_hold(zhp, p, jname, recursive, cleanup_fd) != 0) {
 207  208                  NDMP_LOG(LOG_ERR, "Cannot hold snapshot %s", p);
 208  209                  zfs_close(zhp);
 209  210                  return (-1);
 210  211          }
 211  212          zfs_close(zhp);
 212  213          return (0);
 213  214  }
 214  215  
 215  216  int
 216  217  snapshot_release(char *volname, char *snapname, char *jname,
↓ open down ↓ 133 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX