diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/bio.c | 2 | ||||
-rw-r--r-- | block/blk-cgroup.c | 2 | ||||
-rw-r--r-- | block/blk-cgroup.h | 2 | ||||
-rw-r--r-- | block/blk-throttle.c | 32 | ||||
-rw-r--r-- | block/cfq-iosched.c | 28 |
5 files changed, 33 insertions, 33 deletions
diff --git a/block/bio.c b/block/bio.c index 96d28eee8a1e..1ba33657160f 100644 --- a/block/bio.c +++ b/block/bio.c | |||
@@ -1971,7 +1971,7 @@ int bio_associate_current(struct bio *bio) | |||
1971 | /* associate blkcg if exists */ | 1971 | /* associate blkcg if exists */ |
1972 | rcu_read_lock(); | 1972 | rcu_read_lock(); |
1973 | css = task_css(current, blkio_cgrp_id); | 1973 | css = task_css(current, blkio_cgrp_id); |
1974 | if (css && css_tryget(css)) | 1974 | if (css && css_tryget_online(css)) |
1975 | bio->bi_css = css; | 1975 | bio->bi_css = css; |
1976 | rcu_read_unlock(); | 1976 | rcu_read_unlock(); |
1977 | 1977 | ||
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 1039fb9ff5f5..9f5bce33e6fe 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -185,7 +185,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, | |||
185 | lockdep_assert_held(q->queue_lock); | 185 | lockdep_assert_held(q->queue_lock); |
186 | 186 | ||
187 | /* blkg holds a reference to blkcg */ | 187 | /* blkg holds a reference to blkcg */ |
188 | if (!css_tryget(&blkcg->css)) { | 188 | if (!css_tryget_online(&blkcg->css)) { |
189 | ret = -EINVAL; | 189 | ret = -EINVAL; |
190 | goto err_free_blkg; | 190 | goto err_free_blkg; |
191 | } | 191 | } |
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 371fe8e92ab5..d692b29c083a 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -204,7 +204,7 @@ static inline struct blkcg *bio_blkcg(struct bio *bio) | |||
204 | */ | 204 | */ |
205 | static inline struct blkcg *blkcg_parent(struct blkcg *blkcg) | 205 | static inline struct blkcg *blkcg_parent(struct blkcg *blkcg) |
206 | { | 206 | { |
207 | return css_to_blkcg(css_parent(&blkcg->css)); | 207 | return css_to_blkcg(blkcg->css.parent); |
208 | } | 208 | } |
209 | 209 | ||
210 | /** | 210 | /** |
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 9353b4683359..3fdb21a390c1 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -1346,10 +1346,10 @@ static int tg_print_conf_uint(struct seq_file *sf, void *v) | |||
1346 | return 0; | 1346 | return 0; |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | static int tg_set_conf(struct cgroup_subsys_state *css, struct cftype *cft, | 1349 | static ssize_t tg_set_conf(struct kernfs_open_file *of, |
1350 | const char *buf, bool is_u64) | 1350 | char *buf, size_t nbytes, loff_t off, bool is_u64) |
1351 | { | 1351 | { |
1352 | struct blkcg *blkcg = css_to_blkcg(css); | 1352 | struct blkcg *blkcg = css_to_blkcg(of_css(of)); |
1353 | struct blkg_conf_ctx ctx; | 1353 | struct blkg_conf_ctx ctx; |
1354 | struct throtl_grp *tg; | 1354 | struct throtl_grp *tg; |
1355 | struct throtl_service_queue *sq; | 1355 | struct throtl_service_queue *sq; |
@@ -1368,9 +1368,9 @@ static int tg_set_conf(struct cgroup_subsys_state *css, struct cftype *cft, | |||
1368 | ctx.v = -1; | 1368 | ctx.v = -1; |
1369 | 1369 | ||
1370 | if (is_u64) | 1370 | if (is_u64) |
1371 | *(u64 *)((void *)tg + cft->private) = ctx.v; | 1371 | *(u64 *)((void *)tg + of_cft(of)->private) = ctx.v; |
1372 | else | 1372 | else |
1373 | *(unsigned int *)((void *)tg + cft->private) = ctx.v; | 1373 | *(unsigned int *)((void *)tg + of_cft(of)->private) = ctx.v; |
1374 | 1374 | ||
1375 | throtl_log(&tg->service_queue, | 1375 | throtl_log(&tg->service_queue, |
1376 | "limit change rbps=%llu wbps=%llu riops=%u wiops=%u", | 1376 | "limit change rbps=%llu wbps=%llu riops=%u wiops=%u", |
@@ -1404,19 +1404,19 @@ static int tg_set_conf(struct cgroup_subsys_state *css, struct cftype *cft, | |||
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | blkg_conf_finish(&ctx); | 1406 | blkg_conf_finish(&ctx); |
1407 | return 0; | 1407 | return nbytes; |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | static int tg_set_conf_u64(struct cgroup_subsys_state *css, struct cftype *cft, | 1410 | static ssize_t tg_set_conf_u64(struct kernfs_open_file *of, |
1411 | char *buf) | 1411 | char *buf, size_t nbytes, loff_t off) |
1412 | { | 1412 | { |
1413 | return tg_set_conf(css, cft, buf, true); | 1413 | return tg_set_conf(of, buf, nbytes, off, true); |
1414 | } | 1414 | } |
1415 | 1415 | ||
1416 | static int tg_set_conf_uint(struct cgroup_subsys_state *css, struct cftype *cft, | 1416 | static ssize_t tg_set_conf_uint(struct kernfs_open_file *of, |
1417 | char *buf) | 1417 | char *buf, size_t nbytes, loff_t off) |
1418 | { | 1418 | { |
1419 | return tg_set_conf(css, cft, buf, false); | 1419 | return tg_set_conf(of, buf, nbytes, off, false); |
1420 | } | 1420 | } |
1421 | 1421 | ||
1422 | static struct cftype throtl_files[] = { | 1422 | static struct cftype throtl_files[] = { |
@@ -1424,25 +1424,25 @@ static struct cftype throtl_files[] = { | |||
1424 | .name = "throttle.read_bps_device", | 1424 | .name = "throttle.read_bps_device", |
1425 | .private = offsetof(struct throtl_grp, bps[READ]), | 1425 | .private = offsetof(struct throtl_grp, bps[READ]), |
1426 | .seq_show = tg_print_conf_u64, | 1426 | .seq_show = tg_print_conf_u64, |
1427 | .write_string = tg_set_conf_u64, | 1427 | .write = tg_set_conf_u64, |
1428 | }, | 1428 | }, |
1429 | { | 1429 | { |
1430 | .name = "throttle.write_bps_device", | 1430 | .name = "throttle.write_bps_device", |
1431 | .private = offsetof(struct throtl_grp, bps[WRITE]), | 1431 | .private = offsetof(struct throtl_grp, bps[WRITE]), |
1432 | .seq_show = tg_print_conf_u64, | 1432 | .seq_show = tg_print_conf_u64, |
1433 | .write_string = tg_set_conf_u64, | 1433 | .write = tg_set_conf_u64, |
1434 | }, | 1434 | }, |
1435 | { | 1435 | { |
1436 | .name = "throttle.read_iops_device", | 1436 | .name = "throttle.read_iops_device", |
1437 | .private = offsetof(struct throtl_grp, iops[READ]), | 1437 | .private = offsetof(struct throtl_grp, iops[READ]), |
1438 | .seq_show = tg_print_conf_uint, | 1438 | .seq_show = tg_print_conf_uint, |
1439 | .write_string = tg_set_conf_uint, | 1439 | .write = tg_set_conf_uint, |
1440 | }, | 1440 | }, |
1441 | { | 1441 | { |
1442 | .name = "throttle.write_iops_device", | 1442 | .name = "throttle.write_iops_device", |
1443 | .private = offsetof(struct throtl_grp, iops[WRITE]), | 1443 | .private = offsetof(struct throtl_grp, iops[WRITE]), |
1444 | .seq_show = tg_print_conf_uint, | 1444 | .seq_show = tg_print_conf_uint, |
1445 | .write_string = tg_set_conf_uint, | 1445 | .write = tg_set_conf_uint, |
1446 | }, | 1446 | }, |
1447 | { | 1447 | { |
1448 | .name = "throttle.io_service_bytes", | 1448 | .name = "throttle.io_service_bytes", |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 22dffebc7c73..cadc37841744 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1670,11 +1670,11 @@ static int cfq_print_leaf_weight(struct seq_file *sf, void *v) | |||
1670 | return 0; | 1670 | return 0; |
1671 | } | 1671 | } |
1672 | 1672 | ||
1673 | static int __cfqg_set_weight_device(struct cgroup_subsys_state *css, | 1673 | static ssize_t __cfqg_set_weight_device(struct kernfs_open_file *of, |
1674 | struct cftype *cft, const char *buf, | 1674 | char *buf, size_t nbytes, loff_t off, |
1675 | bool is_leaf_weight) | 1675 | bool is_leaf_weight) |
1676 | { | 1676 | { |
1677 | struct blkcg *blkcg = css_to_blkcg(css); | 1677 | struct blkcg *blkcg = css_to_blkcg(of_css(of)); |
1678 | struct blkg_conf_ctx ctx; | 1678 | struct blkg_conf_ctx ctx; |
1679 | struct cfq_group *cfqg; | 1679 | struct cfq_group *cfqg; |
1680 | int ret; | 1680 | int ret; |
@@ -1697,19 +1697,19 @@ static int __cfqg_set_weight_device(struct cgroup_subsys_state *css, | |||
1697 | } | 1697 | } |
1698 | 1698 | ||
1699 | blkg_conf_finish(&ctx); | 1699 | blkg_conf_finish(&ctx); |
1700 | return ret; | 1700 | return ret ?: nbytes; |
1701 | } | 1701 | } |
1702 | 1702 | ||
1703 | static int cfqg_set_weight_device(struct cgroup_subsys_state *css, | 1703 | static ssize_t cfqg_set_weight_device(struct kernfs_open_file *of, |
1704 | struct cftype *cft, char *buf) | 1704 | char *buf, size_t nbytes, loff_t off) |
1705 | { | 1705 | { |
1706 | return __cfqg_set_weight_device(css, cft, buf, false); | 1706 | return __cfqg_set_weight_device(of, buf, nbytes, off, false); |
1707 | } | 1707 | } |
1708 | 1708 | ||
1709 | static int cfqg_set_leaf_weight_device(struct cgroup_subsys_state *css, | 1709 | static ssize_t cfqg_set_leaf_weight_device(struct kernfs_open_file *of, |
1710 | struct cftype *cft, char *buf) | 1710 | char *buf, size_t nbytes, loff_t off) |
1711 | { | 1711 | { |
1712 | return __cfqg_set_weight_device(css, cft, buf, true); | 1712 | return __cfqg_set_weight_device(of, buf, nbytes, off, true); |
1713 | } | 1713 | } |
1714 | 1714 | ||
1715 | static int __cfq_set_weight(struct cgroup_subsys_state *css, struct cftype *cft, | 1715 | static int __cfq_set_weight(struct cgroup_subsys_state *css, struct cftype *cft, |
@@ -1837,7 +1837,7 @@ static struct cftype cfq_blkcg_files[] = { | |||
1837 | .name = "weight_device", | 1837 | .name = "weight_device", |
1838 | .flags = CFTYPE_ONLY_ON_ROOT, | 1838 | .flags = CFTYPE_ONLY_ON_ROOT, |
1839 | .seq_show = cfqg_print_leaf_weight_device, | 1839 | .seq_show = cfqg_print_leaf_weight_device, |
1840 | .write_string = cfqg_set_leaf_weight_device, | 1840 | .write = cfqg_set_leaf_weight_device, |
1841 | }, | 1841 | }, |
1842 | { | 1842 | { |
1843 | .name = "weight", | 1843 | .name = "weight", |
@@ -1851,7 +1851,7 @@ static struct cftype cfq_blkcg_files[] = { | |||
1851 | .name = "weight_device", | 1851 | .name = "weight_device", |
1852 | .flags = CFTYPE_NOT_ON_ROOT, | 1852 | .flags = CFTYPE_NOT_ON_ROOT, |
1853 | .seq_show = cfqg_print_weight_device, | 1853 | .seq_show = cfqg_print_weight_device, |
1854 | .write_string = cfqg_set_weight_device, | 1854 | .write = cfqg_set_weight_device, |
1855 | }, | 1855 | }, |
1856 | { | 1856 | { |
1857 | .name = "weight", | 1857 | .name = "weight", |
@@ -1863,7 +1863,7 @@ static struct cftype cfq_blkcg_files[] = { | |||
1863 | { | 1863 | { |
1864 | .name = "leaf_weight_device", | 1864 | .name = "leaf_weight_device", |
1865 | .seq_show = cfqg_print_leaf_weight_device, | 1865 | .seq_show = cfqg_print_leaf_weight_device, |
1866 | .write_string = cfqg_set_leaf_weight_device, | 1866 | .write = cfqg_set_leaf_weight_device, |
1867 | }, | 1867 | }, |
1868 | { | 1868 | { |
1869 | .name = "leaf_weight", | 1869 | .name = "leaf_weight", |