@@ -2304,8 +2304,8 @@ SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum, 0);
23042304SHOW_FUNCTION (cfq_queued_show , cfqd -> cfq_queued , 0 );
23052305SHOW_FUNCTION (cfq_fifo_expire_sync_show , cfqd -> cfq_fifo_expire [1 ], 1 );
23062306SHOW_FUNCTION (cfq_fifo_expire_async_show , cfqd -> cfq_fifo_expire [0 ], 1 );
2307- SHOW_FUNCTION (cfq_back_max_show , cfqd -> cfq_back_max , 0 );
2308- SHOW_FUNCTION (cfq_back_penalty_show , cfqd -> cfq_back_penalty , 0 );
2307+ SHOW_FUNCTION (cfq_back_seek_max_show , cfqd -> cfq_back_max , 0 );
2308+ SHOW_FUNCTION (cfq_back_seek_penalty_show , cfqd -> cfq_back_penalty , 0 );
23092309SHOW_FUNCTION (cfq_slice_idle_show , cfqd -> cfq_slice_idle , 1 );
23102310SHOW_FUNCTION (cfq_slice_sync_show , cfqd -> cfq_slice [1 ], 1 );
23112311SHOW_FUNCTION (cfq_slice_async_show , cfqd -> cfq_slice [0 ], 1 );
@@ -2333,84 +2333,31 @@ STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, UINT_MAX, 0);
23332333STORE_FUNCTION (cfq_queued_store , & cfqd -> cfq_queued , 1 , UINT_MAX , 0 );
23342334STORE_FUNCTION (cfq_fifo_expire_sync_store , & cfqd -> cfq_fifo_expire [1 ], 1 , UINT_MAX , 1 );
23352335STORE_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 );
2337- STORE_FUNCTION (cfq_back_penalty_store , & cfqd -> cfq_back_penalty , 1 , UINT_MAX , 0 );
2336+ STORE_FUNCTION (cfq_back_seek_max_store , & cfqd -> cfq_back_max , 0 , UINT_MAX , 0 );
2337+ STORE_FUNCTION (cfq_back_seek_penalty_store , & cfqd -> cfq_back_penalty , 1 , UINT_MAX , 0 );
23382338STORE_FUNCTION (cfq_slice_idle_store , & cfqd -> cfq_slice_idle , 0 , UINT_MAX , 1 );
23392339STORE_FUNCTION (cfq_slice_sync_store , & cfqd -> cfq_slice [1 ], 1 , UINT_MAX , 1 );
23402340STORE_FUNCTION (cfq_slice_async_store , & cfqd -> cfq_slice [0 ], 1 , UINT_MAX , 1 );
23412341STORE_FUNCTION (cfq_slice_async_rq_store , & cfqd -> cfq_slice_async_rq , 1 , UINT_MAX , 0 );
23422342STORE_FUNCTION (cfq_max_depth_store , & cfqd -> cfq_max_depth , 1 , UINT_MAX , 0 );
23432343#undef STORE_FUNCTION
23442344
2345- static struct elv_fs_entry cfq_quantum_entry = {
2346- .attr = {.name = "quantum" , .mode = S_IRUGO | S_IWUSR },
2347- .show = cfq_quantum_show ,
2348- .store = cfq_quantum_store ,
2349- };
2350- static struct elv_fs_entry cfq_queued_entry = {
2351- .attr = {.name = "queued" , .mode = S_IRUGO | S_IWUSR },
2352- .show = cfq_queued_show ,
2353- .store = cfq_queued_store ,
2354- };
2355- static struct elv_fs_entry cfq_fifo_expire_sync_entry = {
2356- .attr = {.name = "fifo_expire_sync" , .mode = S_IRUGO | S_IWUSR },
2357- .show = cfq_fifo_expire_sync_show ,
2358- .store = cfq_fifo_expire_sync_store ,
2359- };
2360- static struct elv_fs_entry cfq_fifo_expire_async_entry = {
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 ,
2345+ #define CFQ_ATTR (name ) \
2346+ __ATTR(name, S_IRUGO|S_IWUSR, cfq_##name##_show, cfq_##name##_store)
2347+
2348+ static struct elv_fs_entry cfq_attrs [] = {
2349+ CFQ_ATTR (quantum ),
2350+ CFQ_ATTR (queued ),
2351+ CFQ_ATTR (fifo_expire_sync ),
2352+ CFQ_ATTR (fifo_expire_async ),
2353+ CFQ_ATTR (back_seek_max ),
2354+ CFQ_ATTR (back_seek_penalty ),
2355+ CFQ_ATTR (slice_sync ),
2356+ CFQ_ATTR (slice_async ),
2357+ CFQ_ATTR (slice_async_rq ),
2358+ CFQ_ATTR (slice_idle ),
2359+ CFQ_ATTR (max_depth ),
2360+ __ATTR_NULL
24142361};
24152362
24162363static struct elevator_type iosched_cfq = {
0 commit comments