Lines Matching refs:iot
46 static void iot_init(struct io_tracker *iot) in iot_init() argument
48 spin_lock_init(&iot->lock); in iot_init()
49 iot->in_flight = 0ul; in iot_init()
50 iot->idle_time = 0ul; in iot_init()
51 iot->last_update_time = jiffies; in iot_init()
54 static bool __iot_idle_for(struct io_tracker *iot, unsigned long jifs) in __iot_idle_for() argument
56 if (iot->in_flight) in __iot_idle_for()
59 return time_after(jiffies, iot->idle_time + jifs); in __iot_idle_for()
62 static bool iot_idle_for(struct io_tracker *iot, unsigned long jifs) in iot_idle_for() argument
67 spin_lock_irqsave(&iot->lock, flags); in iot_idle_for()
68 r = __iot_idle_for(iot, jifs); in iot_idle_for()
69 spin_unlock_irqrestore(&iot->lock, flags); in iot_idle_for()
74 static void iot_io_begin(struct io_tracker *iot, sector_t len) in iot_io_begin() argument
78 spin_lock_irqsave(&iot->lock, flags); in iot_io_begin()
79 iot->in_flight += len; in iot_io_begin()
80 spin_unlock_irqrestore(&iot->lock, flags); in iot_io_begin()
83 static void __iot_io_end(struct io_tracker *iot, sector_t len) in __iot_io_end() argument
85 iot->in_flight -= len; in __iot_io_end()
86 if (!iot->in_flight) in __iot_io_end()
87 iot->idle_time = jiffies; in __iot_io_end()
90 static void iot_io_end(struct io_tracker *iot, sector_t len) in iot_io_end() argument
94 spin_lock_irqsave(&iot->lock, flags); in iot_io_end()
95 __iot_io_end(iot, len); in iot_io_end()
96 spin_unlock_irqrestore(&iot->lock, flags); in iot_io_end()