Commit 13f98250f587b7defa39ed738dfa74b600e46e7b

Authored by Vivek Goyal
Committed by Jens Axboe
1 parent efb012b361

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>

Showing 1 changed file with 50 additions and 47 deletions Side-by-side Diff

... ... @@ -1242,41 +1242,6 @@
1242 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 1245 .name = "time",
1281 1246 .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP,
1282 1247 BLKIO_PROP_time),
1283 1248  
... ... @@ -1295,24 +1260,12 @@
1295 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 1263 .name = "io_serviced",
1305 1264 .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP,
1306 1265 BLKIO_PROP_io_serviced),
1307 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 1269 .name = "io_service_time",
1317 1270 .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP,
1318 1271 BLKIO_PROP_io_service_time),
... ... @@ -1340,6 +1293,56 @@
1340 1293 .name = "reset_stats",
1341 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 1346 #ifdef CONFIG_DEBUG_BLK_CGROUP
1344 1347 {
1345 1348 .name = "avg_queue_size",