2 * Copyright 2009-2010, Sine Nomine Associates and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
12 * volume group membership cache
15 #ifndef _AFS_VOL_VG_CACHE_IMPL_TYPES_H
16 #define _AFS_VOL_VG_CACHE_IMPL_TYPES_H 1
18 #ifndef __VOL_VG_CACHE_IMPL
19 #error "do not include this file outside of the volume group cache implementation"
23 #include <rx/rx_queue.h>
28 * volume group cache node.
30 typedef struct VVGCache_entry {
31 VolumeId rw; /**< rw volume id */
32 VolumeId children[VOL_VG_MAX_VOLS]; /**< vector of children */
33 afs_uint32 refcnt; /**< hash chain refcount */
37 * volume group hash table.
39 typedef struct VVGCache_hash_table {
40 struct rx_queue * hash_buckets; /**< variable-length array of
42 } VVGCache_hash_table_t;
45 * volume group hash bucket.
47 * @see VVGCache_hash_table_t
49 typedef struct VVGCache_hash_entry {
50 struct rx_queue hash_chain; /**< hash chain pointers */
51 VolumeId volid; /**< volume id */
52 struct DiskPartition64 * dp; /**< associated disk partition */
53 VVGCache_entry_t * entry; /**< volume group cache entry */
54 } VVGCache_hash_entry_t;
56 /* scanner implementation details */
61 typedef struct VVGCache_scan_entry {
64 } VVGCache_scan_entry_t;
69 typedef struct VVGCache_scan_table {
73 unsigned long newvols;
76 VVGCache_scan_entry_t entries[VVGC_SCAN_TBL_LEN];
77 } VVGCache_scan_table_t;
80 * VVGC partition state enumeration.
82 typedef enum VVGCache_part_state {
83 VVGC_PART_STATE_VALID, /**< vvgc data for partition is valid */
84 VVGC_PART_STATE_INVALID, /**< vvgc data for partition is known to be invalid */
85 VVGC_PART_STATE_UPDATING /**< vvgc data for partition is currently updating */
86 } VVGCache_part_state_t;
89 * entry in the 'to-delete' list.
91 * @see _VVGC_dlist_add_r
93 typedef struct VVGCache_dlist_entry {
94 struct rx_queue hash_chain; /**< hash chain pointers */
95 VolumeId child; /**< child volid of the VGC entry */
96 VolumeId parent; /**< parent volid of the VGC entry */
97 } VVGCache_dlist_entry_t;
100 * VVGC partition state.
102 typedef struct VVGCache_part {
103 VVGCache_part_state_t state; /**< state of VVGC for this partition */
104 pthread_cond_t cv; /**< state change cv */
105 struct rx_queue *dlist_hash_buckets; /**< variable-length array of hash
106 * buckets. Queues contain
107 * VVGCache_dlist_entry_t's.
108 * This is NULL when we are not
115 typedef struct VVGCache {
116 VVGCache_part_t part[VOLMAXPARTS+1]; /**< state of VVGC for each partition */
119 #endif /* _AFS_VOL_VG_CACHE_IMPL_TYPES_H */