From patchwork Sat Mar 9 15:14:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2241711 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 796F8DF2F2 for ; Sat, 9 Mar 2013 15:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932441Ab3CIPOa (ORCPT ); Sat, 9 Mar 2013 10:14:30 -0500 Received: from mail-ia0-f175.google.com ([209.85.210.175]:59000 "EHLO mail-ia0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932288Ab3CIPO3 (ORCPT ); Sat, 9 Mar 2013 10:14:29 -0500 Received: by mail-ia0-f175.google.com with SMTP id e16so669443iaa.20 for ; Sat, 09 Mar 2013 07:14:29 -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 :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=LsHPdsF2/O7z6muB/KCZheEGKIqNqYG7/eMmWz4c8+M=; b=F6GtaJn9v1+YMl2D2EPTqb+MZtv8K7nNfiw4n1l4d+BI0oGvnzyg9OYPN/iKh6A6Dv K561PGuGEeKhjauKHO1rlxJScaAflaBcWGwP7ovgPz8KJajg3LeIHqwzkswnvSFB5Ts2 MsFwQnw3iTiis/2HNIhmWqCbUv7WwIkItE2GQ47UPpwi/0MyRjsVdBSKKOk+NrfmU9eL myK/TbDHSy//VLLAp9JlNWsGgZeENu/df6MyzHWdEhPSSl2mkYWuU+c790cUeNsPLl8R 60s9efjkykqb5oQQipfM3tv/J4B+YEyX2ATzzZix62MhBVLJPSR5vbdraYL9481h0pJU KGfg== X-Received: by 10.50.212.38 with SMTP id nh6mr2432119igc.72.1362842068964; Sat, 09 Mar 2013 07:14:28 -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 wx2sm4546531igb.4.2013.03.09.07.14.25 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Mar 2013 07:14:27 -0800 (PST) Message-ID: <513B51D1.5090801@inktank.com> Date: Sat, 09 Mar 2013 09:14:25 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 4/8] libceph: kill args in read_partial_message_bio() References: <513B5116.2020305@inktank.com> In-Reply-To: <513B5116.2020305@inktank.com> X-Gm-Message-State: ALoCoQmxvSqJJBMcRHKZqmrc0FL699LCbt07S01EBQQrnI/jYXPJxme+XHfF7sO8znOGq/568ZvC Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org There is only one caller for read_partial_message_bio(), and it always passes &msg->bio_iter and &bio_seg as the second and third arguments. Furthermore, the message in question is always the connection's in_msg, and we can get that inside the called function. So drop those two parameters and use their derived equivalents. Signed-off-by: Alex Elder --- net/ceph/messenger.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) @@ -1845,7 +1847,7 @@ static int read_partial_message_bio(struct ceph_connection *con, con->in_msg_pos.page_pos += ret; if (con->in_msg_pos.page_pos == bv->bv_len) { con->in_msg_pos.page_pos = 0; - iter_bio_next(bio_iter, bio_seg); + iter_bio_next(&msg->bio_iter, &msg->bio_seg); } return ret; @@ -1975,9 +1977,7 @@ static int read_partial_message(struct ceph_connection *con) return ret; #ifdef CONFIG_BLOCK } else if (m->bio) { - BUG_ON(!m->bio_iter); ret = read_partial_message_bio(con, - &m->bio_iter, &m->bio_seg, data_len, do_datacrc); if (ret <= 0) return ret; diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 962b2cd..2017b88 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1819,14 +1819,16 @@ static int read_partial_message_pages(struct ceph_connection *con, #ifdef CONFIG_BLOCK static int read_partial_message_bio(struct ceph_connection *con, - struct bio **bio_iter, - unsigned int *bio_seg, unsigned int data_len, bool do_datacrc) { - struct bio_vec *bv = bio_iovec_idx(*bio_iter, *bio_seg); + struct ceph_msg *msg = con->in_msg; + struct bio_vec *bv; void *p; int ret, left; + BUG_ON(!msg); + BUG_ON(!msg->bio_iter); + bv = bio_iovec_idx(msg->bio_iter, msg->bio_seg); left = min((int)(data_len - con->in_msg_pos.data_pos), (int)(bv->bv_len - con->in_msg_pos.page_pos));