Home | History | Annotate | Download | only in nfs
      1 /*
      2  * CDDL HEADER START
      3  *
      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 /*
     23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #pragma ident	"@(#)nfs_sstor_impl.h	1.1	08/04/30 SMI"
     28 
     29 #ifndef _NFS_SSTOR_H
     30 #define	_NFS_SSTOR_H
     31 
     32 #pragma ident	"@(#)nfs_sstor_impl.h	1.1	08/04/30 SMI"
     33 
     34 #ifdef	__cplusplus
     35 extern "C" {
     36 #endif
     37 
     38 #ifdef DEBUG
     39 #define	TABSIZE 17
     40 #else
     41 #define	TABSIZE 2047
     42 #endif
     43 
     44 #define	ADDRHASH(key) ((unsigned long)(key) >> 3)
     45 #define	MAXTABSZ 1024*1024
     46 
     47 /* The values below are rfs4_lease_time units */
     48 
     49 #ifdef DEBUG
     50 #define	CLIENT_CACHE_TIME 1
     51 #define	OPENOWNER_CACHE_TIME 1
     52 #define	STATE_CACHE_TIME 1
     53 #define	LO_STATE_CACHE_TIME 1
     54 #define	LOCKOWNER_CACHE_TIME 1
     55 #define	FILE_CACHE_TIME 3
     56 #define	DELEG_STATE_CACHE_TIME 1
     57 #else
     58 #define	CLIENT_CACHE_TIME 10
     59 #define	OPENOWNER_CACHE_TIME 5
     60 #define	STATE_CACHE_TIME 1
     61 #define	LO_STATE_CACHE_TIME 1
     62 #define	LOCKOWNER_CACHE_TIME 3
     63 #define	FILE_CACHE_TIME 40
     64 #define	DELEG_STATE_CACHE_TIME 1
     65 #endif
     66 
     67 int sstor_init(nfs_server_instance_t *, int);
     68 
     69 bool_t rfs4_client_create(rfs4_entry_t, void *);
     70 void   rfs4_client_destroy(rfs4_entry_t);
     71 bool_t rfs4_client_expiry(rfs4_entry_t);
     72 uint32_t clientid_hash(void *);
     73 bool_t clientid_compare(rfs4_entry_t, void *);
     74 void *clientid_mkkey(rfs4_entry_t);
     75 uint32_t nfsclnt_hash(void *);
     76 bool_t nfsclnt_compare(rfs4_entry_t, void *);
     77 void *nfsclnt_mkkey(rfs4_entry_t);
     78 
     79 bool_t openowner_create(rfs4_entry_t, void *);
     80 void   openowner_destroy(rfs4_entry_t);
     81 bool_t rfs4_openowner_expiry(rfs4_entry_t);
     82 uint32_t openowner_hash(void *);
     83 bool_t openowner_compare(rfs4_entry_t, void *);
     84 void *openowner_mkkey(rfs4_entry_t);
     85 
     86 bool_t rfs4_state_create(rfs4_entry_t, void *);
     87 void rfs4_state_destroy(rfs4_entry_t);
     88 bool_t rfs4_state_expiry(rfs4_entry_t);
     89 uint32_t state_hash(void *);
     90 bool_t state_compare(rfs4_entry_t, void *);
     91 void *state_mkkey(rfs4_entry_t);
     92 uint32_t state_owner_file_hash(void *);
     93 bool_t state_owner_file_compare(rfs4_entry_t, void *);
     94 void *state_owner_file_mkkey(rfs4_entry_t);
     95 uint32_t state_file_hash(void *);
     96 bool_t state_file_compare(rfs4_entry_t, void *);
     97 void *state_file_mkkey(rfs4_entry_t);
     98 
     99 bool_t rfs4_lo_state_create(rfs4_entry_t, void *);
    100 void rfs4_lo_state_destroy(rfs4_entry_t);
    101 bool_t rfs4_lo_state_expiry(rfs4_entry_t);
    102 uint32_t lo_state_hash(void *);
    103 bool_t lo_state_compare(rfs4_entry_t, void *);
    104 void *lo_state_mkkey(rfs4_entry_t);
    105 uint32_t lo_state_lo_hash(void *);
    106 bool_t lo_state_lo_compare(rfs4_entry_t, void *);
    107 void *lo_state_lo_mkkey(rfs4_entry_t);
    108 bool_t rfs4_lockowner_create(rfs4_entry_t, void *);
    109 void rfs4_lockowner_destroy(rfs4_entry_t);
    110 bool_t rfs4_lockowner_expiry(rfs4_entry_t);
    111 uint32_t lockowner_hash(void *);
    112 bool_t lockowner_compare(rfs4_entry_t, void *);
    113 void *lockowner_mkkey(rfs4_entry_t);
    114 uint32_t pid_hash(void *);
    115 bool_t pid_compare(rfs4_entry_t, void *);
    116 void *pid_mkkey(rfs4_entry_t);
    117 bool_t rfs4_file_create(rfs4_entry_t, void *);
    118 void rfs4_file_destroy(rfs4_entry_t);
    119 uint32_t file_hash(void *);
    120 bool_t file_compare(rfs4_entry_t, void *);
    121 void *file_mkkey(rfs4_entry_t);
    122 bool_t rfs4_deleg_state_create(rfs4_entry_t, void *);
    123 void rfs4_deleg_state_destroy(rfs4_entry_t);
    124 bool_t rfs4_deleg_state_expiry(rfs4_entry_t);
    125 uint32_t deleg_hash(void *);
    126 bool_t deleg_compare(rfs4_entry_t, void *);
    127 void *deleg_mkkey(rfs4_entry_t);
    128 uint32_t deleg_state_hash(void *);
    129 bool_t deleg_state_compare(rfs4_entry_t, void *);
    130 void *deleg_state_mkkey(rfs4_entry_t);
    131 
    132 #ifdef	__cplusplus
    133 }
    134 #endif
    135 
    136 #endif /* _NFS_SSTOR_H */
    137