Home | History | Annotate | Download | only in btt

Lines Matching refs:iop

124 static inline void dip_update_q(struct d_info *dip, struct io *iop)
127 update_lq(&dip->last_q, &dip->avgs.q2q_dm, iop->t.time);
129 update_lq(&dip->last_q, &dip->avgs.q2q, iop->t.time);
130 update_qregion(&dip->regions, iop->t.time);
135 struct io *iop = malloc(sizeof(*iop));
137 memset(iop, 0, sizeof(struct io));
138 list_add_tail(&iop->a_head, &all_ios);
140 return iop;
143 static inline void io_free(struct io *iop)
145 list_del(&iop->a_head);
146 free(iop);
151 struct io *iop;
155 iop = list_entry(p, struct io, a_head);
156 free(iop);
160 static inline int io_setup(struct io *iop, enum iop_type type)
162 iop->type = type;
163 iop->dip = dip_alloc(iop->t.device, iop);
164 if (iop->linked) {
165 iop->pip = find_process(iop->t.pid, NULL);
166 iop->bytes_left = iop->t.bytes;
169 return iop->linked;
172 static inline void io_release(struct io *iop)
174 if (iop->linked)
175 iop_rem_dip(iop);
176 if (iop->pdu)
177 free(iop->pdu);
179 io_free(iop);
200 static inline void update_q2c(struct io *iop, __u64 c_time)
202 if (remapper_dev(iop->dip->device))
203 UPDATE_AVGS(q2c_dm, iop, iop->pip, c_time);
205 UPDATE_AVGS(q2c, iop, iop->pip, c_time);
208 static inline void update_q2a(struct io *iop, __u64 a_time)
210 if (remapper_dev(iop->dip->device))
211 UPDATE_AVGS(q2a_dm, iop, iop->pip, a_time);
213 UPDATE_AVGS(q2a, iop, iop->pip, a_time);
216 static inline void update_q2g(struct io *iop, __u64 g_time)
218 UPDATE_AVGS(q2g, iop, iop->pip, g_time);
221 static inline void update_s2g(struct io *iop, __u64 g_time)
223 UPDATE_AVGS(s2g, iop, iop->pip, g_time);
226 static inline void unupdate_q2g(struct io *iop, __u64 g_time)
228 UNUPDATE_AVGS(q2g, iop, iop->pip, g_time);
231 static inline void update_g2i(struct io *iop, __u64 i_time)
233 UPDATE_AVGS(g2i, iop, iop->pip, i_time);
236 static inline void unupdate_g2i(struct io *iop, __u64 i_time)
238 UNUPDATE_AVGS(g2i, iop, iop->pip, i_time);
241 static inline void update_q2m(struct io *iop, __u64 m_time)
243 UPDATE_AVGS(q2m, iop, iop->pip, m_time);
246 static inline void unupdate_q2m(struct io *iop, __u64 m_time)
248 UNUPDATE_AVGS(q2m, iop, iop->pip, m_time);
251 static inline void update_i2d(struct io *iop, __u64 d_time)
253 UPDATE_AVGS(i2d, iop, iop->pip, d_time);
256 static inline void unupdate_i2d(struct io *iop, __u64 d_time)
258 UNUPDATE_AVGS(i2d, iop, iop->pip, d_time);
261 static inline void update_m2d(struct io *iop, __u64 d_time)
263 UPDATE_AVGS(m2d, iop, iop->pip, d_time);
266 static inline void unupdate_m2d(struct io *iop, __u64 d_time)
268 UNUPDATE_AVGS(m2d, iop, iop->pip, d_time);
271 static inline void update_d2c(struct io *iop, __u64 c_time)
273 UPDATE_AVGS(d2c, iop, iop->pip, c_time);
276 static inline void update_blks(struct io *iop)
278 __u64 nblks = iop->t.bytes >> 9;
280 avg_update(&iop->dip->avgs.blks, nblks);
281 if (iop->pip)
282 avg_update(&iop->pip->avgs.blks, nblks);
291 static inline int dip_rb_ins(struct d_info *dip, struct io *iop)
293 return rb_insert(__get_root(dip, iop->type), iop);
296 static inline void dip_rb_rem(struct io *iop)
298 rb_erase(&iop->rb_node, __get_root(iop->dip, iop->type));
302 struct io *iop,
303 void (*fnc)(struct io *iop, struct io *this),
306 rb_foreach(__get_root(dip, type)->rb_node, iop, fnc, head);
364 static inline void __dump_iop(FILE *ofp, struct io *iop, int extra_nl)
367 (int)SECONDS(iop->t.time),
368 (unsigned long)NANO_SECONDS(iop->t.time),
369 MAJOR(iop->t.device), MINOR(iop->t.device), type2c(iop->type),
370 (unsigned long long)iop->t.sector, t_sec(&iop->t));