From patchwork Fri Apr 5 22:17:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2400631 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 68EEFDF2E5 for ; Fri, 5 Apr 2013 22:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162876Ab3DEWRb (ORCPT ); Fri, 5 Apr 2013 18:17:31 -0400 Received: from mail-ia0-f172.google.com ([209.85.210.172]:34563 "EHLO mail-ia0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162867Ab3DEWRa (ORCPT ); Fri, 5 Apr 2013 18:17:30 -0400 Received: by mail-ia0-f172.google.com with SMTP id l29so3644955iag.31 for ; Fri, 05 Apr 2013 15:17:30 -0700 (PDT) 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=yXD31yCehvc/7eEQXkjSMFvjp4AsbBUKFX6GP2C5bkU=; b=GldibSjTUg7OnkFyxtVZr2l1u2oJW7rKi6NyGS28GTxKYGMcyUYb20pt5TeeFb2bqb 7lncIus6skFM9ia/DEOA3X+IWdX2803Qo8pmwKSuv8/1hf1CP8X0xBdFubbM9Iho7mum g9qZujTRPv58MtelF02uDuQ1cDsg7v0kJ7vh1AEmsyrSeFv3Rn0j04ZRu6f9SY5XlDxs MMxBZGiYZdo6xfTQVEncfp9GqPjxDojumpouewH5cl3h80NgstaouzGka+xjOWggGzGt 2EdiLywVcarUFE4cTlKcs6dQzC6+cm4G85nkEdJkfFXL+uH3AbCYaLNwtxNooBMyZZi7 kk1A== X-Received: by 10.50.195.231 with SMTP id ih7mr654372igc.55.1365200250177; Fri, 05 Apr 2013 15:17:30 -0700 (PDT) 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 xf4sm4164540igb.8.2013.04.05.15.17.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Apr 2013 15:17:29 -0700 (PDT) Message-ID: <515F4D77.1080205@inktank.com> Date: Fri, 05 Apr 2013 17:17:27 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH] libceph: fix possible CONFIG_BLOCK build problem X-Gm-Message-State: ALoCoQlQzOT4zxJiOLjXyfUvXSIAPVSYeFxG2qZbrpi0KDlt+f0L+J2TbR79zZyhNYXdZpibOZj0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org This patch: 15a0d7b libceph: record message data length did not enclose some bio-specific code inside CONFIG_BLOCK as it should have. Fix that. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- include/linux/ceph/messenger.h | 2 ++ net/ceph/messenger.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) * For a page array, a piece comes from the first page in the array @@ -3011,6 +3011,7 @@ void ceph_msg_data_set_pagelist(struct ceph_msg *msg, } EXPORT_SYMBOL(ceph_msg_data_set_pagelist); +#ifdef CONFIG_BLOCK void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio, size_t length) { @@ -3028,6 +3029,7 @@ void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio, msg->data_length = length; } EXPORT_SYMBOL(ceph_msg_data_set_bio); +#endif /* CONFIG_BLOCK */ /* * construct a new message with given type, size diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index b832c0c..cdeebae 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h @@ -271,8 +271,10 @@ extern void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages, size_t length, size_t alignment); extern void ceph_msg_data_set_pagelist(struct ceph_msg *msg, struct ceph_pagelist *pagelist); +#ifdef CONFIG_BLOCK extern void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio, size_t length); +#endif /* CONFIG_BLOCK */ extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, bool can_fail); diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index a6fda95..994192b 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -817,7 +817,7 @@ static bool ceph_msg_data_bio_advance(struct ceph_msg_data *data, size_t bytes) return true; } -#endif +#endif /* CONFIG_BLOCK */ /*