diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-18 22:27:18 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-18 22:27:18 -0500 |
commit | e572ec7e4e432de7ecf7bd2e62117646fa64e518 (patch) | |
tree | 56b4b738fb566128d2db6d62aed28cfd41b5398a /block/cfq-iosched.c | |
parent | 3d1ab40f4c20767afbd361b258a531d73e3e6fc2 (diff) |
[PATCH] fix rmmod problems with elevator attributes, clean them up
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 93 |
1 files changed, 20 insertions, 73 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 6dc156e1c29b..c4a0d5d8d7f0 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -2304,8 +2304,8 @@ SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum, 0); | |||
2304 | SHOW_FUNCTION(cfq_queued_show, cfqd->cfq_queued, 0); | 2304 | SHOW_FUNCTION(cfq_queued_show, cfqd->cfq_queued, 0); |
2305 | SHOW_FUNCTION(cfq_fifo_expire_sync_show, cfqd->cfq_fifo_expire[1], 1); | 2305 | SHOW_FUNCTION(cfq_fifo_expire_sync_show, cfqd->cfq_fifo_expire[1], 1); |
2306 | SHOW_FUNCTION(cfq_fifo_expire_async_show, cfqd->cfq_fifo_expire[0], 1); | 2306 | SHOW_FUNCTION(cfq_fifo_expire_async_show, cfqd->cfq_fifo_expire[0], 1); |
2307 | SHOW_FUNCTION(cfq_back_max_show, cfqd->cfq_back_max, 0); | 2307 | SHOW_FUNCTION(cfq_back_seek_max_show, cfqd->cfq_back_max, 0); |
2308 | SHOW_FUNCTION(cfq_back_penalty_show, cfqd->cfq_back_penalty, 0); | 2308 | SHOW_FUNCTION(cfq_back_seek_penalty_show, cfqd->cfq_back_penalty, 0); |
2309 | SHOW_FUNCTION(cfq_slice_idle_show, cfqd->cfq_slice_idle, 1); | 2309 | SHOW_FUNCTION(cfq_slice_idle_show, cfqd->cfq_slice_idle, 1); |
2310 | SHOW_FUNCTION(cfq_slice_sync_show, cfqd->cfq_slice[1], 1); | 2310 | SHOW_FUNCTION(cfq_slice_sync_show, cfqd->cfq_slice[1], 1); |
2311 | SHOW_FUNCTION(cfq_slice_async_show, cfqd->cfq_slice[0], 1); | 2311 | SHOW_FUNCTION(cfq_slice_async_show, cfqd->cfq_slice[0], 1); |
@@ -2333,8 +2333,8 @@ STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, UINT_MAX, 0); | |||
2333 | STORE_FUNCTION(cfq_queued_store, &cfqd->cfq_queued, 1, UINT_MAX, 0); | 2333 | STORE_FUNCTION(cfq_queued_store, &cfqd->cfq_queued, 1, UINT_MAX, 0); |
2334 | STORE_FUNCTION(cfq_fifo_expire_sync_store, &cfqd->cfq_fifo_expire[1], 1, UINT_MAX, 1); | 2334 | STORE_FUNCTION(cfq_fifo_expire_sync_store, &cfqd->cfq_fifo_expire[1], 1, UINT_MAX, 1); |
2335 | STORE_FUNCTION(cfq_fifo_expire_async_store, &cfqd->cfq_fifo_expire[0], 1, UINT_MAX, 1); | 2335 | STORE_FUNCTION(cfq_fifo_expire_async_store, &cfqd->cfq_fifo_expire[0], 1, UINT_MAX, 1); |
2336 | STORE_FUNCTION(cfq_back_max_store, &cfqd->cfq_back_max, 0, UINT_MAX, 0); | 2336 | STORE_FUNCTION(cfq_back_seek_max_store, &cfqd->cfq_back_max, 0, UINT_MAX, 0); |
2337 | STORE_FUNCTION(cfq_back_penalty_store, &cfqd->cfq_back_penalty, 1, UINT_MAX, 0); | 2337 | STORE_FUNCTION(cfq_back_seek_penalty_store, &cfqd->cfq_back_penalty, 1, UINT_MAX, 0); |
2338 | STORE_FUNCTION(cfq_slice_idle_store, &cfqd->cfq_slice_idle, 0, UINT_MAX, 1); | 2338 | STORE_FUNCTION(cfq_slice_idle_store, &cfqd->cfq_slice_idle, 0, UINT_MAX, 1); |
2339 | STORE_FUNCTION(cfq_slice_sync_store, &cfqd->cfq_slice[1], 1, UINT_MAX, 1); | 2339 | STORE_FUNCTION(cfq_slice_sync_store, &cfqd->cfq_slice[1], 1, UINT_MAX, 1); |
2340 | STORE_FUNCTION(cfq_slice_async_store, &cfqd->cfq_slice[0], 1, UINT_MAX, 1); | 2340 | STORE_FUNCTION(cfq_slice_async_store, &cfqd->cfq_slice[0], 1, UINT_MAX, 1); |
@@ -2342,75 +2342,22 @@ STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1, UINT_MAX, | |||
2342 | STORE_FUNCTION(cfq_max_depth_store, &cfqd->cfq_max_depth, 1, UINT_MAX, 0); | 2342 | STORE_FUNCTION(cfq_max_depth_store, &cfqd->cfq_max_depth, 1, UINT_MAX, 0); |
2343 | #undef STORE_FUNCTION | 2343 | #undef STORE_FUNCTION |
2344 | 2344 | ||
2345 | static struct elv_fs_entry cfq_quantum_entry = { | 2345 | #define CFQ_ATTR(name) \ |
2346 | .attr = {.name = "quantum", .mode = S_IRUGO | S_IWUSR }, | 2346 | __ATTR(name, S_IRUGO|S_IWUSR, cfq_##name##_show, cfq_##name##_store) |
2347 | .show = cfq_quantum_show, | 2347 | |
2348 | .store = cfq_quantum_store, | 2348 | static struct elv_fs_entry cfq_attrs[] = { |
2349 | }; | 2349 | CFQ_ATTR(quantum), |
2350 | static struct elv_fs_entry cfq_queued_entry = { | 2350 | CFQ_ATTR(queued), |
2351 | .attr = {.name = "queued", .mode = S_IRUGO | S_IWUSR }, | 2351 | CFQ_ATTR(fifo_expire_sync), |
2352 | .show = cfq_queued_show, | 2352 | CFQ_ATTR(fifo_expire_async), |
2353 | .store = cfq_queued_store, | 2353 | CFQ_ATTR(back_seek_max), |
2354 | }; | 2354 | CFQ_ATTR(back_seek_penalty), |
2355 | static struct elv_fs_entry cfq_fifo_expire_sync_entry = { | 2355 | CFQ_ATTR(slice_sync), |
2356 | .attr = {.name = "fifo_expire_sync", .mode = S_IRUGO | S_IWUSR }, | 2356 | CFQ_ATTR(slice_async), |
2357 | .show = cfq_fifo_expire_sync_show, | 2357 | CFQ_ATTR(slice_async_rq), |
2358 | .store = cfq_fifo_expire_sync_store, | 2358 | CFQ_ATTR(slice_idle), |
2359 | }; | 2359 | CFQ_ATTR(max_depth), |
2360 | static struct elv_fs_entry cfq_fifo_expire_async_entry = { | 2360 | __ATTR_NULL |
2361 | .attr = {.name = "fifo_expire_async", .mode = S_IRUGO | S_IWUSR }, | ||
2362 | .show = cfq_fifo_expire_async_show, | ||
2363 | .store = cfq_fifo_expire_async_store, | ||
2364 | }; | ||
2365 | static struct elv_fs_entry cfq_back_max_entry = { | ||
2366 | .attr = {.name = "back_seek_max", .mode = S_IRUGO | S_IWUSR }, | ||
2367 | .show = cfq_back_max_show, | ||
2368 | .store = cfq_back_max_store, | ||
2369 | }; | ||
2370 | static struct elv_fs_entry cfq_back_penalty_entry = { | ||
2371 | .attr = {.name = "back_seek_penalty", .mode = S_IRUGO | S_IWUSR }, | ||
2372 | .show = cfq_back_penalty_show, | ||
2373 | .store = cfq_back_penalty_store, | ||
2374 | }; | ||
2375 | static struct elv_fs_entry cfq_slice_sync_entry = { | ||
2376 | .attr = {.name = "slice_sync", .mode = S_IRUGO | S_IWUSR }, | ||
2377 | .show = cfq_slice_sync_show, | ||
2378 | .store = cfq_slice_sync_store, | ||
2379 | }; | ||
2380 | static struct elv_fs_entry cfq_slice_async_entry = { | ||
2381 | .attr = {.name = "slice_async", .mode = S_IRUGO | S_IWUSR }, | ||
2382 | .show = cfq_slice_async_show, | ||
2383 | .store = cfq_slice_async_store, | ||
2384 | }; | ||
2385 | static struct elv_fs_entry cfq_slice_async_rq_entry = { | ||
2386 | .attr = {.name = "slice_async_rq", .mode = S_IRUGO | S_IWUSR }, | ||
2387 | .show = cfq_slice_async_rq_show, | ||
2388 | .store = cfq_slice_async_rq_store, | ||
2389 | }; | ||
2390 | static struct elv_fs_entry cfq_slice_idle_entry = { | ||
2391 | .attr = {.name = "slice_idle", .mode = S_IRUGO | S_IWUSR }, | ||
2392 | .show = cfq_slice_idle_show, | ||
2393 | .store = cfq_slice_idle_store, | ||
2394 | }; | ||
2395 | static struct elv_fs_entry cfq_max_depth_entry = { | ||
2396 | .attr = {.name = "max_depth", .mode = S_IRUGO | S_IWUSR }, | ||
2397 | .show = cfq_max_depth_show, | ||
2398 | .store = cfq_max_depth_store, | ||
2399 | }; | ||
2400 | |||
2401 | static struct attribute *cfq_attrs[] = { | ||
2402 | &cfq_quantum_entry.attr, | ||
2403 | &cfq_queued_entry.attr, | ||
2404 | &cfq_fifo_expire_sync_entry.attr, | ||
2405 | &cfq_fifo_expire_async_entry.attr, | ||
2406 | &cfq_back_max_entry.attr, | ||
2407 | &cfq_back_penalty_entry.attr, | ||
2408 | &cfq_slice_sync_entry.attr, | ||
2409 | &cfq_slice_async_entry.attr, | ||
2410 | &cfq_slice_async_rq_entry.attr, | ||
2411 | &cfq_slice_idle_entry.attr, | ||
2412 | &cfq_max_depth_entry.attr, | ||
2413 | NULL, | ||
2414 | }; | 2361 | }; |
2415 | 2362 | ||
2416 | static struct elevator_type iosched_cfq = { | 2363 | static struct elevator_type iosched_cfq = { |