* [PATCH] libceph: fix messenger CONFIG_BLOCK dependencies
@ 2013-02-01 5:31 Alex Elder
2013-02-01 17:20 ` Josh Durgin
0 siblings, 1 reply; 2+ messages in thread
From: Alex Elder @ 2013-02-01 5:31 UTC (permalink / raw)
To: ceph-devel@vger.kernel.org
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>
---
include/linux/ceph/messenger.h | 2 ++
net/ceph/messenger.c | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 14ba5ee..60903e0 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -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;
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 5ccf87e..8a62a55 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -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 */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libceph: fix messenger CONFIG_BLOCK dependencies
2013-02-01 5:31 [PATCH] libceph: fix messenger CONFIG_BLOCK dependencies Alex Elder
@ 2013-02-01 17:20 ` Josh Durgin
0 siblings, 0 replies; 2+ messages in thread
From: Josh Durgin @ 2013-02-01 17:20 UTC (permalink / raw)
To: Alex Elder; +Cc: ceph-devel@vger.kernel.org
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
On 01/31/2013 09:31 PM, Alex Elder wrote:
> 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>
> ---
> include/linux/ceph/messenger.h | 2 ++
> net/ceph/messenger.c | 5 ++++-
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
> index 14ba5ee..60903e0 100644
> --- a/include/linux/ceph/messenger.h
> +++ b/include/linux/ceph/messenger.h
> @@ -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;
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index 5ccf87e..8a62a55 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -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 */
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-01 17:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01 5:31 [PATCH] libceph: fix messenger CONFIG_BLOCK dependencies Alex Elder
2013-02-01 17:20 ` Josh Durgin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.