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

libceph: fix messenger CONFIG_BLOCK dependencies

The ceph messenger has a few spots that are only used when
bio messages are supported, and that's only when CONFIG_BLOCK
is defined. This surrounds a couple of spots with #ifdef's
that would cause a problem if CONFIG_BLOCK were not present
in the kernel configuration.

This resolves:
http://tracker.ceph.com/issues/3976

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

authored by

Alex Elder and committed by
Sage Weil
3ebc21f7 695b7119

+6 -1
+2
include/linux/ceph/messenger.h
··· 83 83 struct list_head list_head; 84 84 85 85 struct kref kref; 86 + #ifdef CONFIG_BLOCK 86 87 struct bio *bio; /* instead of pages/pagelist */ 87 88 struct bio *bio_iter; /* bio iterator */ 88 89 int bio_seg; /* current bio segment */ 90 + #endif /* CONFIG_BLOCK */ 89 91 struct ceph_pagelist *trail; /* the trailing part of the data */ 90 92 bool front_is_vmalloc; 91 93 bool more_to_follow;
+4 -1
net/ceph/messenger.c
··· 9 9 #include <linux/slab.h> 10 10 #include <linux/socket.h> 11 11 #include <linux/string.h> 12 + #ifdef CONFIG_BLOCK 12 13 #include <linux/bio.h> 13 - #include <linux/blkdev.h> 14 + #endif /* CONFIG_BLOCK */ 14 15 #include <linux/dns_resolver.h> 15 16 #include <net/tcp.h> 16 17 ··· 2652 2651 m->page_alignment = 0; 2653 2652 m->pages = NULL; 2654 2653 m->pagelist = NULL; 2654 + #ifdef CONFIG_BLOCK 2655 2655 m->bio = NULL; 2656 2656 m->bio_iter = NULL; 2657 2657 m->bio_seg = 0; 2658 + #endif /* CONFIG_BLOCK */ 2658 2659 m->trail = NULL; 2659 2660 2660 2661 /* front */