Lines Matching full:iot
29 static inline void dm_iot_init(struct dm_io_tracker *iot) in dm_iot_init() argument
31 spin_lock_init(&iot->lock); in dm_iot_init()
32 iot->in_flight = 0ul; in dm_iot_init()
33 iot->idle_time = 0ul; in dm_iot_init()
34 iot->last_update_time = jiffies; in dm_iot_init()
37 static inline bool dm_iot_idle_for(struct dm_io_tracker *iot, unsigned long j) in dm_iot_idle_for() argument
41 spin_lock_irq(&iot->lock); in dm_iot_idle_for()
42 if (!iot->in_flight) in dm_iot_idle_for()
43 r = time_after(jiffies, iot->idle_time + j); in dm_iot_idle_for()
44 spin_unlock_irq(&iot->lock); in dm_iot_idle_for()
49 static inline unsigned long dm_iot_idle_time(struct dm_io_tracker *iot) in dm_iot_idle_time() argument
53 spin_lock_irq(&iot->lock); in dm_iot_idle_time()
54 if (!iot->in_flight) in dm_iot_idle_time()
55 r = jiffies - iot->idle_time; in dm_iot_idle_time()
56 spin_unlock_irq(&iot->lock); in dm_iot_idle_time()
61 static inline void dm_iot_io_begin(struct dm_io_tracker *iot, sector_t len) in dm_iot_io_begin() argument
63 spin_lock_irq(&iot->lock); in dm_iot_io_begin()
64 iot->in_flight += len; in dm_iot_io_begin()
65 spin_unlock_irq(&iot->lock); in dm_iot_io_begin()
68 static inline void dm_iot_io_end(struct dm_io_tracker *iot, sector_t len) in dm_iot_io_end() argument
75 spin_lock_irqsave(&iot->lock, flags); in dm_iot_io_end()
76 iot->in_flight -= len; in dm_iot_io_end()
77 if (!iot->in_flight) in dm_iot_io_end()
78 iot->idle_time = jiffies; in dm_iot_io_end()
79 spin_unlock_irqrestore(&iot->lock, flags); in dm_iot_io_end()