aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r--block/blk-cgroup.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 3573199b298b..b24ab71db826 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -30,7 +30,15 @@ struct blkio_group {
30#ifdef CONFIG_DEBUG_BLK_CGROUP 30#ifdef CONFIG_DEBUG_BLK_CGROUP
31 /* Store cgroup path */ 31 /* Store cgroup path */
32 char path[128]; 32 char path[128];
33 /* How many times this group has been removed from service tree */
34 unsigned long dequeue;
33#endif 35#endif
36 /* The device MKDEV(major, minor), this group has been created for */
37 dev_t dev;
38
39 /* total disk time and nr sectors dispatched by this group */
40 unsigned long time;
41 unsigned long sectors;
34}; 42};
35 43
36#define BLKIO_WEIGHT_MIN 100 44#define BLKIO_WEIGHT_MIN 100
@@ -42,24 +50,30 @@ static inline char *blkg_path(struct blkio_group *blkg)
42{ 50{
43 return blkg->path; 51 return blkg->path;
44} 52}
53void blkiocg_update_blkio_group_dequeue_stats(struct blkio_group *blkg,
54 unsigned long dequeue);
45#else 55#else
46static inline char *blkg_path(struct blkio_group *blkg) { return NULL; } 56static inline char *blkg_path(struct blkio_group *blkg) { return NULL; }
57static inline void blkiocg_update_blkio_group_dequeue_stats(
58 struct blkio_group *blkg, unsigned long dequeue) {}
47#endif 59#endif
48 60
49#ifdef CONFIG_BLK_CGROUP 61#ifdef CONFIG_BLK_CGROUP
50extern struct blkio_cgroup blkio_root_cgroup; 62extern struct blkio_cgroup blkio_root_cgroup;
51extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); 63extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup);
52extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, 64extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
53 struct blkio_group *blkg, void *key); 65 struct blkio_group *blkg, void *key, dev_t dev);
54extern int blkiocg_del_blkio_group(struct blkio_group *blkg); 66extern int blkiocg_del_blkio_group(struct blkio_group *blkg);
55extern struct blkio_group *blkiocg_lookup_group(struct blkio_cgroup *blkcg, 67extern struct blkio_group *blkiocg_lookup_group(struct blkio_cgroup *blkcg,
56 void *key); 68 void *key);
69void blkiocg_update_blkio_group_stats(struct blkio_group *blkg,
70 unsigned long time, unsigned long sectors);
57#else 71#else
58static inline struct blkio_cgroup * 72static inline struct blkio_cgroup *
59cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; } 73cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; }
60 74
61static inline void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, 75static inline void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
62 struct blkio_group *blkg, void *key) 76 struct blkio_group *blkg, void *key, dev_t dev)
63{ 77{
64} 78}
65 79
@@ -68,5 +82,9 @@ blkiocg_del_blkio_group(struct blkio_group *blkg) { return 0; }
68 82
69static inline struct blkio_group * 83static inline struct blkio_group *
70blkiocg_lookup_group(struct blkio_cgroup *blkcg, void *key) { return NULL; } 84blkiocg_lookup_group(struct blkio_cgroup *blkcg, void *key) { return NULL; }
85static inline void blkiocg_update_blkio_group_stats(struct blkio_group *blkg,
86 unsigned long time, unsigned long sectors)
87{
88}
71#endif 89#endif
72#endif /* _BLK_CGROUP_H */ 90#endif /* _BLK_CGROUP_H */