Home | History | Annotate | Download | only in btt

Lines Matching defs:dip

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