Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5
+3
fs/btrfs/extent_io.c
··· 2730 2730 btrfs_bio->csum = NULL; 2731 2731 btrfs_bio->csum_allocated = NULL; 2732 2732 btrfs_bio->end_io = NULL; 2733 + 2734 + #ifdef CONFIG_BLK_CGROUP 2733 2735 /* FIXME, put this into bio_clone_bioset */ 2734 2736 if (bio->bi_css) 2735 2737 bio_associate_blkcg(new, bio->bi_css); 2738 + #endif 2736 2739 } 2737 2740 return new; 2738 2741 }
+2
fs/btrfs/volumes.c
··· 5955 5955 if (!bio) 5956 5956 return -ENOMEM; 5957 5957 5958 + #ifdef CONFIG_BLK_CGROUP 5958 5959 if (first_bio->bi_ioc) { 5959 5960 get_io_context_active(first_bio->bi_ioc); 5960 5961 bio->bi_ioc = first_bio->bi_ioc; ··· 5964 5963 css_get(first_bio->bi_css); 5965 5964 bio->bi_css = first_bio->bi_css; 5966 5965 } 5966 + #endif 5967 5967 while (bvec <= (first_bio->bi_io_vec + first_bio->bi_vcnt - 1)) { 5968 5968 if (bio_add_page(bio, bvec->bv_page, bvec->bv_len, 5969 5969 bvec->bv_offset) < bvec->bv_len) {