Print this page
pbchk
cleanup port_free_event_local() semantics

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/port_kernel.h
          +++ new/usr/src/uts/common/sys/port_kernel.h
↓ open down ↓ 16 lines elided ↑ open up ↑
  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 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
       27 +/*
       28 + * Copyright 2020 Joyent, Inc.
       29 + */
       30 +
  27   31  #ifndef _SYS_PORT_KERNEL_H
  28   32  #define _SYS_PORT_KERNEL_H
  29   33  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   34  #include <sys/vnode.h>
  33   35  #include <sys/list.h>
  34   36  
  35   37  #ifdef  __cplusplus
  36   38  extern "C" {
  37   39  #endif
  38   40  
  39   41  /*
  40   42   * Note:
  41   43   * The contents of this file are private to the implementation of the
↓ open down ↓ 3 lines elided ↑ open up ↑
  45   47  
  46   48  #ifdef _KERNEL
  47   49  
  48   50  /*
  49   51   * The port_kevent_t struct represents the kernel internal port event.
  50   52   * Every event is associated to a port (portkev_port).
  51   53   */
  52   54  typedef struct  port_kevent {
  53   55          kmutex_t        portkev_lock;   /* used by PORT_SOURCE_FD source */
  54   56          int     portkev_source;         /* event: source */
  55      -        int     portkev_events;         /* event: data */
       57 +        int     portkev_events;         /* event: data */
  56   58          int     portkev_flags;          /* internal flags */
  57   59          pid_t   portkev_pid;            /* pid of process using this struct */
  58   60          long    portkev_object;         /* event: object */
  59   61          void    *portkev_user;          /* event: user-defined value */
  60   62          int     (*portkev_callback)(void *, int *, pid_t, int, void *);
  61   63          void    *portkev_arg;           /* event source callback arg */
  62   64          struct  port *portkev_port;     /* associated port */
  63   65          list_node_t portkev_node;       /* pointer to neighbor events */
  64   66  } port_kevent_t;
  65   67  
↓ open down ↓ 95 lines elided ↑ open up ↑
 161  163  void    port_free_event(port_kevent_t *);
 162  164  void    port_init_event(port_kevent_t *, uintptr_t, void *,
 163  165      int (*)(void *, int *, pid_t, int, void *), void *);
 164  166  int     port_dup_event(port_kevent_t *, port_kevent_t **, int);
 165  167  int     port_associate_fd(struct port *, int, uintptr_t, int, void *);
 166  168  int     port_dissociate_fd(struct port *, uintptr_t);
 167  169  int     port_associate_fop(struct port *, int, uintptr_t, int, void *);
 168  170  int     port_dissociate_fop(struct port *, uintptr_t);
 169  171  
 170  172  /* misc functions */
 171      -void    port_free_event_local(port_kevent_t *, int counter);
      173 +void    port_free_event_local(port_kevent_t *, boolean_t);
 172  174  int     port_alloc_event_local(struct port *, int, int, port_kevent_t **);
 173  175  void    port_close_pfd(struct portfd *);
 174  176  
 175  177  #endif  /* _KERNEL */
 176  178  
 177  179  #ifdef  __cplusplus
 178  180  }
 179  181  #endif
 180  182  
 181  183  #endif  /* _SYS_PORT_KERNEL_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX