Print this page
6595 sdev's devfsadm macros set a bad precedent

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/fs/sdev_impl.h
          +++ new/usr/src/uts/common/sys/fs/sdev_impl.h
↓ open down ↓ 324 lines elided ↑ open up ↑
 325  325   */
 326  326  typedef enum {
 327  327          DEVNAME_DEVFSADM_STOPPED = 0,   /* devfsadm has never run */
 328  328          DEVNAME_DEVFSADM_RUNNING,       /* devfsadm is running */
 329  329          DEVNAME_DEVFSADM_RUN            /* devfsadm ran once */
 330  330  } devname_devfsadm_state_t;
 331  331  
 332  332  extern volatile uint_t  devfsadm_state; /* atomic mask for devfsadm status */
 333  333  
 334  334  #define DEVNAME_DEVFSADM_SET_RUNNING(devfsadm_state)    \
 335      -        devfsadm_state = DEVNAME_DEVFSADM_RUNNING
      335 +        (devfsadm_state = DEVNAME_DEVFSADM_RUNNING)
 336  336  #define DEVNAME_DEVFSADM_SET_STOP(devfsadm_state)       \
 337      -        devfsadm_state = DEVNAME_DEVFSADM_STOPPED
      337 +        (devfsadm_state = DEVNAME_DEVFSADM_STOPPED)
 338  338  #define DEVNAME_DEVFSADM_SET_RUN(devfsadm_state)        \
 339      -        devfsadm_state = DEVNAME_DEVFSADM_RUN
      339 +        (devfsadm_state = DEVNAME_DEVFSADM_RUN)
 340  340  #define DEVNAME_DEVFSADM_IS_RUNNING(devfsadm_state)     \
 341      -        devfsadm_state == DEVNAME_DEVFSADM_RUNNING
      341 +        (devfsadm_state == DEVNAME_DEVFSADM_RUNNING)
 342  342  #define DEVNAME_DEVFSADM_HAS_RUN(devfsadm_state)        \
 343  343          (devfsadm_state == DEVNAME_DEVFSADM_RUN)
 344  344  
 345  345  #define SDEV_BLOCK_OTHERS(dv, cmd)      {       \
 346  346          ASSERT(MUTEX_HELD(&dv->sdev_lookup_lock));      \
 347  347          dv->sdev_lookup_flags |= cmd;                   \
 348  348  }
 349  349  extern void sdev_unblock_others(struct sdev_node *, uint_t);
 350  350  #define SDEV_UNBLOCK_OTHERS(dv, cmd)    {       \
 351  351          sdev_unblock_others(dv, cmd);           \
↓ open down ↓ 266 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX