Lines Matching refs:iot
58 static void iot_init(struct io_tracker *iot) in iot_init() argument
60 spin_lock_init(&iot->lock); in iot_init()
61 iot->in_flight = 0ul; in iot_init()
62 iot->idle_time = 0ul; in iot_init()
63 iot->last_update_time = jiffies; in iot_init()
66 static bool __iot_idle_for(struct io_tracker *iot, unsigned long jifs) in __iot_idle_for() argument
68 if (iot->in_flight) in __iot_idle_for()
71 return time_after(jiffies, iot->idle_time + jifs); in __iot_idle_for()
74 static bool iot_idle_for(struct io_tracker *iot, unsigned long jifs) in iot_idle_for() argument
79 spin_lock_irqsave(&iot->lock, flags); in iot_idle_for()
80 r = __iot_idle_for(iot, jifs); in iot_idle_for()
81 spin_unlock_irqrestore(&iot->lock, flags); in iot_idle_for()
86 static void iot_io_begin(struct io_tracker *iot, sector_t len) in iot_io_begin() argument
90 spin_lock_irqsave(&iot->lock, flags); in iot_io_begin()
91 iot->in_flight += len; in iot_io_begin()
92 spin_unlock_irqrestore(&iot->lock, flags); in iot_io_begin()
95 static void __iot_io_end(struct io_tracker *iot, sector_t len) in __iot_io_end() argument
100 iot->in_flight -= len; in __iot_io_end()
101 if (!iot->in_flight) in __iot_io_end()
102 iot->idle_time = jiffies; in __iot_io_end()
105 static void iot_io_end(struct io_tracker *iot, sector_t len) in iot_io_end() argument
109 spin_lock_irqsave(&iot->lock, flags); in iot_io_end()
110 __iot_io_end(iot, len); in iot_io_end()
111 spin_unlock_irqrestore(&iot->lock, flags); in iot_io_end()