Print this page
8654 unused local typedef in rpc code


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.


  24  */
  25 
  26 #include <rpc/types.h>
  27 #include <rpc/xdr.h>
  28 #include <sys/types.h>
  29 #include <sys/sdt.h>
  30 #include <rpc/auth.h>
  31 #include <rpc/rpc_rdma.h>
  32 
  33 struct private {
  34         int     min_chunk;
  35         uint_t  flags;                  /* controls setting for rdma xdr */
  36         int     num_chunk;
  37         caddr_t inline_buf;             /* temporary buffer for xdr inlining */
  38         int     inline_len;             /* inline buffer length */
  39         uint_t  xp_reply_chunk_len;
  40         uint_t  xp_reply_chunk_len_alt;
  41 };
  42 
  43 /* ARGSUSED */


 258 
 259         x.x_ops = &ops;
 260         (void) xdrrdma_common(&x, min_chunk);
 261 
 262         stat = AUTH_MARSHALL(auth, &x, cred);
 263         xdrp = (struct private *)x.x_private;
 264         if (xdrp) {
 265                 if (xdrp->inline_buf)
 266                         mem_free(xdrp->inline_buf, xdrp->inline_len);
 267                 mem_free(xdrp, sizeof (struct private));
 268         }
 269         return (stat == TRUE ? (unsigned int)x.x_handy: 0);
 270 }
 271 
 272 struct xdr_ops *
 273 xdrrdma_xops(void)
 274 {
 275         static struct xdr_ops ops;
 276 
 277         /* to stop ANSI-C compiler from complaining */
 278         typedef  bool_t (* dummyfunc1)(XDR *, long *);
 279         typedef  bool_t (* dummyfunc2)(XDR *, caddr_t, int);
 280         typedef  bool_t (* dummyfunc3)(XDR *, int32_t *);

 281 
 282         ops.x_putbytes = x_putbytes;
 283         ops.x_inline = x_inline;
 284         ops.x_getpostn = x_getpostn;
 285         ops.x_setpostn = x_setpostn;
 286         ops.x_destroy = x_destroy;
 287         ops.x_control = x_control;
 288 
 289 #if defined(_LP64) || defined(_KERNEL)
 290         ops.x_getint32 = (dummyfunc3)harmless;
 291         ops.x_putint32 = x_putint32_t;
 292 #endif
 293 
 294         /* the other harmless ones */
 295         ops.x_getbytes = (dummyfunc2)harmless;
 296 
 297         return (&ops);
 298 }


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  *
  25  * Copyright 2017 RackTop Systems.
  26  */
  27 
  28 #include <rpc/types.h>
  29 #include <rpc/xdr.h>
  30 #include <sys/types.h>
  31 #include <sys/sdt.h>
  32 #include <rpc/auth.h>
  33 #include <rpc/rpc_rdma.h>
  34 
  35 struct private {
  36         int     min_chunk;
  37         uint_t  flags;                  /* controls setting for rdma xdr */
  38         int     num_chunk;
  39         caddr_t inline_buf;             /* temporary buffer for xdr inlining */
  40         int     inline_len;             /* inline buffer length */
  41         uint_t  xp_reply_chunk_len;
  42         uint_t  xp_reply_chunk_len_alt;
  43 };
  44 
  45 /* ARGSUSED */


 260 
 261         x.x_ops = &ops;
 262         (void) xdrrdma_common(&x, min_chunk);
 263 
 264         stat = AUTH_MARSHALL(auth, &x, cred);
 265         xdrp = (struct private *)x.x_private;
 266         if (xdrp) {
 267                 if (xdrp->inline_buf)
 268                         mem_free(xdrp->inline_buf, xdrp->inline_len);
 269                 mem_free(xdrp, sizeof (struct private));
 270         }
 271         return (stat == TRUE ? (unsigned int)x.x_handy: 0);
 272 }
 273 
 274 struct xdr_ops *
 275 xdrrdma_xops(void)
 276 {
 277         static struct xdr_ops ops;
 278 
 279         /* to stop ANSI-C compiler from complaining */
 280         typedef  bool_t (* dummyfunc1)(XDR *, caddr_t, int);
 281 #if defined(_LP64) || defined(_KERNEL)
 282         typedef  bool_t (* dummyfunc2)(XDR *, int32_t *);
 283 #endif
 284 
 285         ops.x_putbytes = x_putbytes;
 286         ops.x_inline = x_inline;
 287         ops.x_getpostn = x_getpostn;
 288         ops.x_setpostn = x_setpostn;
 289         ops.x_destroy = x_destroy;
 290         ops.x_control = x_control;
 291 
 292 #if defined(_LP64) || defined(_KERNEL)
 293         ops.x_getint32 = (dummyfunc2)harmless;
 294         ops.x_putint32 = x_putint32_t;
 295 #endif
 296 
 297         /* the other harmless ones */
 298         ops.x_getbytes = (dummyfunc1)harmless;
 299 
 300         return (&ops);
 301 }