diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2010-10-01 08:49:41 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-10-01 08:49:41 -0400 |
commit | 13f98250f587b7defa39ed738dfa74b600e46e7b (patch) | |
tree | 9d06cb3cd0c8737d1c9289ad6d19e4f4c8ec601f /block/blk-cgroup.c | |
parent | efb012b361cf9319cd86ff169afa7550b7aa9336 (diff) |
blkio: Do not export throttle files if CONFIG_BLK_DEV_THROTTLING=n
Currently throttling related files were visible even if user had disabled
throttling using config options. It was switching off background throttling
of bio but not the cgroup files. This patch fixes it.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r-- | block/blk-cgroup.c | 97 |
1 files changed, 50 insertions, 47 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 20ce6f584e43..86e7066a0b62 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -1242,41 +1242,6 @@ struct cftype blkio_files[] = { | |||
1242 | .write_u64 = blkiocg_file_write_u64, | 1242 | .write_u64 = blkiocg_file_write_u64, |
1243 | }, | 1243 | }, |
1244 | { | 1244 | { |
1245 | .name = "throttle.read_bps_device", | ||
1246 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1247 | BLKIO_THROTL_read_bps_device), | ||
1248 | .read_seq_string = blkiocg_file_read, | ||
1249 | .write_string = blkiocg_file_write, | ||
1250 | .max_write_len = 256, | ||
1251 | }, | ||
1252 | |||
1253 | { | ||
1254 | .name = "throttle.write_bps_device", | ||
1255 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1256 | BLKIO_THROTL_write_bps_device), | ||
1257 | .read_seq_string = blkiocg_file_read, | ||
1258 | .write_string = blkiocg_file_write, | ||
1259 | .max_write_len = 256, | ||
1260 | }, | ||
1261 | |||
1262 | { | ||
1263 | .name = "throttle.read_iops_device", | ||
1264 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1265 | BLKIO_THROTL_read_iops_device), | ||
1266 | .read_seq_string = blkiocg_file_read, | ||
1267 | .write_string = blkiocg_file_write, | ||
1268 | .max_write_len = 256, | ||
1269 | }, | ||
1270 | |||
1271 | { | ||
1272 | .name = "throttle.write_iops_device", | ||
1273 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1274 | BLKIO_THROTL_write_iops_device), | ||
1275 | .read_seq_string = blkiocg_file_read, | ||
1276 | .write_string = blkiocg_file_write, | ||
1277 | .max_write_len = 256, | ||
1278 | }, | ||
1279 | { | ||
1280 | .name = "time", | 1245 | .name = "time", |
1281 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP, | 1246 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP, |
1282 | BLKIO_PROP_time), | 1247 | BLKIO_PROP_time), |
@@ -1295,24 +1260,12 @@ struct cftype blkio_files[] = { | |||
1295 | .read_map = blkiocg_file_read_map, | 1260 | .read_map = blkiocg_file_read_map, |
1296 | }, | 1261 | }, |
1297 | { | 1262 | { |
1298 | .name = "throttle.io_service_bytes", | ||
1299 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1300 | BLKIO_THROTL_io_service_bytes), | ||
1301 | .read_map = blkiocg_file_read_map, | ||
1302 | }, | ||
1303 | { | ||
1304 | .name = "io_serviced", | 1263 | .name = "io_serviced", |
1305 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP, | 1264 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP, |
1306 | BLKIO_PROP_io_serviced), | 1265 | BLKIO_PROP_io_serviced), |
1307 | .read_map = blkiocg_file_read_map, | 1266 | .read_map = blkiocg_file_read_map, |
1308 | }, | 1267 | }, |
1309 | { | 1268 | { |
1310 | .name = "throttle.io_serviced", | ||
1311 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1312 | BLKIO_THROTL_io_serviced), | ||
1313 | .read_map = blkiocg_file_read_map, | ||
1314 | }, | ||
1315 | { | ||
1316 | .name = "io_service_time", | 1269 | .name = "io_service_time", |
1317 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP, | 1270 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP, |
1318 | BLKIO_PROP_io_service_time), | 1271 | BLKIO_PROP_io_service_time), |
@@ -1340,6 +1293,56 @@ struct cftype blkio_files[] = { | |||
1340 | .name = "reset_stats", | 1293 | .name = "reset_stats", |
1341 | .write_u64 = blkiocg_reset_stats, | 1294 | .write_u64 = blkiocg_reset_stats, |
1342 | }, | 1295 | }, |
1296 | #ifdef CONFIG_BLK_DEV_THROTTLING | ||
1297 | { | ||
1298 | .name = "throttle.read_bps_device", | ||
1299 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1300 | BLKIO_THROTL_read_bps_device), | ||
1301 | .read_seq_string = blkiocg_file_read, | ||
1302 | .write_string = blkiocg_file_write, | ||
1303 | .max_write_len = 256, | ||
1304 | }, | ||
1305 | |||
1306 | { | ||
1307 | .name = "throttle.write_bps_device", | ||
1308 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1309 | BLKIO_THROTL_write_bps_device), | ||
1310 | .read_seq_string = blkiocg_file_read, | ||
1311 | .write_string = blkiocg_file_write, | ||
1312 | .max_write_len = 256, | ||
1313 | }, | ||
1314 | |||
1315 | { | ||
1316 | .name = "throttle.read_iops_device", | ||
1317 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1318 | BLKIO_THROTL_read_iops_device), | ||
1319 | .read_seq_string = blkiocg_file_read, | ||
1320 | .write_string = blkiocg_file_write, | ||
1321 | .max_write_len = 256, | ||
1322 | }, | ||
1323 | |||
1324 | { | ||
1325 | .name = "throttle.write_iops_device", | ||
1326 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1327 | BLKIO_THROTL_write_iops_device), | ||
1328 | .read_seq_string = blkiocg_file_read, | ||
1329 | .write_string = blkiocg_file_write, | ||
1330 | .max_write_len = 256, | ||
1331 | }, | ||
1332 | { | ||
1333 | .name = "throttle.io_service_bytes", | ||
1334 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1335 | BLKIO_THROTL_io_service_bytes), | ||
1336 | .read_map = blkiocg_file_read_map, | ||
1337 | }, | ||
1338 | { | ||
1339 | .name = "throttle.io_serviced", | ||
1340 | .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_THROTL, | ||
1341 | BLKIO_THROTL_io_serviced), | ||
1342 | .read_map = blkiocg_file_read_map, | ||
1343 | }, | ||
1344 | #endif /* CONFIG_BLK_DEV_THROTTLING */ | ||
1345 | |||
1343 | #ifdef CONFIG_DEBUG_BLK_CGROUP | 1346 | #ifdef CONFIG_DEBUG_BLK_CGROUP |
1344 | { | 1347 | { |
1345 | .name = "avg_queue_size", | 1348 | .name = "avg_queue_size", |