122 /*
123 * If grabbing both device_list mutex & globalchan_list mutex,
124 * Always grab globalchan_list mutex before device_list mutex
125 */
126 typedef struct dcopy_state_s {
127 dcopy_list_t d_device_list;
128 dcopy_list_t d_globalchan_list;
129 } dcopy_state_t;
130 dcopy_state_t *dcopy_statep;
131
132
133 /* Module Driver Info */
134 static struct modlmisc dcopy_modlmisc = {
135 &mod_miscops,
136 "dcopy kernel module"
137 };
138
139 /* Module Linkage */
140 static struct modlinkage dcopy_modlinkage = {
141 MODREV_1,
142 &dcopy_modlmisc,
143 NULL
144 };
145
146 static int dcopy_init();
147 static void dcopy_fini();
148
149 static int dcopy_list_init(dcopy_list_t *list, size_t node_size,
150 offset_t link_offset);
151 static void dcopy_list_fini(dcopy_list_t *list);
152 static void dcopy_list_push(dcopy_list_t *list, void *list_node);
153 static void *dcopy_list_pop(dcopy_list_t *list);
154
155 static void dcopy_device_cleanup(dcopy_device_handle_t device,
156 boolean_t do_callback);
157
158 static int dcopy_stats_init(dcopy_handle_t channel);
159 static void dcopy_stats_fini(dcopy_handle_t channel);
160
161
162 /*
163 * _init()
|
122 /*
123 * If grabbing both device_list mutex & globalchan_list mutex,
124 * Always grab globalchan_list mutex before device_list mutex
125 */
126 typedef struct dcopy_state_s {
127 dcopy_list_t d_device_list;
128 dcopy_list_t d_globalchan_list;
129 } dcopy_state_t;
130 dcopy_state_t *dcopy_statep;
131
132
133 /* Module Driver Info */
134 static struct modlmisc dcopy_modlmisc = {
135 &mod_miscops,
136 "dcopy kernel module"
137 };
138
139 /* Module Linkage */
140 static struct modlinkage dcopy_modlinkage = {
141 MODREV_1,
142 { &dcopy_modlmisc, NULL }
143 };
144
145 static int dcopy_init();
146 static void dcopy_fini();
147
148 static int dcopy_list_init(dcopy_list_t *list, size_t node_size,
149 offset_t link_offset);
150 static void dcopy_list_fini(dcopy_list_t *list);
151 static void dcopy_list_push(dcopy_list_t *list, void *list_node);
152 static void *dcopy_list_pop(dcopy_list_t *list);
153
154 static void dcopy_device_cleanup(dcopy_device_handle_t device,
155 boolean_t do_callback);
156
157 static int dcopy_stats_init(dcopy_handle_t channel);
158 static void dcopy_stats_fini(dcopy_handle_t channel);
159
160
161 /*
162 * _init()
|