diff options
-rw-r--r-- | block/blk-throttle.c | 35 | ||||
-rw-r--r-- | block/cfq-iosched.c | 131 | ||||
-rw-r--r-- | include/linux/cgroup.h | 9 | ||||
-rw-r--r-- | kernel/cgroup.c | 34 | ||||
-rw-r--r-- | kernel/cgroup_freezer.c | 7 | ||||
-rw-r--r-- | kernel/cpuset.c | 12 | ||||
-rw-r--r-- | kernel/sched/core.c | 7 | ||||
-rw-r--r-- | kernel/sched/cpuacct.c | 14 | ||||
-rw-r--r-- | mm/memcontrol.c | 28 | ||||
-rw-r--r-- | net/core/netprio_cgroup.c | 8 | ||||
-rw-r--r-- | security/device_cgroup.c | 7 |
11 files changed, 128 insertions, 164 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 06534049afba..a760857e6b62 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -1303,13 +1303,10 @@ static u64 tg_prfill_cpu_rwstat(struct seq_file *sf, | |||
1303 | return __blkg_prfill_rwstat(sf, pd, &rwstat); | 1303 | return __blkg_prfill_rwstat(sf, pd, &rwstat); |
1304 | } | 1304 | } |
1305 | 1305 | ||
1306 | static int tg_print_cpu_rwstat(struct cgroup_subsys_state *css, | 1306 | static int tg_print_cpu_rwstat(struct seq_file *sf, void *v) |
1307 | struct cftype *cft, struct seq_file *sf) | ||
1308 | { | 1307 | { |
1309 | struct blkcg *blkcg = css_to_blkcg(css); | 1308 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_cpu_rwstat, |
1310 | 1309 | &blkcg_policy_throtl, seq_cft(sf)->private, true); | |
1311 | blkcg_print_blkgs(sf, blkcg, tg_prfill_cpu_rwstat, &blkcg_policy_throtl, | ||
1312 | cft->private, true); | ||
1313 | return 0; | 1310 | return 0; |
1314 | } | 1311 | } |
1315 | 1312 | ||
@@ -1335,19 +1332,17 @@ static u64 tg_prfill_conf_uint(struct seq_file *sf, struct blkg_policy_data *pd, | |||
1335 | return __blkg_prfill_u64(sf, pd, v); | 1332 | return __blkg_prfill_u64(sf, pd, v); |
1336 | } | 1333 | } |
1337 | 1334 | ||
1338 | static int tg_print_conf_u64(struct cgroup_subsys_state *css, | 1335 | static int tg_print_conf_u64(struct seq_file *sf, void *v) |
1339 | struct cftype *cft, struct seq_file *sf) | ||
1340 | { | 1336 | { |
1341 | blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_u64, | 1337 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_u64, |
1342 | &blkcg_policy_throtl, cft->private, false); | 1338 | &blkcg_policy_throtl, seq_cft(sf)->private, false); |
1343 | return 0; | 1339 | return 0; |
1344 | } | 1340 | } |
1345 | 1341 | ||
1346 | static int tg_print_conf_uint(struct cgroup_subsys_state *css, | 1342 | static int tg_print_conf_uint(struct seq_file *sf, void *v) |
1347 | struct cftype *cft, struct seq_file *sf) | ||
1348 | { | 1343 | { |
1349 | blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_uint, | 1344 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_uint, |
1350 | &blkcg_policy_throtl, cft->private, false); | 1345 | &blkcg_policy_throtl, seq_cft(sf)->private, false); |
1351 | return 0; | 1346 | return 0; |
1352 | } | 1347 | } |
1353 | 1348 | ||
@@ -1428,40 +1423,40 @@ static struct cftype throtl_files[] = { | |||
1428 | { | 1423 | { |
1429 | .name = "throttle.read_bps_device", | 1424 | .name = "throttle.read_bps_device", |
1430 | .private = offsetof(struct throtl_grp, bps[READ]), | 1425 | .private = offsetof(struct throtl_grp, bps[READ]), |
1431 | .read_seq_string = tg_print_conf_u64, | 1426 | .seq_show = tg_print_conf_u64, |
1432 | .write_string = tg_set_conf_u64, | 1427 | .write_string = tg_set_conf_u64, |
1433 | .max_write_len = 256, | 1428 | .max_write_len = 256, |
1434 | }, | 1429 | }, |
1435 | { | 1430 | { |
1436 | .name = "throttle.write_bps_device", | 1431 | .name = "throttle.write_bps_device", |
1437 | .private = offsetof(struct throtl_grp, bps[WRITE]), | 1432 | .private = offsetof(struct throtl_grp, bps[WRITE]), |
1438 | .read_seq_string = tg_print_conf_u64, | 1433 | .seq_show = tg_print_conf_u64, |
1439 | .write_string = tg_set_conf_u64, | 1434 | .write_string = tg_set_conf_u64, |
1440 | .max_write_len = 256, | 1435 | .max_write_len = 256, |
1441 | }, | 1436 | }, |
1442 | { | 1437 | { |
1443 | .name = "throttle.read_iops_device", | 1438 | .name = "throttle.read_iops_device", |
1444 | .private = offsetof(struct throtl_grp, iops[READ]), | 1439 | .private = offsetof(struct throtl_grp, iops[READ]), |
1445 | .read_seq_string = tg_print_conf_uint, | 1440 | .seq_show = tg_print_conf_uint, |
1446 | .write_string = tg_set_conf_uint, | 1441 | .write_string = tg_set_conf_uint, |
1447 | .max_write_len = 256, | 1442 | .max_write_len = 256, |
1448 | }, | 1443 | }, |
1449 | { | 1444 | { |
1450 | .name = "throttle.write_iops_device", | 1445 | .name = "throttle.write_iops_device", |
1451 | .private = offsetof(struct throtl_grp, iops[WRITE]), | 1446 | .private = offsetof(struct throtl_grp, iops[WRITE]), |
1452 | .read_seq_string = tg_print_conf_uint, | 1447 | .seq_show = tg_print_conf_uint, |
1453 | .write_string = tg_set_conf_uint, | 1448 | .write_string = tg_set_conf_uint, |
1454 | .max_write_len = 256, | 1449 | .max_write_len = 256, |
1455 | }, | 1450 | }, |
1456 | { | 1451 | { |
1457 | .name = "throttle.io_service_bytes", | 1452 | .name = "throttle.io_service_bytes", |
1458 | .private = offsetof(struct tg_stats_cpu, service_bytes), | 1453 | .private = offsetof(struct tg_stats_cpu, service_bytes), |
1459 | .read_seq_string = tg_print_cpu_rwstat, | 1454 | .seq_show = tg_print_cpu_rwstat, |
1460 | }, | 1455 | }, |
1461 | { | 1456 | { |
1462 | .name = "throttle.io_serviced", | 1457 | .name = "throttle.io_serviced", |
1463 | .private = offsetof(struct tg_stats_cpu, serviced), | 1458 | .private = offsetof(struct tg_stats_cpu, serviced), |
1464 | .read_seq_string = tg_print_cpu_rwstat, | 1459 | .seq_show = tg_print_cpu_rwstat, |
1465 | }, | 1460 | }, |
1466 | { } /* terminate */ | 1461 | { } /* terminate */ |
1467 | }; | 1462 | }; |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 4d5cec1ad80d..744833b630c6 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1632,11 +1632,11 @@ static u64 cfqg_prfill_weight_device(struct seq_file *sf, | |||
1632 | return __blkg_prfill_u64(sf, pd, cfqg->dev_weight); | 1632 | return __blkg_prfill_u64(sf, pd, cfqg->dev_weight); |
1633 | } | 1633 | } |
1634 | 1634 | ||
1635 | static int cfqg_print_weight_device(struct cgroup_subsys_state *css, | 1635 | static int cfqg_print_weight_device(struct seq_file *sf, void *v) |
1636 | struct cftype *cft, struct seq_file *sf) | ||
1637 | { | 1636 | { |
1638 | blkcg_print_blkgs(sf, css_to_blkcg(css), cfqg_prfill_weight_device, | 1637 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), |
1639 | &blkcg_policy_cfq, 0, false); | 1638 | cfqg_prfill_weight_device, &blkcg_policy_cfq, |
1639 | 0, false); | ||
1640 | return 0; | 1640 | return 0; |
1641 | } | 1641 | } |
1642 | 1642 | ||
@@ -1650,26 +1650,23 @@ static u64 cfqg_prfill_leaf_weight_device(struct seq_file *sf, | |||
1650 | return __blkg_prfill_u64(sf, pd, cfqg->dev_leaf_weight); | 1650 | return __blkg_prfill_u64(sf, pd, cfqg->dev_leaf_weight); |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | static int cfqg_print_leaf_weight_device(struct cgroup_subsys_state *css, | 1653 | static int cfqg_print_leaf_weight_device(struct seq_file *sf, void *v) |
1654 | struct cftype *cft, | ||
1655 | struct seq_file *sf) | ||
1656 | { | 1654 | { |
1657 | blkcg_print_blkgs(sf, css_to_blkcg(css), cfqg_prfill_leaf_weight_device, | 1655 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), |
1658 | &blkcg_policy_cfq, 0, false); | 1656 | cfqg_prfill_leaf_weight_device, &blkcg_policy_cfq, |
1657 | 0, false); | ||
1659 | return 0; | 1658 | return 0; |
1660 | } | 1659 | } |
1661 | 1660 | ||
1662 | static int cfq_print_weight(struct cgroup_subsys_state *css, struct cftype *cft, | 1661 | static int cfq_print_weight(struct seq_file *sf, void *v) |
1663 | struct seq_file *sf) | ||
1664 | { | 1662 | { |
1665 | seq_printf(sf, "%u\n", css_to_blkcg(css)->cfq_weight); | 1663 | seq_printf(sf, "%u\n", css_to_blkcg(seq_css(sf))->cfq_weight); |
1666 | return 0; | 1664 | return 0; |
1667 | } | 1665 | } |
1668 | 1666 | ||
1669 | static int cfq_print_leaf_weight(struct cgroup_subsys_state *css, | 1667 | static int cfq_print_leaf_weight(struct seq_file *sf, void *v) |
1670 | struct cftype *cft, struct seq_file *sf) | ||
1671 | { | 1668 | { |
1672 | seq_printf(sf, "%u\n", css_to_blkcg(css)->cfq_leaf_weight); | 1669 | seq_printf(sf, "%u\n", css_to_blkcg(seq_css(sf))->cfq_leaf_weight); |
1673 | return 0; | 1670 | return 0; |
1674 | } | 1671 | } |
1675 | 1672 | ||
@@ -1762,23 +1759,17 @@ static int cfq_set_leaf_weight(struct cgroup_subsys_state *css, | |||
1762 | return __cfq_set_weight(css, cft, val, true); | 1759 | return __cfq_set_weight(css, cft, val, true); |
1763 | } | 1760 | } |
1764 | 1761 | ||
1765 | static int cfqg_print_stat(struct cgroup_subsys_state *css, struct cftype *cft, | 1762 | static int cfqg_print_stat(struct seq_file *sf, void *v) |
1766 | struct seq_file *sf) | ||
1767 | { | 1763 | { |
1768 | struct blkcg *blkcg = css_to_blkcg(css); | 1764 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_stat, |
1769 | 1765 | &blkcg_policy_cfq, seq_cft(sf)->private, false); | |
1770 | blkcg_print_blkgs(sf, blkcg, blkg_prfill_stat, &blkcg_policy_cfq, | ||
1771 | cft->private, false); | ||
1772 | return 0; | 1766 | return 0; |
1773 | } | 1767 | } |
1774 | 1768 | ||
1775 | static int cfqg_print_rwstat(struct cgroup_subsys_state *css, | 1769 | static int cfqg_print_rwstat(struct seq_file *sf, void *v) |
1776 | struct cftype *cft, struct seq_file *sf) | ||
1777 | { | 1770 | { |
1778 | struct blkcg *blkcg = css_to_blkcg(css); | 1771 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_rwstat, |
1779 | 1772 | &blkcg_policy_cfq, seq_cft(sf)->private, true); | |
1780 | blkcg_print_blkgs(sf, blkcg, blkg_prfill_rwstat, &blkcg_policy_cfq, | ||
1781 | cft->private, true); | ||
1782 | return 0; | 1773 | return 0; |
1783 | } | 1774 | } |
1784 | 1775 | ||
@@ -1798,23 +1789,19 @@ static u64 cfqg_prfill_rwstat_recursive(struct seq_file *sf, | |||
1798 | return __blkg_prfill_rwstat(sf, pd, &sum); | 1789 | return __blkg_prfill_rwstat(sf, pd, &sum); |
1799 | } | 1790 | } |
1800 | 1791 | ||
1801 | static int cfqg_print_stat_recursive(struct cgroup_subsys_state *css, | 1792 | static int cfqg_print_stat_recursive(struct seq_file *sf, void *v) |
1802 | struct cftype *cft, struct seq_file *sf) | ||
1803 | { | 1793 | { |
1804 | struct blkcg *blkcg = css_to_blkcg(css); | 1794 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), |
1805 | 1795 | cfqg_prfill_stat_recursive, &blkcg_policy_cfq, | |
1806 | blkcg_print_blkgs(sf, blkcg, cfqg_prfill_stat_recursive, | 1796 | seq_cft(sf)->private, false); |
1807 | &blkcg_policy_cfq, cft->private, false); | ||
1808 | return 0; | 1797 | return 0; |
1809 | } | 1798 | } |
1810 | 1799 | ||
1811 | static int cfqg_print_rwstat_recursive(struct cgroup_subsys_state *css, | 1800 | static int cfqg_print_rwstat_recursive(struct seq_file *sf, void *v) |
1812 | struct cftype *cft, struct seq_file *sf) | ||
1813 | { | 1801 | { |
1814 | struct blkcg *blkcg = css_to_blkcg(css); | 1802 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), |
1815 | 1803 | cfqg_prfill_rwstat_recursive, &blkcg_policy_cfq, | |
1816 | blkcg_print_blkgs(sf, blkcg, cfqg_prfill_rwstat_recursive, | 1804 | seq_cft(sf)->private, true); |
1817 | &blkcg_policy_cfq, cft->private, true); | ||
1818 | return 0; | 1805 | return 0; |
1819 | } | 1806 | } |
1820 | 1807 | ||
@@ -1835,13 +1822,11 @@ static u64 cfqg_prfill_avg_queue_size(struct seq_file *sf, | |||
1835 | } | 1822 | } |
1836 | 1823 | ||
1837 | /* print avg_queue_size */ | 1824 | /* print avg_queue_size */ |
1838 | static int cfqg_print_avg_queue_size(struct cgroup_subsys_state *css, | 1825 | static int cfqg_print_avg_queue_size(struct seq_file *sf, void *v) |
1839 | struct cftype *cft, struct seq_file *sf) | ||
1840 | { | 1826 | { |
1841 | struct blkcg *blkcg = css_to_blkcg(css); | 1827 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), |
1842 | 1828 | cfqg_prfill_avg_queue_size, &blkcg_policy_cfq, | |
1843 | blkcg_print_blkgs(sf, blkcg, cfqg_prfill_avg_queue_size, | 1829 | 0, false); |
1844 | &blkcg_policy_cfq, 0, false); | ||
1845 | return 0; | 1830 | return 0; |
1846 | } | 1831 | } |
1847 | #endif /* CONFIG_DEBUG_BLK_CGROUP */ | 1832 | #endif /* CONFIG_DEBUG_BLK_CGROUP */ |
@@ -1851,14 +1836,14 @@ static struct cftype cfq_blkcg_files[] = { | |||
1851 | { | 1836 | { |
1852 | .name = "weight_device", | 1837 | .name = "weight_device", |
1853 | .flags = CFTYPE_ONLY_ON_ROOT, | 1838 | .flags = CFTYPE_ONLY_ON_ROOT, |
1854 | .read_seq_string = cfqg_print_leaf_weight_device, | 1839 | .seq_show = cfqg_print_leaf_weight_device, |
1855 | .write_string = cfqg_set_leaf_weight_device, | 1840 | .write_string = cfqg_set_leaf_weight_device, |
1856 | .max_write_len = 256, | 1841 | .max_write_len = 256, |
1857 | }, | 1842 | }, |
1858 | { | 1843 | { |
1859 | .name = "weight", | 1844 | .name = "weight", |
1860 | .flags = CFTYPE_ONLY_ON_ROOT, | 1845 | .flags = CFTYPE_ONLY_ON_ROOT, |
1861 | .read_seq_string = cfq_print_leaf_weight, | 1846 | .seq_show = cfq_print_leaf_weight, |
1862 | .write_u64 = cfq_set_leaf_weight, | 1847 | .write_u64 = cfq_set_leaf_weight, |
1863 | }, | 1848 | }, |
1864 | 1849 | ||
@@ -1866,26 +1851,26 @@ static struct cftype cfq_blkcg_files[] = { | |||
1866 | { | 1851 | { |
1867 | .name = "weight_device", | 1852 | .name = "weight_device", |
1868 | .flags = CFTYPE_NOT_ON_ROOT, | 1853 | .flags = CFTYPE_NOT_ON_ROOT, |
1869 | .read_seq_string = cfqg_print_weight_device, | 1854 | .seq_show = cfqg_print_weight_device, |
1870 | .write_string = cfqg_set_weight_device, | 1855 | .write_string = cfqg_set_weight_device, |
1871 | .max_write_len = 256, | 1856 | .max_write_len = 256, |
1872 | }, | 1857 | }, |
1873 | { | 1858 | { |
1874 | .name = "weight", | 1859 | .name = "weight", |
1875 | .flags = CFTYPE_NOT_ON_ROOT, | 1860 | .flags = CFTYPE_NOT_ON_ROOT, |
1876 | .read_seq_string = cfq_print_weight, | 1861 | .seq_show = cfq_print_weight, |
1877 | .write_u64 = cfq_set_weight, | 1862 | .write_u64 = cfq_set_weight, |
1878 | }, | 1863 | }, |
1879 | 1864 | ||
1880 | { | 1865 | { |
1881 | .name = "leaf_weight_device", | 1866 | .name = "leaf_weight_device", |
1882 | .read_seq_string = cfqg_print_leaf_weight_device, | 1867 | .seq_show = cfqg_print_leaf_weight_device, |
1883 | .write_string = cfqg_set_leaf_weight_device, | 1868 | .write_string = cfqg_set_leaf_weight_device, |
1884 | .max_write_len = 256, | 1869 | .max_write_len = 256, |
1885 | }, | 1870 | }, |
1886 | { | 1871 | { |
1887 | .name = "leaf_weight", | 1872 | .name = "leaf_weight", |
1888 | .read_seq_string = cfq_print_leaf_weight, | 1873 | .seq_show = cfq_print_leaf_weight, |
1889 | .write_u64 = cfq_set_leaf_weight, | 1874 | .write_u64 = cfq_set_leaf_weight, |
1890 | }, | 1875 | }, |
1891 | 1876 | ||
@@ -1893,114 +1878,114 @@ static struct cftype cfq_blkcg_files[] = { | |||
1893 | { | 1878 | { |
1894 | .name = "time", | 1879 | .name = "time", |
1895 | .private = offsetof(struct cfq_group, stats.time), | 1880 | .private = offsetof(struct cfq_group, stats.time), |
1896 | .read_seq_string = cfqg_print_stat, | 1881 | .seq_show = cfqg_print_stat, |
1897 | }, | 1882 | }, |
1898 | { | 1883 | { |
1899 | .name = "sectors", | 1884 | .name = "sectors", |
1900 | .private = offsetof(struct cfq_group, stats.sectors), | 1885 | .private = offsetof(struct cfq_group, stats.sectors), |
1901 | .read_seq_string = cfqg_print_stat, | 1886 | .seq_show = cfqg_print_stat, |
1902 | }, | 1887 | }, |
1903 | { | 1888 | { |
1904 | .name = "io_service_bytes", | 1889 | .name = "io_service_bytes", |
1905 | .private = offsetof(struct cfq_group, stats.service_bytes), | 1890 | .private = offsetof(struct cfq_group, stats.service_bytes), |
1906 | .read_seq_string = cfqg_print_rwstat, | 1891 | .seq_show = cfqg_print_rwstat, |
1907 | }, | 1892 | }, |
1908 | { | 1893 | { |
1909 | .name = "io_serviced", | 1894 | .name = "io_serviced", |
1910 | .private = offsetof(struct cfq_group, stats.serviced), | 1895 | .private = offsetof(struct cfq_group, stats.serviced), |
1911 | .read_seq_string = cfqg_print_rwstat, | 1896 | .seq_show = cfqg_print_rwstat, |
1912 | }, | 1897 | }, |
1913 | { | 1898 | { |
1914 | .name = "io_service_time", | 1899 | .name = "io_service_time", |
1915 | .private = offsetof(struct cfq_group, stats.service_time), | 1900 | .private = offsetof(struct cfq_group, stats.service_time), |
1916 | .read_seq_string = cfqg_print_rwstat, | 1901 | .seq_show = cfqg_print_rwstat, |
1917 | }, | 1902 | }, |
1918 | { | 1903 | { |
1919 | .name = "io_wait_time", | 1904 | .name = "io_wait_time", |
1920 | .private = offsetof(struct cfq_group, stats.wait_time), | 1905 | .private = offsetof(struct cfq_group, stats.wait_time), |
1921 | .read_seq_string = cfqg_print_rwstat, | 1906 | .seq_show = cfqg_print_rwstat, |
1922 | }, | 1907 | }, |
1923 | { | 1908 | { |
1924 | .name = "io_merged", | 1909 | .name = "io_merged", |
1925 | .private = offsetof(struct cfq_group, stats.merged), | 1910 | .private = offsetof(struct cfq_group, stats.merged), |
1926 | .read_seq_string = cfqg_print_rwstat, | 1911 | .seq_show = cfqg_print_rwstat, |
1927 | }, | 1912 | }, |
1928 | { | 1913 | { |
1929 | .name = "io_queued", | 1914 | .name = "io_queued", |
1930 | .private = offsetof(struct cfq_group, stats.queued), | 1915 | .private = offsetof(struct cfq_group, stats.queued), |
1931 | .read_seq_string = cfqg_print_rwstat, | 1916 | .seq_show = cfqg_print_rwstat, |
1932 | }, | 1917 | }, |
1933 | 1918 | ||
1934 | /* the same statictics which cover the cfqg and its descendants */ | 1919 | /* the same statictics which cover the cfqg and its descendants */ |
1935 | { | 1920 | { |
1936 | .name = "time_recursive", | 1921 | .name = "time_recursive", |
1937 | .private = offsetof(struct cfq_group, stats.time), | 1922 | .private = offsetof(struct cfq_group, stats.time), |
1938 | .read_seq_string = cfqg_print_stat_recursive, | 1923 | .seq_show = cfqg_print_stat_recursive, |
1939 | }, | 1924 | }, |
1940 | { | 1925 | { |
1941 | .name = "sectors_recursive", | 1926 | .name = "sectors_recursive", |
1942 | .private = offsetof(struct cfq_group, stats.sectors), | 1927 | .private = offsetof(struct cfq_group, stats.sectors), |
1943 | .read_seq_string = cfqg_print_stat_recursive, | 1928 | .seq_show = cfqg_print_stat_recursive, |
1944 | }, | 1929 | }, |
1945 | { | 1930 | { |
1946 | .name = "io_service_bytes_recursive", | 1931 | .name = "io_service_bytes_recursive", |
1947 | .private = offsetof(struct cfq_group, stats.service_bytes), | 1932 | .private = offsetof(struct cfq_group, stats.service_bytes), |
1948 | .read_seq_string = cfqg_print_rwstat_recursive, | 1933 | .seq_show = cfqg_print_rwstat_recursive, |
1949 | }, | 1934 | }, |
1950 | { | 1935 | { |
1951 | .name = "io_serviced_recursive", | 1936 | .name = "io_serviced_recursive", |
1952 | .private = offsetof(struct cfq_group, stats.serviced), | 1937 | .private = offsetof(struct cfq_group, stats.serviced), |
1953 | .read_seq_string = cfqg_print_rwstat_recursive, | 1938 | .seq_show = cfqg_print_rwstat_recursive, |
1954 | }, | 1939 | }, |
1955 | { | 1940 | { |
1956 | .name = "io_service_time_recursive", | 1941 | .name = "io_service_time_recursive", |
1957 | .private = offsetof(struct cfq_group, stats.service_time), | 1942 | .private = offsetof(struct cfq_group, stats.service_time), |
1958 | .read_seq_string = cfqg_print_rwstat_recursive, | 1943 | .seq_show = cfqg_print_rwstat_recursive, |
1959 | }, | 1944 | }, |
1960 | { | 1945 | { |
1961 | .name = "io_wait_time_recursive", | 1946 | .name = "io_wait_time_recursive", |
1962 | .private = offsetof(struct cfq_group, stats.wait_time), | 1947 | .private = offsetof(struct cfq_group, stats.wait_time), |
1963 | .read_seq_string = cfqg_print_rwstat_recursive, | 1948 | .seq_show = cfqg_print_rwstat_recursive, |
1964 | }, | 1949 | }, |
1965 | { | 1950 | { |
1966 | .name = "io_merged_recursive", | 1951 | .name = "io_merged_recursive", |
1967 | .private = offsetof(struct cfq_group, stats.merged), | 1952 | .private = offsetof(struct cfq_group, stats.merged), |
1968 | .read_seq_string = cfqg_print_rwstat_recursive, | 1953 | .seq_show = cfqg_print_rwstat_recursive, |
1969 | }, | 1954 | }, |
1970 | { | 1955 | { |
1971 | .name = "io_queued_recursive", | 1956 | .name = "io_queued_recursive", |
1972 | .private = offsetof(struct cfq_group, stats.queued), | 1957 | .private = offsetof(struct cfq_group, stats.queued), |
1973 | .read_seq_string = cfqg_print_rwstat_recursive, | 1958 | .seq_show = cfqg_print_rwstat_recursive, |
1974 | }, | 1959 | }, |
1975 | #ifdef CONFIG_DEBUG_BLK_CGROUP | 1960 | #ifdef CONFIG_DEBUG_BLK_CGROUP |
1976 | { | 1961 | { |
1977 | .name = "avg_queue_size", | 1962 | .name = "avg_queue_size", |
1978 | .read_seq_string = cfqg_print_avg_queue_size, | 1963 | .seq_show = cfqg_print_avg_queue_size, |
1979 | }, | 1964 | }, |
1980 | { | 1965 | { |
1981 | .name = "group_wait_time", | 1966 | .name = "group_wait_time", |
1982 | .private = offsetof(struct cfq_group, stats.group_wait_time), | 1967 | .private = offsetof(struct cfq_group, stats.group_wait_time), |
1983 | .read_seq_string = cfqg_print_stat, | 1968 | .seq_show = cfqg_print_stat, |
1984 | }, | 1969 | }, |
1985 | { | 1970 | { |
1986 | .name = "idle_time", | 1971 | .name = "idle_time", |
1987 | .private = offsetof(struct cfq_group, stats.idle_time), | 1972 | .private = offsetof(struct cfq_group, stats.idle_time), |
1988 | .read_seq_string = cfqg_print_stat, | 1973 | .seq_show = cfqg_print_stat, |
1989 | }, | 1974 | }, |
1990 | { | 1975 | { |
1991 | .name = "empty_time", | 1976 | .name = "empty_time", |
1992 | .private = offsetof(struct cfq_group, stats.empty_time), | 1977 | .private = offsetof(struct cfq_group, stats.empty_time), |
1993 | .read_seq_string = cfqg_print_stat, | 1978 | .seq_show = cfqg_print_stat, |
1994 | }, | 1979 | }, |
1995 | { | 1980 | { |
1996 | .name = "dequeue", | 1981 | .name = "dequeue", |
1997 | .private = offsetof(struct cfq_group, stats.dequeue), | 1982 | .private = offsetof(struct cfq_group, stats.dequeue), |
1998 | .read_seq_string = cfqg_print_stat, | 1983 | .seq_show = cfqg_print_stat, |
1999 | }, | 1984 | }, |
2000 | { | 1985 | { |
2001 | .name = "unaccounted_time", | 1986 | .name = "unaccounted_time", |
2002 | .private = offsetof(struct cfq_group, stats.unaccounted_time), | 1987 | .private = offsetof(struct cfq_group, stats.unaccounted_time), |
2003 | .read_seq_string = cfqg_print_stat, | 1988 | .seq_show = cfqg_print_stat, |
2004 | }, | 1989 | }, |
2005 | #endif /* CONFIG_DEBUG_BLK_CGROUP */ | 1990 | #endif /* CONFIG_DEBUG_BLK_CGROUP */ |
2006 | { } /* terminate */ | 1991 | { } /* terminate */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c3d698a72e02..b32a0f8ae9ad 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -444,12 +444,9 @@ struct cftype { | |||
444 | * read_s64() is a signed version of read_u64() | 444 | * read_s64() is a signed version of read_u64() |
445 | */ | 445 | */ |
446 | s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); | 446 | s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); |
447 | /* | 447 | |
448 | * read_seq_string() is used for outputting a simple sequence | 448 | /* generic seq_file read interface */ |
449 | * using seqfile. | 449 | int (*seq_show)(struct seq_file *sf, void *v); |
450 | */ | ||
451 | int (*read_seq_string)(struct cgroup_subsys_state *css, | ||
452 | struct cftype *cft, struct seq_file *m); | ||
453 | 450 | ||
454 | /* | 451 | /* |
455 | * write_u64() is a shortcut for the common case of accepting | 452 | * write_u64() is a shortcut for the common case of accepting |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 036c05d8e572..c45e63328a0a 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -2212,10 +2212,9 @@ static int cgroup_release_agent_write(struct cgroup_subsys_state *css, | |||
2212 | return 0; | 2212 | return 0; |
2213 | } | 2213 | } |
2214 | 2214 | ||
2215 | static int cgroup_release_agent_show(struct cgroup_subsys_state *css, | 2215 | static int cgroup_release_agent_show(struct seq_file *seq, void *v) |
2216 | struct cftype *cft, struct seq_file *seq) | ||
2217 | { | 2216 | { |
2218 | struct cgroup *cgrp = css->cgroup; | 2217 | struct cgroup *cgrp = seq_css(seq)->cgroup; |
2219 | 2218 | ||
2220 | if (!cgroup_lock_live_group(cgrp)) | 2219 | if (!cgroup_lock_live_group(cgrp)) |
2221 | return -ENODEV; | 2220 | return -ENODEV; |
@@ -2225,10 +2224,11 @@ static int cgroup_release_agent_show(struct cgroup_subsys_state *css, | |||
2225 | return 0; | 2224 | return 0; |
2226 | } | 2225 | } |
2227 | 2226 | ||
2228 | static int cgroup_sane_behavior_show(struct cgroup_subsys_state *css, | 2227 | static int cgroup_sane_behavior_show(struct seq_file *seq, void *v) |
2229 | struct cftype *cft, struct seq_file *seq) | ||
2230 | { | 2228 | { |
2231 | seq_printf(seq, "%d\n", cgroup_sane_behavior(css->cgroup)); | 2229 | struct cgroup *cgrp = seq_css(seq)->cgroup; |
2230 | |||
2231 | seq_printf(seq, "%d\n", cgroup_sane_behavior(cgrp)); | ||
2232 | return 0; | 2232 | return 0; |
2233 | } | 2233 | } |
2234 | 2234 | ||
@@ -2291,8 +2291,8 @@ static int cgroup_seqfile_show(struct seq_file *m, void *arg) | |||
2291 | struct cftype *cft = seq_cft(m); | 2291 | struct cftype *cft = seq_cft(m); |
2292 | struct cgroup_subsys_state *css = seq_css(m); | 2292 | struct cgroup_subsys_state *css = seq_css(m); |
2293 | 2293 | ||
2294 | if (cft->read_seq_string) | 2294 | if (cft->seq_show) |
2295 | return cft->read_seq_string(css, cft, m); | 2295 | return cft->seq_show(m, arg); |
2296 | 2296 | ||
2297 | if (cft->read_u64) | 2297 | if (cft->read_u64) |
2298 | seq_printf(m, "%llu\n", cft->read_u64(css, cft)); | 2298 | seq_printf(m, "%llu\n", cft->read_u64(css, cft)); |
@@ -2559,7 +2559,7 @@ static umode_t cgroup_file_mode(const struct cftype *cft) | |||
2559 | if (cft->mode) | 2559 | if (cft->mode) |
2560 | return cft->mode; | 2560 | return cft->mode; |
2561 | 2561 | ||
2562 | if (cft->read_u64 || cft->read_s64 || cft->read_seq_string) | 2562 | if (cft->read_u64 || cft->read_s64 || cft->seq_show) |
2563 | mode |= S_IRUGO; | 2563 | mode |= S_IRUGO; |
2564 | 2564 | ||
2565 | if (cft->write_u64 || cft->write_s64 || cft->write_string || | 2565 | if (cft->write_u64 || cft->write_s64 || cft->write_string || |
@@ -3874,7 +3874,7 @@ static struct cftype cgroup_base_files[] = { | |||
3874 | { | 3874 | { |
3875 | .name = "cgroup.sane_behavior", | 3875 | .name = "cgroup.sane_behavior", |
3876 | .flags = CFTYPE_ONLY_ON_ROOT, | 3876 | .flags = CFTYPE_ONLY_ON_ROOT, |
3877 | .read_seq_string = cgroup_sane_behavior_show, | 3877 | .seq_show = cgroup_sane_behavior_show, |
3878 | }, | 3878 | }, |
3879 | 3879 | ||
3880 | /* | 3880 | /* |
@@ -3899,7 +3899,7 @@ static struct cftype cgroup_base_files[] = { | |||
3899 | { | 3899 | { |
3900 | .name = "release_agent", | 3900 | .name = "release_agent", |
3901 | .flags = CFTYPE_INSANE | CFTYPE_ONLY_ON_ROOT, | 3901 | .flags = CFTYPE_INSANE | CFTYPE_ONLY_ON_ROOT, |
3902 | .read_seq_string = cgroup_release_agent_show, | 3902 | .seq_show = cgroup_release_agent_show, |
3903 | .write_string = cgroup_release_agent_write, | 3903 | .write_string = cgroup_release_agent_write, |
3904 | .max_write_len = PATH_MAX, | 3904 | .max_write_len = PATH_MAX, |
3905 | }, | 3905 | }, |
@@ -5274,9 +5274,7 @@ static u64 current_css_set_refcount_read(struct cgroup_subsys_state *css, | |||
5274 | return count; | 5274 | return count; |
5275 | } | 5275 | } |
5276 | 5276 | ||
5277 | static int current_css_set_cg_links_read(struct cgroup_subsys_state *css, | 5277 | static int current_css_set_cg_links_read(struct seq_file *seq, void *v) |
5278 | struct cftype *cft, | ||
5279 | struct seq_file *seq) | ||
5280 | { | 5278 | { |
5281 | struct cgrp_cset_link *link; | 5279 | struct cgrp_cset_link *link; |
5282 | struct css_set *cset; | 5280 | struct css_set *cset; |
@@ -5301,9 +5299,9 @@ static int current_css_set_cg_links_read(struct cgroup_subsys_state *css, | |||
5301 | } | 5299 | } |
5302 | 5300 | ||
5303 | #define MAX_TASKS_SHOWN_PER_CSS 25 | 5301 | #define MAX_TASKS_SHOWN_PER_CSS 25 |
5304 | static int cgroup_css_links_read(struct cgroup_subsys_state *css, | 5302 | static int cgroup_css_links_read(struct seq_file *seq, void *v) |
5305 | struct cftype *cft, struct seq_file *seq) | ||
5306 | { | 5303 | { |
5304 | struct cgroup_subsys_state *css = seq_css(seq); | ||
5307 | struct cgrp_cset_link *link; | 5305 | struct cgrp_cset_link *link; |
5308 | 5306 | ||
5309 | read_lock(&css_set_lock); | 5307 | read_lock(&css_set_lock); |
@@ -5349,12 +5347,12 @@ static struct cftype debug_files[] = { | |||
5349 | 5347 | ||
5350 | { | 5348 | { |
5351 | .name = "current_css_set_cg_links", | 5349 | .name = "current_css_set_cg_links", |
5352 | .read_seq_string = current_css_set_cg_links_read, | 5350 | .seq_show = current_css_set_cg_links_read, |
5353 | }, | 5351 | }, |
5354 | 5352 | ||
5355 | { | 5353 | { |
5356 | .name = "cgroup_css_links", | 5354 | .name = "cgroup_css_links", |
5357 | .read_seq_string = cgroup_css_links_read, | 5355 | .seq_show = cgroup_css_links_read, |
5358 | }, | 5356 | }, |
5359 | 5357 | ||
5360 | { | 5358 | { |
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index f0ff64d0ebaa..6c3154e477f6 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c | |||
@@ -301,10 +301,9 @@ out_unlock: | |||
301 | spin_unlock_irq(&freezer->lock); | 301 | spin_unlock_irq(&freezer->lock); |
302 | } | 302 | } |
303 | 303 | ||
304 | static int freezer_read(struct cgroup_subsys_state *css, struct cftype *cft, | 304 | static int freezer_read(struct seq_file *m, void *v) |
305 | struct seq_file *m) | ||
306 | { | 305 | { |
307 | struct cgroup_subsys_state *pos; | 306 | struct cgroup_subsys_state *css = seq_css(m), *pos; |
308 | 307 | ||
309 | rcu_read_lock(); | 308 | rcu_read_lock(); |
310 | 309 | ||
@@ -458,7 +457,7 @@ static struct cftype files[] = { | |||
458 | { | 457 | { |
459 | .name = "state", | 458 | .name = "state", |
460 | .flags = CFTYPE_NOT_ON_ROOT, | 459 | .flags = CFTYPE_NOT_ON_ROOT, |
461 | .read_seq_string = freezer_read, | 460 | .seq_show = freezer_read, |
462 | .write_string = freezer_write, | 461 | .write_string = freezer_write, |
463 | }, | 462 | }, |
464 | { | 463 | { |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 032929f91648..4410ac6a55f1 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1732,12 +1732,10 @@ out_unlock: | |||
1732 | * and since these maps can change value dynamically, one could read | 1732 | * and since these maps can change value dynamically, one could read |
1733 | * gibberish by doing partial reads while a list was changing. | 1733 | * gibberish by doing partial reads while a list was changing. |
1734 | */ | 1734 | */ |
1735 | static int cpuset_common_read_seq_string(struct cgroup_subsys_state *css, | 1735 | static int cpuset_common_seq_show(struct seq_file *sf, void *v) |
1736 | struct cftype *cft, | ||
1737 | struct seq_file *sf) | ||
1738 | { | 1736 | { |
1739 | struct cpuset *cs = css_cs(css); | 1737 | struct cpuset *cs = css_cs(seq_css(sf)); |
1740 | cpuset_filetype_t type = cft->private; | 1738 | cpuset_filetype_t type = seq_cft(sf)->private; |
1741 | ssize_t count; | 1739 | ssize_t count; |
1742 | char *buf, *s; | 1740 | char *buf, *s; |
1743 | int ret = 0; | 1741 | int ret = 0; |
@@ -1824,7 +1822,7 @@ static s64 cpuset_read_s64(struct cgroup_subsys_state *css, struct cftype *cft) | |||
1824 | static struct cftype files[] = { | 1822 | static struct cftype files[] = { |
1825 | { | 1823 | { |
1826 | .name = "cpus", | 1824 | .name = "cpus", |
1827 | .read_seq_string = cpuset_common_read_seq_string, | 1825 | .seq_show = cpuset_common_seq_show, |
1828 | .write_string = cpuset_write_resmask, | 1826 | .write_string = cpuset_write_resmask, |
1829 | .max_write_len = (100U + 6 * NR_CPUS), | 1827 | .max_write_len = (100U + 6 * NR_CPUS), |
1830 | .private = FILE_CPULIST, | 1828 | .private = FILE_CPULIST, |
@@ -1832,7 +1830,7 @@ static struct cftype files[] = { | |||
1832 | 1830 | ||
1833 | { | 1831 | { |
1834 | .name = "mems", | 1832 | .name = "mems", |
1835 | .read_seq_string = cpuset_common_read_seq_string, | 1833 | .seq_show = cpuset_common_seq_show, |
1836 | .write_string = cpuset_write_resmask, | 1834 | .write_string = cpuset_write_resmask, |
1837 | .max_write_len = (100U + 6 * MAX_NUMNODES), | 1835 | .max_write_len = (100U + 6 * MAX_NUMNODES), |
1838 | .private = FILE_MEMLIST, | 1836 | .private = FILE_MEMLIST, |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f28ec6722f0b..7e8cbb9ee4d6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -7256,10 +7256,9 @@ static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota) | |||
7256 | return ret; | 7256 | return ret; |
7257 | } | 7257 | } |
7258 | 7258 | ||
7259 | static int cpu_stats_show(struct cgroup_subsys_state *css, struct cftype *cft, | 7259 | static int cpu_stats_show(struct seq_file *sf, void *v) |
7260 | struct seq_file *sf) | ||
7261 | { | 7260 | { |
7262 | struct task_group *tg = css_tg(css); | 7261 | struct task_group *tg = css_tg(seq_css(sf)); |
7263 | struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; | 7262 | struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; |
7264 | 7263 | ||
7265 | seq_printf(sf, "nr_periods %d\n", cfs_b->nr_periods); | 7264 | seq_printf(sf, "nr_periods %d\n", cfs_b->nr_periods); |
@@ -7318,7 +7317,7 @@ static struct cftype cpu_files[] = { | |||
7318 | }, | 7317 | }, |
7319 | { | 7318 | { |
7320 | .name = "stat", | 7319 | .name = "stat", |
7321 | .read_seq_string = cpu_stats_show, | 7320 | .seq_show = cpu_stats_show, |
7322 | }, | 7321 | }, |
7323 | #endif | 7322 | #endif |
7324 | #ifdef CONFIG_RT_GROUP_SCHED | 7323 | #ifdef CONFIG_RT_GROUP_SCHED |
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index dd88738cd4a9..622e0818f905 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c | |||
@@ -163,10 +163,9 @@ out: | |||
163 | return err; | 163 | return err; |
164 | } | 164 | } |
165 | 165 | ||
166 | static int cpuacct_percpu_seq_read(struct cgroup_subsys_state *css, | 166 | static int cpuacct_percpu_seq_show(struct seq_file *m, void *V) |
167 | struct cftype *cft, struct seq_file *m) | ||
168 | { | 167 | { |
169 | struct cpuacct *ca = css_ca(css); | 168 | struct cpuacct *ca = css_ca(seq_css(m)); |
170 | u64 percpu; | 169 | u64 percpu; |
171 | int i; | 170 | int i; |
172 | 171 | ||
@@ -183,10 +182,9 @@ static const char * const cpuacct_stat_desc[] = { | |||
183 | [CPUACCT_STAT_SYSTEM] = "system", | 182 | [CPUACCT_STAT_SYSTEM] = "system", |
184 | }; | 183 | }; |
185 | 184 | ||
186 | static int cpuacct_stats_show(struct cgroup_subsys_state *css, | 185 | static int cpuacct_stats_show(struct seq_file *sf, void *v) |
187 | struct cftype *cft, struct seq_file *sf) | ||
188 | { | 186 | { |
189 | struct cpuacct *ca = css_ca(css); | 187 | struct cpuacct *ca = css_ca(seq_css(sf)); |
190 | int cpu; | 188 | int cpu; |
191 | s64 val = 0; | 189 | s64 val = 0; |
192 | 190 | ||
@@ -220,11 +218,11 @@ static struct cftype files[] = { | |||
220 | }, | 218 | }, |
221 | { | 219 | { |
222 | .name = "usage_percpu", | 220 | .name = "usage_percpu", |
223 | .read_seq_string = cpuacct_percpu_seq_read, | 221 | .seq_show = cpuacct_percpu_seq_show, |
224 | }, | 222 | }, |
225 | { | 223 | { |
226 | .name = "stat", | 224 | .name = "stat", |
227 | .read_seq_string = cpuacct_stats_show, | 225 | .seq_show = cpuacct_stats_show, |
228 | }, | 226 | }, |
229 | { } /* terminate */ | 227 | { } /* terminate */ |
230 | }; | 228 | }; |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f149521a77e6..9252219376cc 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -3014,10 +3014,9 @@ static struct kmem_cache *memcg_params_to_cache(struct memcg_cache_params *p) | |||
3014 | } | 3014 | } |
3015 | 3015 | ||
3016 | #ifdef CONFIG_SLABINFO | 3016 | #ifdef CONFIG_SLABINFO |
3017 | static int mem_cgroup_slabinfo_read(struct cgroup_subsys_state *css, | 3017 | static int mem_cgroup_slabinfo_read(struct seq_file *m, void *v) |
3018 | struct cftype *cft, struct seq_file *m) | ||
3019 | { | 3018 | { |
3020 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); | 3019 | struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); |
3021 | struct memcg_cache_params *params; | 3020 | struct memcg_cache_params *params; |
3022 | 3021 | ||
3023 | if (!memcg_can_account_kmem(memcg)) | 3022 | if (!memcg_can_account_kmem(memcg)) |
@@ -5418,8 +5417,7 @@ static int mem_cgroup_move_charge_write(struct cgroup_subsys_state *css, | |||
5418 | #endif | 5417 | #endif |
5419 | 5418 | ||
5420 | #ifdef CONFIG_NUMA | 5419 | #ifdef CONFIG_NUMA |
5421 | static int memcg_numa_stat_show(struct cgroup_subsys_state *css, | 5420 | static int memcg_numa_stat_show(struct seq_file *m, void *v) |
5422 | struct cftype *cft, struct seq_file *m) | ||
5423 | { | 5421 | { |
5424 | struct numa_stat { | 5422 | struct numa_stat { |
5425 | const char *name; | 5423 | const char *name; |
@@ -5435,7 +5433,7 @@ static int memcg_numa_stat_show(struct cgroup_subsys_state *css, | |||
5435 | const struct numa_stat *stat; | 5433 | const struct numa_stat *stat; |
5436 | int nid; | 5434 | int nid; |
5437 | unsigned long nr; | 5435 | unsigned long nr; |
5438 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); | 5436 | struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); |
5439 | 5437 | ||
5440 | for (stat = stats; stat < stats + ARRAY_SIZE(stats); stat++) { | 5438 | for (stat = stats; stat < stats + ARRAY_SIZE(stats); stat++) { |
5441 | nr = mem_cgroup_nr_lru_pages(memcg, stat->lru_mask); | 5439 | nr = mem_cgroup_nr_lru_pages(memcg, stat->lru_mask); |
@@ -5474,10 +5472,9 @@ static inline void mem_cgroup_lru_names_not_uptodate(void) | |||
5474 | BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS); | 5472 | BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS); |
5475 | } | 5473 | } |
5476 | 5474 | ||
5477 | static int memcg_stat_show(struct cgroup_subsys_state *css, struct cftype *cft, | 5475 | static int memcg_stat_show(struct seq_file *m, void *v) |
5478 | struct seq_file *m) | ||
5479 | { | 5476 | { |
5480 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); | 5477 | struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); |
5481 | struct mem_cgroup *mi; | 5478 | struct mem_cgroup *mi; |
5482 | unsigned int i; | 5479 | unsigned int i; |
5483 | 5480 | ||
@@ -5907,10 +5904,9 @@ static void mem_cgroup_oom_unregister_event(struct mem_cgroup *memcg, | |||
5907 | spin_unlock(&memcg_oom_lock); | 5904 | spin_unlock(&memcg_oom_lock); |
5908 | } | 5905 | } |
5909 | 5906 | ||
5910 | static int mem_cgroup_oom_control_read(struct cgroup_subsys_state *css, | 5907 | static int mem_cgroup_oom_control_read(struct seq_file *sf, void *v) |
5911 | struct cftype *cft, struct seq_file *sf) | ||
5912 | { | 5908 | { |
5913 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); | 5909 | struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(sf)); |
5914 | 5910 | ||
5915 | seq_printf(sf, "oom_kill_disable %d\n", memcg->oom_kill_disable); | 5911 | seq_printf(sf, "oom_kill_disable %d\n", memcg->oom_kill_disable); |
5916 | seq_printf(sf, "under_oom %d\n", (bool)atomic_read(&memcg->under_oom)); | 5912 | seq_printf(sf, "under_oom %d\n", (bool)atomic_read(&memcg->under_oom)); |
@@ -6260,7 +6256,7 @@ static struct cftype mem_cgroup_files[] = { | |||
6260 | }, | 6256 | }, |
6261 | { | 6257 | { |
6262 | .name = "stat", | 6258 | .name = "stat", |
6263 | .read_seq_string = memcg_stat_show, | 6259 | .seq_show = memcg_stat_show, |
6264 | }, | 6260 | }, |
6265 | { | 6261 | { |
6266 | .name = "force_empty", | 6262 | .name = "force_empty", |
@@ -6290,7 +6286,7 @@ static struct cftype mem_cgroup_files[] = { | |||
6290 | }, | 6286 | }, |
6291 | { | 6287 | { |
6292 | .name = "oom_control", | 6288 | .name = "oom_control", |
6293 | .read_seq_string = mem_cgroup_oom_control_read, | 6289 | .seq_show = mem_cgroup_oom_control_read, |
6294 | .write_u64 = mem_cgroup_oom_control_write, | 6290 | .write_u64 = mem_cgroup_oom_control_write, |
6295 | .private = MEMFILE_PRIVATE(_OOM_TYPE, OOM_CONTROL), | 6291 | .private = MEMFILE_PRIVATE(_OOM_TYPE, OOM_CONTROL), |
6296 | }, | 6292 | }, |
@@ -6300,7 +6296,7 @@ static struct cftype mem_cgroup_files[] = { | |||
6300 | #ifdef CONFIG_NUMA | 6296 | #ifdef CONFIG_NUMA |
6301 | { | 6297 | { |
6302 | .name = "numa_stat", | 6298 | .name = "numa_stat", |
6303 | .read_seq_string = memcg_numa_stat_show, | 6299 | .seq_show = memcg_numa_stat_show, |
6304 | }, | 6300 | }, |
6305 | #endif | 6301 | #endif |
6306 | #ifdef CONFIG_MEMCG_KMEM | 6302 | #ifdef CONFIG_MEMCG_KMEM |
@@ -6330,7 +6326,7 @@ static struct cftype mem_cgroup_files[] = { | |||
6330 | #ifdef CONFIG_SLABINFO | 6326 | #ifdef CONFIG_SLABINFO |
6331 | { | 6327 | { |
6332 | .name = "kmem.slabinfo", | 6328 | .name = "kmem.slabinfo", |
6333 | .read_seq_string = mem_cgroup_slabinfo_read, | 6329 | .seq_show = mem_cgroup_slabinfo_read, |
6334 | }, | 6330 | }, |
6335 | #endif | 6331 | #endif |
6336 | #endif | 6332 | #endif |
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 498710dce4a5..56cbb69ba024 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c | |||
@@ -173,14 +173,14 @@ static u64 read_prioidx(struct cgroup_subsys_state *css, struct cftype *cft) | |||
173 | return css->cgroup->id; | 173 | return css->cgroup->id; |
174 | } | 174 | } |
175 | 175 | ||
176 | static int read_priomap(struct cgroup_subsys_state *css, struct cftype *cft, | 176 | static int read_priomap(struct seq_file *sf, void *v) |
177 | struct seq_file *sf) | ||
178 | { | 177 | { |
179 | struct net_device *dev; | 178 | struct net_device *dev; |
180 | 179 | ||
181 | rcu_read_lock(); | 180 | rcu_read_lock(); |
182 | for_each_netdev_rcu(&init_net, dev) | 181 | for_each_netdev_rcu(&init_net, dev) |
183 | seq_printf(sf, "%s %u\n", dev->name, netprio_prio(css, dev)); | 182 | seq_printf(sf, "%s %u\n", dev->name, |
183 | netprio_prio(seq_css(sf), dev)); | ||
184 | rcu_read_unlock(); | 184 | rcu_read_unlock(); |
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
@@ -238,7 +238,7 @@ static struct cftype ss_files[] = { | |||
238 | }, | 238 | }, |
239 | { | 239 | { |
240 | .name = "ifpriomap", | 240 | .name = "ifpriomap", |
241 | .read_seq_string = read_priomap, | 241 | .seq_show = read_priomap, |
242 | .write_string = write_priomap, | 242 | .write_string = write_priomap, |
243 | }, | 243 | }, |
244 | { } /* terminate */ | 244 | { } /* terminate */ |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 7c2a0a71049e..d3b6d2cd3a06 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -274,10 +274,9 @@ static void set_majmin(char *str, unsigned m) | |||
274 | sprintf(str, "%u", m); | 274 | sprintf(str, "%u", m); |
275 | } | 275 | } |
276 | 276 | ||
277 | static int devcgroup_seq_read(struct cgroup_subsys_state *css, | 277 | static int devcgroup_seq_show(struct seq_file *m, void *v) |
278 | struct cftype *cft, struct seq_file *m) | ||
279 | { | 278 | { |
280 | struct dev_cgroup *devcgroup = css_to_devcgroup(css); | 279 | struct dev_cgroup *devcgroup = css_to_devcgroup(seq_css(m)); |
281 | struct dev_exception_item *ex; | 280 | struct dev_exception_item *ex; |
282 | char maj[MAJMINLEN], min[MAJMINLEN], acc[ACCLEN]; | 281 | char maj[MAJMINLEN], min[MAJMINLEN], acc[ACCLEN]; |
283 | 282 | ||
@@ -679,7 +678,7 @@ static struct cftype dev_cgroup_files[] = { | |||
679 | }, | 678 | }, |
680 | { | 679 | { |
681 | .name = "list", | 680 | .name = "list", |
682 | .read_seq_string = devcgroup_seq_read, | 681 | .seq_show = devcgroup_seq_show, |
683 | .private = DEVCG_LIST, | 682 | .private = DEVCG_LIST, |
684 | }, | 683 | }, |
685 | { } /* terminate */ | 684 | { } /* terminate */ |