0001
0002 #ifndef _BLK_CGROUP_H
0003 #define _BLK_CGROUP_H
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <linux/types.h>
0018
0019 struct bio;
0020 struct cgroup_subsys_state;
0021 struct request_queue;
0022
0023 #define FC_APPID_LEN 129
0024
0025 #ifdef CONFIG_BLK_CGROUP
0026 extern struct cgroup_subsys_state * const blkcg_root_css;
0027
0028 void blkcg_schedule_throttle(struct request_queue *q, bool use_memdelay);
0029 void blkcg_maybe_throttle_current(void);
0030 bool blk_cgroup_congested(void);
0031 void blkcg_pin_online(struct cgroup_subsys_state *blkcg_css);
0032 void blkcg_unpin_online(struct cgroup_subsys_state *blkcg_css);
0033 struct list_head *blkcg_get_cgwb_list(struct cgroup_subsys_state *css);
0034 struct cgroup_subsys_state *bio_blkcg_css(struct bio *bio);
0035
0036 #else
0037
0038 #define blkcg_root_css ((struct cgroup_subsys_state *)ERR_PTR(-EINVAL))
0039
0040 static inline void blkcg_maybe_throttle_current(void) { }
0041 static inline bool blk_cgroup_congested(void) { return false; }
0042 static inline void blkcg_schedule_throttle(struct request_queue *q, bool use_memdelay) { }
0043 static inline struct cgroup_subsys_state *bio_blkcg_css(struct bio *bio)
0044 {
0045 return NULL;
0046 }
0047 #endif
0048
0049 int blkcg_set_fc_appid(char *app_id, u64 cgrp_id, size_t app_id_len);
0050 char *blkcg_get_fc_appid(struct bio *bio);
0051
0052 #endif