Lines Matching refs:dip
64 struct d_info *dip; in __dip_find() local
68 dip = list_entry(p, struct d_info, hash_head); in __dip_find()
69 if (device == dip->device) in __dip_find()
70 return dip; in __dip_find()
76 void __dip_exit(struct d_info *dip) in __dip_exit() argument
78 list_del(&dip->all_head); in __dip_exit()
79 __destroy_heads(dip->heads); in __dip_exit()
80 region_exit(&dip->regions); in __dip_exit()
81 seeki_free(dip->seek_handle); in __dip_exit()
82 seeki_free(dip->q2q_handle); in __dip_exit()
83 aqd_free(dip->aqd_handle); in __dip_exit()
84 plat_free(dip->q2d_plat_handle); in __dip_exit()
85 plat_free(dip->q2c_plat_handle); in __dip_exit()
86 plat_free(dip->d2c_plat_handle); in __dip_exit()
87 bno_dump_free(dip->bno_dump_handle); in __dip_exit()
88 unplug_hist_free(dip->up_hist_handle); in __dip_exit()
90 q2d_free(dip->q2d_priv); in __dip_exit()
91 if (dip->pit_fp) in __dip_exit()
92 fclose(dip->pit_fp); in __dip_exit()
93 free(dip); in __dip_exit()
101 struct d_info *dip = list_entry(p, struct d_info, all_head); in dip_exit() local
102 __dip_exit(dip); in dip_exit()
127 struct d_info *dip = __dip_find(device); in dip_alloc() local
129 if (dip == NULL) { in dip_alloc()
132 dip = malloc(sizeof(struct d_info)); in dip_alloc()
133 memset(dip, 0, sizeof(*dip)); in dip_alloc()
134 dip->heads = dip_rb_mkhds(); in dip_alloc()
135 region_init(&dip->regions); in dip_alloc()
136 dip->device = device; in dip_alloc()
137 dip->last_q = (__u64)-1; in dip_alloc()
138 dip->devmap = dev_map_find(device); in dip_alloc()
139 dip->bno_dump_handle = bno_dump_alloc(device); in dip_alloc()
140 dip->up_hist_handle = unplug_hist_alloc(device); in dip_alloc()
141 dip->seek_handle = seeki_alloc(mkhandle(str, device, "_d2d")); in dip_alloc()
142 dip->q2q_handle = seeki_alloc(mkhandle(str, device, "_q2q")); in dip_alloc()
143 dip->aqd_handle = aqd_alloc(mkhandle(str, device, "_aqd")); in dip_alloc()
144 dip->q2d_plat_handle = in dip_alloc()
146 dip->q2c_plat_handle = in dip_alloc()
148 dip->d2c_plat_handle = in dip_alloc()
150 latency_alloc(dip); in dip_alloc()
151 list_add_tail(&dip->hash_head, &dev_heads[DEV_HASH(device)]); in dip_alloc()
152 list_add_tail(&dip->all_head, &all_devs); in dip_alloc()
153 dip->start_time = BIT_TIME(iop->t.time); in dip_alloc()
154 dip->pre_culling = 1; in dip_alloc()
156 dip->q2d_priv = q2d_alloc(); in dip_alloc()
159 dip->pit_fp = open_pit(mkhandle(per_io_trees, in dip_alloc()
163 if (dip->pre_culling) { in dip_alloc()
165 dip->pre_culling = 0; in dip_alloc()
170 iop->linked = dip_rb_ins(dip, iop); in dip_alloc()
171 dip->end_time = BIT_TIME(iop->t.time); in dip_alloc()
173 return dip; in dip_alloc()
192 dip_rb_fe(iop->dip, type, iop, fnc, &head); in dip_foreach()
199 dip_rb_fe(iop->dip, type, iop, fnc, NULL); in dip_foreach()
204 dip_rb_fe(iop->dip, type, iop, NULL, hd); in dip_foreach_list()
207 struct io *dip_find_sec(struct d_info *dip, enum iop_type type, __u64 sec) in dip_find_sec() argument
209 return dip_rb_find_sec(dip, type, sec); in dip_find_sec()
220 struct d_info *dip; in dip_foreach_out() local
225 dip = __dip_find((__u32)((mjr << MINORBITS) | mnr)); in dip_foreach_out()
226 func(dip, arg); in dip_foreach_out()
235 struct d_info *dip = __dip_find(dev); in dip_plug() local
237 if (dip && !dip->is_plugged) { in dip_plug()
238 dip->is_plugged = 1; in dip_plug()
239 dip->last_plug = cur_time; in dip_plug()
243 static inline void unplug(struct d_info *dip, double cur_time) in unplug() argument
245 dip->is_plugged = 0; in unplug()
246 dip->plugged_time += (cur_time - dip->last_plug); in unplug()
251 struct d_info *dip = __dip_find(dev); in dip_unplug() local
253 if (dip && dip->is_plugged) { in dip_unplug()
254 dip->nplugs++; in dip_unplug()
255 dip->nios_up += nios_up; in dip_unplug()
256 unplug(dip, cur_time); in dip_unplug()
262 struct d_info *dip = __dip_find(dev); in dip_unplug_tm() local
264 if (dip && dip->is_plugged) { in dip_unplug_tm()
265 dip->nios_upt += nios_up; in dip_unplug_tm()
266 dip->nplugs_t++; in dip_unplug_tm()
267 unplug(dip, cur_time); in dip_unplug_tm()
276 struct d_info *dip = list_entry(p, struct d_info, all_head); in dip_cleanup() local
278 if (dip->n_qs == 0 && dip->n_ds == 0) in dip_cleanup()
279 __dip_exit(dip); in dip_cleanup()