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.
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.
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]
22 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _NFS4_IDMAP_IMPL_H
26 #define _NFS4_IDMAP_IMPL_H
30 #include <sys/pkp_hash.h>
33 * This is a private header file. Applications should not directly include
42 * Cache Entry Definitions
44 #define NFSID_CACHE_ANCHORS PKP_HASH_SIZE
46 typedef struct nfsidmap
{
47 struct nfsidmap
*id_chain
[2]; /* must be first */
48 time_t id_time
; /* time stamp */
49 uid_t id_no
; /* uid/gid */
50 utf8string id_str
; /* user@domain string */
53 #define id_forw id_chain[0]
54 #define id_back id_chain[1]
55 #define id_len id_str.utf8string_len
56 #define id_val id_str.utf8string_val
58 typedef struct nfsidhq
{
60 struct nfsidhq
*hq_head
[2]; /* for empty queue */
61 struct nfsidmap
*hq_chain
[2]; /* for LRU list */
63 kmutex_t hq_lock
; /* protects hash queue */
66 #define hq_que_forw hq_link.hq_head[0]
67 #define hq_que_back hq_link.hq_head[1]
68 #define hq_lru_forw hq_link.hq_chain[0]
69 #define hq_lru_back hq_link.hq_chain[1]
72 const char *name
; /* cache name */
73 nfsidhq_t
*table
; /* hash table */
75 * Since we need to know the status of nfsmapid from random functions
76 * that deal with idmap caches, we keep a pointer to the relevant fields
77 * in the zone's globals so we don't have to keep passing them around.
79 door_handle_t
*nfsidmap_daemon_dh
;
82 typedef enum hash_stat
{ HQ_HASH_HINT
, HQ_HASH_FIND
} hash_stat
;
85 * Per-zone modular globals
87 struct nfsidmap_globals
{
88 list_node_t nig_link
; /* linkage into global list */
89 enum clnt_stat nig_last_stat
; /* status of last RPC call */
90 int nig_msg_done
; /* have we printed a message? */
91 idmap_cache_info_t u2s_ci
; /* table mapping uid-to-string */
92 idmap_cache_info_t s2u_ci
; /* table mapping string-to-uid */
93 idmap_cache_info_t g2s_ci
; /* table mapping groupid-to-string */
94 idmap_cache_info_t s2g_ci
; /* table mapping string-to-groupid */
96 kmutex_t nfsidmap_daemon_lock
;
98 * nfsidmap_daemon_lock protects the following:
101 door_handle_t nfsidmap_daemon_dh
;
108 #endif /* _NFS4_IDMAP_IMPL_H */