libceph: fix messenger CONFIG_BLOCK dependencies
authorAlex Elder <elder@inktank.com>
Thu, 31 Jan 2013 22:02:01 +0000 (16:02 -0600)
committerSage Weil <sage@inktank.com>
Thu, 14 Feb 2013 02:27:40 +0000 (18:27 -0800)
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>
include/linux/ceph/messenger.h
net/ceph/messenger.c

index 14ba5ee738a90bbf6f27c0b12c846f1dfd93c13a..60903e0f665cb62ea9bf2db0cba04c984255e493 100644 (file)
@@ -83,9 +83,11 @@ struct ceph_msg {
        struct list_head list_head;
 
        struct kref kref;
+#ifdef CONFIG_BLOCK
        struct bio  *bio;               /* instead of pages/pagelist */
        struct bio  *bio_iter;          /* bio iterator */
        int bio_seg;                    /* current bio segment */
+#endif /* CONFIG_BLOCK */
        struct ceph_pagelist *trail;    /* the trailing part of the data */
        bool front_is_vmalloc;
        bool more_to_follow;
index 5ccf87ed8d688820a23ba1267439abe149398ec2..8a62a559a2aaade97cd9315c76ce63e9062391e6 100644 (file)
@@ -9,8 +9,9 @@
 #include <linux/slab.h>
 #include <linux/socket.h>
 #include <linux/string.h>
+#ifdef CONFIG_BLOCK
 #include <linux/bio.h>
-#include <linux/blkdev.h>
+#endif /* CONFIG_BLOCK */
 #include <linux/dns_resolver.h>
 #include <net/tcp.h>
 
@@ -2651,9 +2652,11 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
        m->page_alignment = 0;
        m->pages = NULL;
        m->pagelist = NULL;
+#ifdef CONFIG_BLOCK
        m->bio = NULL;
        m->bio_iter = NULL;
        m->bio_seg = 0;
+#endif /* CONFIG_BLOCK */
        m->trail = NULL;
 
        /* front */