Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/sockfs/sockcommon_subr.c
          +++ new/usr/src/uts/common/fs/sockfs/sockcommon_subr.c
↓ 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 (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  /*
  26   26   * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
  27      - * Copyright 2015 Joyent, Inc.
  28   27   */
  29   28  
  30   29  #include <sys/types.h>
  31   30  #include <sys/param.h>
  32   31  #include <sys/signal.h>
  33   32  #include <sys/cmn_err.h>
  34   33  
  35   34  #include <sys/stropts.h>
  36   35  #include <sys/socket.h>
  37   36  #include <sys/socketvar.h>
↓ open down ↓ 2247 lines elided ↑ open up ↑
2285 2284          struct sonode *nso;
2286 2285          sock_quiesce_arg_t arg = { NULL, NULL };
2287 2286  #ifdef DEBUG
2288 2287          struct sonode origso;
2289 2288  #endif
2290 2289          error = 0;
2291 2290          sp = so->so_sockparams;
2292 2291          fbfunc = sp->sp_smod_info->smod_proto_fallback_func;
2293 2292  
2294 2293          /*
2295      -         * Cannot fallback if the socket has active filters or a krecv callback.
     2294 +         * Cannot fallback if the socket has active filters
2296 2295           */
2297      -        if (so->so_filter_active > 0 || so->so_krecv_cb != NULL)
     2296 +        if (so->so_filter_active > 0)
2298 2297                  return (EINVAL);
2299 2298  
2300 2299          switch (so->so_family) {
2301 2300          case AF_INET:
2302 2301                  devpath = sp->sp_smod_info->smod_fallback_devpath_v4;
2303 2302                  break;
2304 2303          case AF_INET6:
2305 2304                  devpath = sp->sp_smod_info->smod_fallback_devpath_v6;
2306 2305                  break;
2307 2306          default:
↓ open down ↓ 156 lines elided ↑ open up ↑
2464 2463                      error, curproc->p_pid);
2465 2464                  if (newsp != NULL)
2466 2465                          SOCKPARAMS_DEC_REF(newsp);
2467 2466          }
2468 2467          if (arg.soqa_exdata_mp != NULL)
2469 2468                  freemsg(arg.soqa_exdata_mp);
2470 2469          if (arg.soqa_urgmark_mp != NULL)
2471 2470                  freemsg(arg.soqa_urgmark_mp);
2472 2471  
2473 2472          return (error);
2474      -}
2475      -
2476      -int
2477      -so_krecv_set(sonode_t *so, so_krecv_f cb, void *arg)
2478      -{
2479      -        int ret;
2480      -
2481      -        if (cb == NULL && arg != NULL)
2482      -                return (EINVAL);
2483      -
2484      -        SO_BLOCK_FALLBACK(so, so_krecv_set(so, cb, arg));
2485      -
2486      -        mutex_enter(&so->so_lock);
2487      -        if (so->so_state & SS_FALLBACK_COMP) {
2488      -                mutex_exit(&so->so_lock);
2489      -                SO_UNBLOCK_FALLBACK(so);
2490      -                return (ENOTSUP);
2491      -        }
2492      -
2493      -        ret = so_lock_read(so, 0);
2494      -        VERIFY(ret == 0);
2495      -        /*
2496      -         * Other consumers may actually care about getting extant data delivered
2497      -         * to them, when they come along, they should figure out the best API
2498      -         * for that.
2499      -         */
2500      -        so_rcv_flush(so);
2501      -
2502      -        so->so_krecv_cb = cb;
2503      -        so->so_krecv_arg = arg;
2504      -
2505      -        so_unlock_read(so);
2506      -        mutex_exit(&so->so_lock);
2507      -        SO_UNBLOCK_FALLBACK(so);
2508      -
2509      -        return (0);
2510      -}
2511      -
2512      -void
2513      -so_krecv_unblock(sonode_t *so)
2514      -{
2515      -        mutex_enter(&so->so_lock);
2516      -        VERIFY(so->so_krecv_cb != NULL);
2517      -
2518      -        so->so_rcv_queued = 0;
2519      -        (void) so_check_flow_control(so);
2520      -        mutex_exit(&so->so_lock);
2521 2473  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX