Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/vdev_queue.c
          +++ new/usr/src/uts/common/fs/zfs/vdev_queue.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  /*
  27   27   * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
  28   28   * Copyright (c) 2014 Integros [integros.com]
       29 + * Copyright 2019 Joyent, Inc.
  29   30   */
  30   31  
  31   32  #include <sys/zfs_context.h>
  32   33  #include <sys/vdev_impl.h>
  33   34  #include <sys/spa_impl.h>
  34   35  #include <sys/zio.h>
  35   36  #include <sys/avl.h>
  36   37  #include <sys/dsl_pool.h>
  37   38  #include <sys/metaslab_impl.h>
  38   39  #include <sys/abd.h>
↓ open down ↓ 359 lines elided ↑ open up ↑
 398  399          case ZIO_PRIORITY_ASYNC_WRITE:
 399  400                  return (zfs_vdev_async_write_min_active);
 400  401          case ZIO_PRIORITY_SCRUB:
 401  402                  return (zfs_vdev_scrub_min_active);
 402  403          case ZIO_PRIORITY_REMOVAL:
 403  404                  return (zfs_vdev_removal_min_active);
 404  405          case ZIO_PRIORITY_INITIALIZING:
 405  406                  return (zfs_vdev_initializing_min_active);
 406  407          default:
 407  408                  panic("invalid priority %u", p);
 408      -                return (0);
 409  409          }
 410  410  }
 411  411  
 412  412  static int
 413  413  vdev_queue_max_async_writes(spa_t *spa)
 414  414  {
 415  415          int writes;
 416  416          uint64_t dirty = spa->spa_dsl_pool->dp_dirty_total;
 417  417          uint64_t min_bytes = zfs_dirty_data_max *
 418  418              zfs_vdev_async_write_active_min_dirty_percent / 100;
↓ open down ↓ 42 lines elided ↑ open up ↑
 461  461          case ZIO_PRIORITY_ASYNC_WRITE:
 462  462                  return (vdev_queue_max_async_writes(spa));
 463  463          case ZIO_PRIORITY_SCRUB:
 464  464                  return (zfs_vdev_scrub_max_active);
 465  465          case ZIO_PRIORITY_REMOVAL:
 466  466                  return (zfs_vdev_removal_max_active);
 467  467          case ZIO_PRIORITY_INITIALIZING:
 468  468                  return (zfs_vdev_initializing_max_active);
 469  469          default:
 470  470                  panic("invalid priority %u", p);
 471      -                return (0);
 472  471          }
 473  472  }
 474  473  
 475  474  /*
 476  475   * Return the i/o class to issue from, or ZIO_PRIORITY_MAX_QUEUEABLE if
 477  476   * there is no eligible class.
 478  477   */
 479  478  static zio_priority_t
 480  479  vdev_queue_class_to_issue(vdev_queue_t *vq)
 481  480  {
↓ open down ↓ 408 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX