Print this page
XXXX don't fail device detach when it's physically removed

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/fs/dv_node.h
          +++ new/usr/src/uts/common/sys/fs/dv_node.h
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  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 2009 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
       27 +/*
       28 + * Copyright 2018 Nexenta Systems, Inc.
       29 + */
       30 +
  26   31  #ifndef _SYS_DV_NODE_H
  27   32  #define _SYS_DV_NODE_H
  28   33  
  29   34  /*
  30   35   * dv_nodes are the file-system specific part of the
  31   36   * vnodes for the device filesystem.
  32   37   *
  33   38   * The device filesystem exports two node types:
  34   39   *
  35   40   * VDIR nodes           to represent nexus drivers
↓ open down ↓ 67 lines elided ↑ open up ↑
 103  108  #define DV_UID_DEFAULT  0       /* default uid for devs and dirs */
 104  109  #define DV_GID_DEFAULT  3       /* default gid for devs and dirs */
 105  110  #define DV_DIRMODE_DEFAULT      (S_IFDIR | 0755)        /* directories */
 106  111  #define DV_DEVMODE_DEFAULT      (0600)                  /* special files */
 107  112  #define DV_DEVMODE_PRIV         (0666)          /* priv based access only */
 108  113  
 109  114  /* flags for devfs_clean() */
 110  115  #define DV_CLEAN_FORCE  0x01    /* force clean of refed directories */
 111  116  #define DV_RESET_PERM   0x02    /* force resetting of node permission */
 112  117  #define DV_CLEANDIR_LCK 0x04    /* dv_contents already held */
      118 +#define DV_DEVI_GONE    0x08    /* force clean of refed files */
 113  119  
 114  120  struct devfs_data {
 115  121          struct  dv_node *devfs_root;
 116  122          struct  vfs     *devfs_vfsp;
 117  123  };
 118  124  
 119  125  #define VFSTODVFS(vfsp) ((struct devfs_data *)((vfsp)->vfs_data))
 120  126  
 121  127  /* dv_fid overlays the fid structure (for VFS_VGET) */
 122  128  struct dv_fid {
↓ open down ↓ 9 lines elided ↑ open up ↑
 132  138          (!((attrp->va_uid == mp.mp_uid) &&                      \
 133  139          (attrp->va_gid == mp.mp_gid) &&                         \
 134  140          ((attrp->va_mode & S_IAMB) == (mp.mp_mode & S_IAMB))))
 135  141  
 136  142  /*
 137  143   * Merge an mperm_t's minor permissions into a vattr
 138  144   */
 139  145  #define VATTR_MP_MERGE(attr, mp)                                \
 140  146          attr.va_uid = mp.mp_uid;                                \
 141  147          attr.va_gid = mp.mp_gid;                                \
 142      -        attr.va_mode =                                          \
      148 +        attr.va_mode =                                          \
 143  149              (attr.va_mode & ~S_IAMB) | (mp.mp_mode & S_IAMB);
 144  150  
 145  151  #define VATTRP_MP_MERGE(attrp, mp)                              \
 146  152          attrp->va_uid = mp.mp_uid;                              \
 147  153          attrp->va_gid = mp.mp_gid;                              \
 148      -        attrp->va_mode =                                        \
      154 +        attrp->va_mode =                                        \
 149  155              (attrp->va_mode & ~S_IAMB) | (mp.mp_mode & S_IAMB);
 150  156  
 151  157  /*
 152  158   * dv_shadow_node flags
 153  159   */
 154  160  #define DV_SHADOW_CREATE        0x01            /* create attribute node */
 155  161  #define DV_SHADOW_WRITE_HELD    0x02            /* dv_contents write held */
 156  162  
 157  163  /*
 158  164   * Directory tree traversal
↓ open down ↓ 73 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX