hwmon: (adt7475) set start bit in probe
[linux-2.6/btrfs-unstable.git] / block / blk-stat.h
bloba2050a0a5314bba690cfe6b1f6526e285c892f0d
1 #ifndef BLK_STAT_H
2 #define BLK_STAT_H
4 /*
5 * ~0.13s window as a power-of-2 (2^27 nsecs)
6 */
7 #define BLK_STAT_NSEC 134217728ULL
8 #define BLK_STAT_NSEC_MASK ~(BLK_STAT_NSEC - 1)
11 * Upper 3 bits can be used elsewhere
13 #define BLK_STAT_RES_BITS 3
14 #define BLK_STAT_SHIFT (64 - BLK_STAT_RES_BITS)
15 #define BLK_STAT_TIME_MASK ((1ULL << BLK_STAT_SHIFT) - 1)
16 #define BLK_STAT_MASK ~BLK_STAT_TIME_MASK
18 enum {
19 BLK_STAT_READ = 0,
20 BLK_STAT_WRITE,
23 void blk_stat_add(struct blk_rq_stat *, struct request *);
24 void blk_hctx_stat_get(struct blk_mq_hw_ctx *, struct blk_rq_stat *);
25 void blk_queue_stat_get(struct request_queue *, struct blk_rq_stat *);
26 void blk_stat_clear(struct request_queue *);
27 void blk_stat_init(struct blk_rq_stat *);
28 bool blk_stat_is_current(struct blk_rq_stat *);
29 void blk_stat_set_issue_time(struct blk_issue_stat *);
30 bool blk_stat_enable(struct request_queue *);
32 static inline u64 __blk_stat_time(u64 time)
34 return time & BLK_STAT_TIME_MASK;
37 static inline u64 blk_stat_time(struct blk_issue_stat *stat)
39 return __blk_stat_time(stat->time);
42 #endif