Print this page
2605 want to resume interrupted zfs send
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Xin Li <delphij@freebsd.org>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Dan McDonald <danmcd@omniti.com>
re #13850 Refactor ZFS config discovery IOCs to libzfs_core patterns

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/truss/expound.c
          +++ new/usr/src/cmd/truss/expound.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23      - * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
       23 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24   24   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  25   25   * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  26   26   * Copyright 2015 Joyent, Inc.
  27   27   */
  28   28  
  29   29  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  30   30  /*        All Rights Reserved   */
  31   31  
  32   32  #define _SYSCALL32
  33   33  
↓ open down ↓ 61 lines elided ↑ open up ↑
  95   95  #include <sys/socketvar.h>
  96   96  #include <sys/fs/zfs.h>
  97   97  #include <sys/zfs_ioctl.h>
  98   98  
  99   99  #include "ramdata.h"
 100  100  #include "systable.h"
 101  101  #include "proto.h"
 102  102  
 103  103  void    show_sigset(private_t *, long, const char *);
 104  104  void    show_ioctl(private_t *, int, long);
 105      -void    show_zfs_ioc(private_t *, long);
      105 +void    show_zfs_ioc(private_t *, long, int);
 106  106  
 107  107  static void
 108  108  mk_ctime(char *str, size_t maxsize, time_t value)
 109  109  {
 110  110          (void) strftime(str, maxsize, "%b %e %H:%M:%S %Z %Y",
 111  111              localtime(&value));
 112  112  }
 113  113  
 114  114  void
 115  115  prtime(private_t *pri, const char *name, time_t value)
↓ open down ↓ 1365 lines elided ↑ open up ↑
1481 1481          case TIOCSWINSZ:
1482 1482                  show_winsize(pri, offset);
1483 1483                  break;
1484 1484          case AUDIO_GETINFO:
1485 1485          case (int)AUDIO_SETINFO:
1486 1486                  show_audio_info(pri, offset);
1487 1487                  break;
1488 1488  
1489 1489          default:
1490 1490                  if ((code & ~0xff) == ZFS_IOC) {
1491      -                        show_zfs_ioc(pri, offset);
     1491 +                        show_zfs_ioc(pri, offset, err);
1492 1492                          break;
1493 1493                  }
1494 1494  
1495 1495                  if (code & IOC_INOUT) {
1496 1496                          const char *str = ioctldatastruct(code);
1497 1497  
1498 1498                          (void) printf("\t\t%s",
1499 1499                              (code & IOC_INOUT) == IOC_INOUT ? "write/read" :
1500 1500                              code & IOC_IN ? "write" : "read");
1501 1501                          if (str != NULL) {
↓ open down ↓ 3365 lines elided ↑ open up ↑
4867 4867  #else
4868 4868                  show_sockconfig_filter_prop(pri, (long)pri->sys_args[2]);
4869 4869  #endif
4870 4870                  break;
4871 4871          default:
4872 4872                  break;
4873 4873          }
4874 4874  }
4875 4875  
4876 4876  void
4877      -show_zfs_ioc(private_t *pri, long addr)
     4877 +show_zfs_ioc(private_t *pri, long addr, int err)
4878 4878  {
4879 4879          static const zfs_share_t zero_share = {0};
4880 4880          static const dmu_objset_stats_t zero_objstats = {0};
4881 4881          static const struct drr_begin zero_drrbegin = {0};
4882 4882          static const zinject_record_t zero_injectrec = {0};
4883 4883          static const zfs_stat_t zero_zstat = {0};
4884 4884          zfs_cmd_t zc;
4885 4885  
4886 4886          if (Pread(Proc, &zc, sizeof (zc), addr) != sizeof (zc)) {
4887 4887                  (void) printf(" zfs_ioctl read failed\n");
↓ open down ↓ 14 lines elided ↑ open up ↑
4902 4902                  (void) printf("    nvlist_conf:\n");
4903 4903                  show_packed_nvlist(pri, zc.zc_nvlist_conf,
4904 4904                      zc.zc_nvlist_conf_size);
4905 4905          }
4906 4906          if (zc.zc_nvlist_src_size) {
4907 4907                  (void) printf("    nvlist_src:\n");
4908 4908                  show_packed_nvlist(pri, zc.zc_nvlist_src,
4909 4909                      zc.zc_nvlist_src_size);
4910 4910          }
4911 4911          if (zc.zc_nvlist_dst_size) {
4912      -                (void) printf("    nvlist_dst:\n");
4913      -                show_packed_nvlist(pri, zc.zc_nvlist_dst,
4914      -                    zc.zc_nvlist_dst_size);
     4912 +                if (zc.zc_nvlist_dst_filled) {
     4913 +                        (void) printf("    nvlist_dst:\n");
     4914 +                        show_packed_nvlist(pri, zc.zc_nvlist_dst,
     4915 +                            zc.zc_nvlist_dst_size);
     4916 +                } else if (err == ENOMEM) {
     4917 +                        (void) printf("    nvlist_dst_size: %llu\n",
     4918 +                            (u_longlong_t)zc.zc_nvlist_dst_size);
     4919 +                }
4915 4920          }
4916 4921          if (zc.zc_cookie != 0) {
4917 4922                  (void) printf("    zc_cookie=%llu\n",
4918 4923                      (u_longlong_t)zc.zc_cookie);
4919 4924          }
4920 4925          if (zc.zc_objset_type != 0) {
4921 4926                  (void) printf("    zc_objset_type=%llu\n",
4922 4927                      (u_longlong_t)zc.zc_objset_type);
4923 4928          }
4924 4929          if (zc.zc_perm_action != 0) {
↓ open down ↓ 697 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX