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>
19 struct cgroup_subsys_state css
;
22 struct hlist_head blkg_list
;
26 /* An rcu protected unique identifier for the group */
28 struct hlist_node blkcg_node
;
29 unsigned short blkcg_id
;
30 #ifdef CONFIG_DEBUG_BLK_CGROUP
31 /* Store cgroup path */
33 /* How many times this group has been removed from service tree */
34 unsigned long dequeue
;
36 /* The device MKDEV(major, minor), this group has been created for */
39 /* total disk time and nr sectors dispatched by this group */
41 unsigned long sectors
;
44 #define BLKIO_WEIGHT_MIN 100
45 #define BLKIO_WEIGHT_MAX 1000
46 #define BLKIO_WEIGHT_DEFAULT 500
48 #ifdef CONFIG_DEBUG_BLK_CGROUP
49 static inline char *blkg_path(struct blkio_group
*blkg
)
53 void blkiocg_update_blkio_group_dequeue_stats(struct blkio_group
*blkg
,
54 unsigned long dequeue
);
56 static inline char *blkg_path(struct blkio_group
*blkg
) { return NULL
; }
57 static inline void blkiocg_update_blkio_group_dequeue_stats(
58 struct blkio_group
*blkg
, unsigned long dequeue
) {}
61 #ifdef CONFIG_BLK_CGROUP
62 extern struct blkio_cgroup blkio_root_cgroup
;
63 extern struct blkio_cgroup
*cgroup_to_blkio_cgroup(struct cgroup
*cgroup
);
64 extern void blkiocg_add_blkio_group(struct blkio_cgroup
*blkcg
,
65 struct blkio_group
*blkg
, void *key
, dev_t dev
);
66 extern int blkiocg_del_blkio_group(struct blkio_group
*blkg
);
67 extern struct blkio_group
*blkiocg_lookup_group(struct blkio_cgroup
*blkcg
,
69 void blkiocg_update_blkio_group_stats(struct blkio_group
*blkg
,
70 unsigned long time
, unsigned long sectors
);
72 static inline struct blkio_cgroup
*
73 cgroup_to_blkio_cgroup(struct cgroup
*cgroup
) { return NULL
; }
75 static inline void blkiocg_add_blkio_group(struct blkio_cgroup
*blkcg
,
76 struct blkio_group
*blkg
, void *key
, dev_t dev
)
81 blkiocg_del_blkio_group(struct blkio_group
*blkg
) { return 0; }
83 static inline struct blkio_group
*
84 blkiocg_lookup_group(struct blkio_cgroup
*blkcg
, void *key
) { return NULL
; }
85 static inline void blkiocg_update_blkio_group_stats(struct blkio_group
*blkg
,
86 unsigned long time
, unsigned long sectors
)
90 #endif /* _BLK_CGROUP_H */