Print this page
9702 HBA drivers don't need the redundant devfs_clean step
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/scsi/adapters/pvscsi/pvscsi.c
          +++ new/usr/src/uts/intel/io/scsi/adapters/pvscsi/pvscsi.c
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13      - * Copyright 2016 Nexenta Systems, Inc.
       13 + * Copyright 2018 Nexenta Systems, Inc.
  14   14   */
  15   15  
  16   16  #include <sys/atomic.h>
  17   17  #include <sys/cmn_err.h>
  18   18  #include <sys/conf.h>
  19   19  #include <sys/cpuvar.h>
  20   20  #include <sys/ddi.h>
  21   21  #include <sys/errno.h>
  22      -#include <sys/fs/dv_node.h>
  23   22  #include <sys/kmem.h>
  24   23  #include <sys/kmem_impl.h>
  25   24  #include <sys/list.h>
  26   25  #include <sys/modctl.h>
  27   26  #include <sys/pci.h>
  28   27  #include <sys/scsi/scsi.h>
  29   28  #include <sys/sunddi.h>
  30   29  #include <sys/sysmacros.h>
  31   30  #include <sys/time.h>
  32   31  #include <sys/types.h>
↓ open down ↓ 320 lines elided ↑ open up ↑
 353  352  
 354  353          /* Find devnode */
 355  354          for (devnode = list_head(&pvs->devnodes); devnode != NULL;
 356  355              devnode = list_next(&pvs->devnodes, devnode)) {
 357  356                  if (devnode->target == target)
 358  357                          break;
 359  358          }
 360  359  
 361  360          if (devnode != NULL) {
 362  361                  if (inqrc != 0) {
 363      -                        /* Target disappeared, drop devnode */
 364      -                        if (i_ddi_devi_attached(devnode->pdip)) {
 365      -                                char    *devname;
 366      -                                /* Get full devname */
 367      -                                devname = kmem_alloc(MAXPATHLEN, KM_SLEEP);
 368      -                                (void) ddi_deviname(devnode->pdip, devname);
 369      -                                /* Clean cache and name */
 370      -                                (void) devfs_clean(devnode->parent, devname + 1,
 371      -                                    DV_CLEAN_FORCE);
 372      -                                kmem_free(devname, MAXPATHLEN);
 373      -                        }
 374      -
 375      -                        (void) ndi_devi_offline(devnode->pdip, NDI_DEVI_REMOVE);
 376      -
      362 +                        (void) ndi_devi_offline(devnode->pdip,
      363 +                            NDI_DEVFS_CLEAN | NDI_DEVI_REMOVE);
 377  364                          list_remove(&pvs->devnodes, devnode);
 378  365                          kmem_free(devnode, sizeof (*devnode));
 379  366                  } else if (childp != NULL) {
 380  367                          /* Target exists */
 381  368                          *childp = devnode->pdip;
 382  369                  }
 383  370                  return (NDI_SUCCESS);
 384  371          } else if (inqrc != 0) {
 385  372                  /* Target doesn't exist */
 386  373                  return (NDI_FAILURE);
↓ open down ↓ 2314 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX