Lines Matching full: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
78 spin_lock_irq(&iot->lock); in iot_idle_for()
79 r = __iot_idle_for(iot, jifs); in iot_idle_for()
80 spin_unlock_irq(&iot->lock); in iot_idle_for()
85 static void iot_io_begin(struct io_tracker *iot, sector_t len) in iot_io_begin() argument
87 spin_lock_irq(&iot->lock); in iot_io_begin()
88 iot->in_flight += len; in iot_io_begin()
89 spin_unlock_irq(&iot->lock); in iot_io_begin()
92 static void __iot_io_end(struct io_tracker *iot, sector_t len) in __iot_io_end() argument
97 iot->in_flight -= len; in __iot_io_end()
98 if (!iot->in_flight) in __iot_io_end()
99 iot->idle_time = jiffies; in __iot_io_end()
102 static void iot_io_end(struct io_tracker *iot, sector_t len) in iot_io_end() argument
106 spin_lock_irqsave(&iot->lock, flags); in iot_io_end()
107 __iot_io_end(iot, len); in iot_io_end()
108 spin_unlock_irqrestore(&iot->lock, flags); in iot_io_end()