Print this page
OS-1840 fmdump shall emit JSON (copyright fixes 2)
OS-1840 fmdump shall emit JSON (rm feedback)

Split Close
Expand all
Collapse all
          --- old/usr/src/common/nvpair/fnvpair.c
          +++ new/usr/src/common/nvpair/fnvpair.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  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   23   * Copyright (c) 2012 by Delphix. All rights reserved.
       24 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  #include <sys/nvpair.h>
  27   28  #include <sys/kmem.h>
  28   29  #include <sys/debug.h>
  29   30  #ifndef _KERNEL
  30   31  #include <stdlib.h>
  31   32  #endif
  32   33  
       34 +#pragma weak fnvlist_lookup_uint8_t = fnvlist_lookup_uint8
       35 +#pragma weak fnvpair_value_uint8_t = fnvpair_value_uint8
       36 +
  33   37  /*
  34   38   * "Force" nvlist wrapper.
  35   39   *
  36   40   * These functions wrap the nvlist_* functions with assertions that assume
  37   41   * the operation is successful.  This allows the caller's code to be much
  38   42   * more readable, especially for the fnvlist_lookup_* and fnvpair_value_*
  39   43   * functions, which can return the requested value (rather than filling in
  40   44   * a pointer).
  41   45   *
  42   46   * These functions use NV_UNIQUE_NAME, encoding NV_ENCODE_NATIVE, and allocate
↓ open down ↓ 302 lines elided ↑ open up ↑
 345  349  
 346  350  int64_t
 347  351  fnvlist_lookup_int64(nvlist_t *nvl, const char *name)
 348  352  {
 349  353          int64_t rv;
 350  354          VERIFY0(nvlist_lookup_int64(nvl, name, &rv));
 351  355          return (rv);
 352  356  }
 353  357  
 354  358  uint8_t
 355      -fnvlist_lookup_uint8_t(nvlist_t *nvl, const char *name)
      359 +fnvlist_lookup_uint8(nvlist_t *nvl, const char *name)
 356  360  {
 357  361          uint8_t rv;
 358  362          VERIFY0(nvlist_lookup_uint8(nvl, name, &rv));
 359  363          return (rv);
 360  364  }
 361  365  
 362  366  uint16_t
 363  367  fnvlist_lookup_uint16(nvlist_t *nvl, const char *name)
 364  368  {
 365  369          uint16_t rv;
↓ open down ↓ 75 lines elided ↑ open up ↑
 441  445  
 442  446  int64_t
 443  447  fnvpair_value_int64(nvpair_t *nvp)
 444  448  {
 445  449          int64_t rv;
 446  450          VERIFY0(nvpair_value_int64(nvp, &rv));
 447  451          return (rv);
 448  452  }
 449  453  
 450  454  uint8_t
 451      -fnvpair_value_uint8_t(nvpair_t *nvp)
      455 +fnvpair_value_uint8(nvpair_t *nvp)
 452  456  {
 453  457          uint8_t rv;
 454  458          VERIFY0(nvpair_value_uint8(nvp, &rv));
 455  459          return (rv);
 456  460  }
 457  461  
 458  462  uint16_t
 459  463  fnvpair_value_uint16(nvpair_t *nvp)
 460  464  {
 461  465          uint16_t rv;
↓ open down ↓ 25 lines elided ↑ open up ↑
 487  491          return (rv);
 488  492  }
 489  493  
 490  494  nvlist_t *
 491  495  fnvpair_value_nvlist(nvpair_t *nvp)
 492  496  {
 493  497          nvlist_t *rv;
 494  498          VERIFY0(nvpair_value_nvlist(nvp, &rv));
 495  499          return (rv);
 496  500  }
      501 +
      502 +double
      503 +fnvpair_value_double(nvpair_t *nvp)
      504 +{
      505 +        double rv;
      506 +        VERIFY0(nvpair_value_double(nvp, &rv));
      507 +        return (rv);
      508 +}
      509 +
      510 +hrtime_t
      511 +fnvpair_value_hrtime(nvpair_t *nvp)
      512 +{
      513 +        hrtime_t rv;
      514 +        VERIFY0(nvpair_value_hrtime(nvp, &rv));
      515 +        return (rv);
      516 +}
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX