From patchwork Fri Feb 1 05:31:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2076611 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DAB40DFE75 for ; Fri, 1 Feb 2013 05:31:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761Ab3BAFbJ (ORCPT ); Fri, 1 Feb 2013 00:31:09 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:33049 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444Ab3BAFbI (ORCPT ); Fri, 1 Feb 2013 00:31:08 -0500 Received: by mail-ie0-f175.google.com with SMTP id c12so3092025ieb.20 for ; Thu, 31 Jan 2013 21:31:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=/1O0Z+V9V2wXRY7AxnIx397Eo5PjjXTojoixOejsE8Q=; b=ORjyqgDiwG8dAGJzNpxNsxHk4kmHCe6we4jy2i+offRE8Ha5sPm+0+WfpyIZD7rY+A 4xWbWDIqrksMQciHYqHa7yRYHGkaccSFyw+8fWJfYd1ffmuyZj/oU2VGWZYtaw4QTsEx Ou3Rqt3V2H1p1hJP4O8c2AxFa31qBDMo9LO2+ah8jW+tfmqP9naUMz76ilA9y8QqBG3B 5bARvCeSlY9mdRjQl6vPFB8KKUrYniuTDA2SESpjjEiuVcQmjfg3m/1RHVkiPArmPYTG WfdaF7bGqBqLqhS6UoFrB92lgyDt7zh7rKtSsmqbxX/8KeR2TDPvyYpHmxSn7yBvD6ei /OxA== X-Received: by 10.42.204.79 with SMTP id fl15mr8673488icb.57.1359696667673; Thu, 31 Jan 2013 21:31:07 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id c3sm5428778igj.1.2013.01.31.21.31.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 31 Jan 2013 21:31:06 -0800 (PST) Message-ID: <510B5321.9020000@inktank.com> Date: Thu, 31 Jan 2013 23:31:13 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH] libceph: fix messenger CONFIG_BLOCK dependencies X-Gm-Message-State: ALoCoQl39rAoZFLR/ZcjyZ96atPVu1vFWyA7tWfLD37wn6HITvhqZAOnL987InQAKFule4hpcyG+ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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 Reviewed-by: Josh Durgin --- include/linux/ceph/messenger.h | 2 ++ net/ceph/messenger.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) /* front */ 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 #include #include +#ifdef CONFIG_BLOCK #include -#include +#endif /* CONFIG_BLOCK */ #include #include @@ -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;