From: Alan D. Brunelle <[EMAIL PROTECTED]>
Add in the notion of pre-culling IOs per device until a Q is hit.
Signed-off-by: Alan D. Brunelle <[EMAIL PROTECTED]>
---
btt/devs.c | 8 ++++++++
btt/globals.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/btt/devs.c b/btt/devs.c
index f2b09d2..a458a77 100644
--- a/btt/devs.c
+++ b/btt/devs.c
@@ -112,9 +112,17 @@ struct d_info *dip_add(__u32 device, struct io *iop)
list_add_tail(&dip->hash_head, &dev_heads[DEV_HASH(device)]);
list_add_tail(&dip->all_head, &all_devs);
dip->start_time = BIT_TIME(iop->t.time);
+ dip->pre_culling = 1;
n_devs++;
}
+ if (dip->pre_culling) {
+ if (iop->type == IOP_Q || iop->type == IOP_A)
+ dip->pre_culling = 0;
+ else
+ return NULL;
+ }
+
iop->linked = dip_rb_ins(dip, iop);
#if defined(DEBUG)
if (iop->linked)
diff --git a/btt/globals.h b/btt/globals.h
index aebd0d8..cdf6fc9 100644
--- a/btt/globals.h
+++ b/btt/globals.h
@@ -166,6 +166,7 @@ struct d_info {
__u64 last_q, n_ds;
__u32 device;
+ int pre_culling;
int is_plugged, nplugs, n_timer_unplugs;
double start_time, last_plug, plugged_time, end_time;
};