4 * Common Block IO controller cgroup interface
6 * Based on ideas and code from CFQ, CFS and BFQ:
7 * Copyright (C) 2003 Jens Axboe <axboe@kernel.dk>
9 * Copyright (C) 2008 Fabio Checconi <fabio@gandalf.sssup.it>
10 * Paolo Valente <paolo.valente@unimore.it>
12 * Copyright (C) 2009 Vivek Goyal <vgoyal@redhat.com>
13 * Nauman Rafique <nauman@google.com>
16 #include <linux/cgroup.h>
18 #ifdef CONFIG_BLK_CGROUP
21 struct cgroup_subsys_state css
;
24 struct hlist_head blkg_list
;
28 /* An rcu protected unique identifier for the group */
30 struct hlist_node blkcg_node
;
31 unsigned short blkcg_id
;
32 #ifdef CONFIG_DEBUG_BLK_CGROUP
33 /* Store cgroup path */
35 /* How many times this group has been removed from service tree */
36 unsigned long dequeue
;
38 /* The device MKDEV(major, minor), this group has been created for */
41 /* total disk time and nr sectors dispatched by this group */
43 unsigned long sectors
;
53 #define BLKIO_WEIGHT_MIN 100
54 #define BLKIO_WEIGHT_MAX 1000
55 #define BLKIO_WEIGHT_DEFAULT 500
57 #ifdef CONFIG_DEBUG_BLK_CGROUP
58 static inline char *blkg_path(struct blkio_group
*blkg
)
62 void blkiocg_update_blkio_group_dequeue_stats(struct blkio_group
*blkg
,
63 unsigned long dequeue
);
65 static inline char *blkg_path(struct blkio_group
*blkg
) { return NULL
; }
66 static inline void blkiocg_update_blkio_group_dequeue_stats(
67 struct blkio_group
*blkg
, unsigned long dequeue
) {}
70 #ifdef CONFIG_BLK_CGROUP
71 extern struct blkio_cgroup blkio_root_cgroup
;
72 extern struct blkio_cgroup
*cgroup_to_blkio_cgroup(struct cgroup
*cgroup
);
73 extern void blkiocg_add_blkio_group(struct blkio_cgroup
*blkcg
,
74 struct blkio_group
*blkg
, void *key
, dev_t dev
);
75 extern int blkiocg_del_blkio_group(struct blkio_group
*blkg
);
76 extern struct blkio_group
*blkiocg_lookup_group(struct blkio_cgroup
*blkcg
,
78 void blkiocg_update_blkio_group_stats(struct blkio_group
*blkg
,
79 unsigned long time
, unsigned long sectors
);
82 static inline struct blkio_cgroup
*
83 cgroup_to_blkio_cgroup(struct cgroup
*cgroup
) { return NULL
; }
85 static inline void blkiocg_add_blkio_group(struct blkio_cgroup
*blkcg
,
86 struct blkio_group
*blkg
, void *key
, dev_t dev
)
91 blkiocg_del_blkio_group(struct blkio_group
*blkg
) { return 0; }
93 static inline struct blkio_group
*
94 blkiocg_lookup_group(struct blkio_cgroup
*blkcg
, void *key
) { return NULL
; }
95 static inline void blkiocg_update_blkio_group_stats(struct blkio_group
*blkg
,
96 unsigned long time
, unsigned long sectors
)
100 #endif /* _BLK_CGROUP_H */