Print this page
re #13613 rb4516 Tunables needs volatile keyword


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



  26 
  27 #pragma ident   "%Z%%M% %I%     %E% SMI"
  28 
  29 #include <nfs/nfs.h>
  30 #include <nfs/nfs4.h>
  31 #include <nfs/rnode4.h>
  32 #include <nfs/nfs4_clnt.h>
  33 #include <sys/bitmap.h>
  34 
  35 /*
  36  * Access cache
  37  */
  38 static acache4_hash_t *acache4;
  39 static long nacache;    /* used strictly to size the number of hash queues */

  40 
  41 static int acache4size;
  42 static int acache4mask;
  43 static struct kmem_cache *acache4_cache;
  44 static int acache4_hashlen = 4;
  45 
  46 /*
  47  * This probably needs to be larger than or equal to
  48  * log2(sizeof (struct rnode)) due to the way that rnodes are
  49  * allocated.
  50  */
  51 #define ACACHE4_SHIFT_BITS      9
  52 
  53 static int
  54 acache4hash(rnode4_t *rp, cred_t *cred)
  55 {
  56         return ((((intptr_t)rp >> ACACHE4_SHIFT_BITS) + crgetuid(cred)) &
  57             acache4mask);
  58 }
  59 




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


  30 #include <nfs/nfs.h>
  31 #include <nfs/nfs4.h>
  32 #include <nfs/rnode4.h>
  33 #include <nfs/nfs4_clnt.h>
  34 #include <sys/bitmap.h>
  35 
  36 /*
  37  * Access cache
  38  */
  39 static acache4_hash_t *acache4;
  40 extern volatile long nacache;   /* used strictly to size the number of hash */
  41                                 /* queues */
  42 
  43 static int acache4size;
  44 static int acache4mask;
  45 static struct kmem_cache *acache4_cache;
  46 static int acache4_hashlen = 4;
  47 
  48 /*
  49  * This probably needs to be larger than or equal to
  50  * log2(sizeof (struct rnode)) due to the way that rnodes are
  51  * allocated.
  52  */
  53 #define ACACHE4_SHIFT_BITS      9
  54 
  55 static int
  56 acache4hash(rnode4_t *rp, cred_t *cred)
  57 {
  58         return ((((intptr_t)rp >> ACACHE4_SHIFT_BITS) + crgetuid(cred)) &
  59             acache4mask);
  60 }
  61