aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2015-08-21 13:05:39 -0400
committerChris Mason <clm@fb.com>2015-08-21 13:08:13 -0400
commit3a9508b0221dfd290b95fb0ab199958fe078bbdf (patch)
treef7e25d8cbfe0e3d5f4a052cc42675351d09e5c9c /fs
parentb84b8390d6009cde5134f775a251103c14bbed74 (diff)
btrfs: fix compile when block cgroups are not enabled
bio->bi_css and bio->bi_ioc don't exist when block cgroups are not on. This adds an ifdef around them. It's not perfect, but our use of bi_ioc is being removed in the 4.3 merge window. The bi_css usage really should go into bio_clone, but I want to make sure that doesn't introduce problems for other bio_clone use cases. Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent_io.c3
-rw-r--r--fs/btrfs/volumes.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 3cfbd6261f9b..fa19f2f68c1b 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2730,9 +2730,12 @@ struct bio *btrfs_bio_clone(struct bio *bio, gfp_t gfp_mask)
2730 btrfs_bio->csum = NULL; 2730 btrfs_bio->csum = NULL;
2731 btrfs_bio->csum_allocated = NULL; 2731 btrfs_bio->csum_allocated = NULL;
2732 btrfs_bio->end_io = NULL; 2732 btrfs_bio->end_io = NULL;
2733
2734#ifdef CONFIG_BLK_CGROUP
2733 /* FIXME, put this into bio_clone_bioset */ 2735 /* FIXME, put this into bio_clone_bioset */
2734 if (bio->bi_css) 2736 if (bio->bi_css)
2735 bio_associate_blkcg(new, bio->bi_css); 2737 bio_associate_blkcg(new, bio->bi_css);
2738#endif
2736 } 2739 }
2737 return new; 2740 return new;
2738} 2741}
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 53a38075911e..69520dfa8960 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5955,6 +5955,7 @@ again:
5955 if (!bio) 5955 if (!bio)
5956 return -ENOMEM; 5956 return -ENOMEM;
5957 5957
5958#ifdef CONFIG_BLK_CGROUP
5958 if (first_bio->bi_ioc) { 5959 if (first_bio->bi_ioc) {
5959 get_io_context_active(first_bio->bi_ioc); 5960 get_io_context_active(first_bio->bi_ioc);
5960 bio->bi_ioc = first_bio->bi_ioc; 5961 bio->bi_ioc = first_bio->bi_ioc;
@@ -5963,6 +5964,7 @@ again:
5963 css_get(first_bio->bi_css); 5964 css_get(first_bio->bi_css);
5964 bio->bi_css = first_bio->bi_css; 5965 bio->bi_css = first_bio->bi_css;
5965 } 5966 }
5967#endif
5966 while (bvec <= (first_bio->bi_io_vec + first_bio->bi_vcnt - 1)) { 5968 while (bvec <= (first_bio->bi_io_vec + first_bio->bi_vcnt - 1)) {
5967 if (bio_add_page(bio, bvec->bv_page, bvec->bv_len, 5969 if (bio_add_page(bio, bvec->bv_page, bvec->bv_len,
5968 bvec->bv_offset) < bvec->bv_len) { 5970 bvec->bv_offset) < bvec->bv_len) {