From patchwork Fri Apr 5 22:25:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2400651 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 58771DF2E5 for ; Fri, 5 Apr 2013 22:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163043Ab3DEWZ3 (ORCPT ); Fri, 5 Apr 2013 18:25:29 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:44602 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162881Ab3DEWZ3 (ORCPT ); Fri, 5 Apr 2013 18:25:29 -0400 Received: by mail-ie0-f170.google.com with SMTP id c11so4969058ieb.15 for ; Fri, 05 Apr 2013 15:25:28 -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 :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=9j23UyuSrV702zkck6pnSp/Uo/Donxo0sdXSEzavOEI=; b=T0j0saHxjqbeGpb0wk3PPypdP1konDMSW7IDRsPQjg5CivoE0AMHg7WlDOkCzw4sXI AaOqCNeBpqyao9tR1SWdvoLtj7QWz/ytYmrdeyZjbIVCkTItk5jU9x5YYgCh8NPL1wIP 8YJVvv2Z3iW6v9y96n51O1hy/5ode8/pMDl7M+di+bkRO6bpg+K87ZRASAMn50wHct2Y VWUxTcmLIMAbxhvWYMjtunPVY2osBl6DIrZPKkD48qp980y09+uXNIb8boDc12Jl+CAA O6pw+bYcE3krI1jR1U0ImQFKMVadNOhuco9/jhMzYpNb8a6mtjzEw4oLJAnkjkiHa6HM cOlA== X-Received: by 10.50.66.133 with SMTP id f5mr679569igt.38.1365200728485; Fri, 05 Apr 2013 15:25:28 -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 wx2sm4758342igb.4.2013.04.05.15.25.27 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Apr 2013 15:25:27 -0700 (PDT) Message-ID: <515F4F56.3000905@inktank.com> Date: Fri, 05 Apr 2013 17:25:26 -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 1/6] libceph: record bio length References: <515F4F01.2000704@inktank.com> In-Reply-To: <515F4F01.2000704@inktank.com> X-Gm-Message-State: ALoCoQmVt709iSXrs02P87l5to7NKvuj4vO+nzL2taQXQKEmvzDUwG/vN1jV1NzNzdCGa/c7WI+g Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The bio is the only data item type that doesn't record its full length. Fix that. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- include/linux/ceph/messenger.h | 5 ++++- net/ceph/messenger.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) msg->data_length = length; diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index cdeebae..4fb870a 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h @@ -116,7 +116,10 @@ struct ceph_msg_data { enum ceph_msg_data_type type; union { #ifdef CONFIG_BLOCK - struct bio *bio; + struct { + struct bio *bio; + size_t bio_length; + }; #endif /* CONFIG_BLOCK */ struct { struct page **pages; /* NOT OWNER. */ diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index ae825e44..9571d03 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -3030,6 +3030,7 @@ void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio, data = ceph_msg_data_create(CEPH_MSG_DATA_BIO); BUG_ON(!data); data->bio = bio; + data->bio_length = length; msg->data = data;