From patchwork Fri Apr 5 14:05:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2398801 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 D3362DF2E5 for ; Fri, 5 Apr 2013 14:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161824Ab3DEOFh (ORCPT ); Fri, 5 Apr 2013 10:05:37 -0400 Received: from mail-ia0-f181.google.com ([209.85.210.181]:50040 "EHLO mail-ia0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161548Ab3DEOFg (ORCPT ); Fri, 5 Apr 2013 10:05:36 -0400 Received: by mail-ia0-f181.google.com with SMTP id o25so3231371iad.12 for ; Fri, 05 Apr 2013 07:05:36 -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=DSEIY9lrGhDyvA8kQrdHaiy4ec7T2IiulZz/zm5Allc=; b=gq7LXaAN2ZZnAaj758rfGUCZW34Y8xMjRRBSdP01hnHR8Ihkq55Ym5DHslgMcvtxYe +nQIUFkWTAfXS4tveYm/20Wles30WkDrlmSgR1+Q56hbL4EjPcYKu/HrUwTooLDe6LvL 0vJLmSfz9SAJKoZfxTvzcwzujkWB+DVhgj5PrXA9UgZzl3NwhwxBm2rdHPj+Omp3DdyC b15M3lKHSjXR2BsPBswChMGRZI1vEJqhUbtXnUo9vSvgBPOjcWMwJPC3N2BvnOJ8LkM3 uytAkGZJaSsdWqeytVyJw8pd3AEfXEXEdoTfZXg8AwP7XjPW/Wr4uPyn8DQk4lKGogfD VUXQ== X-Received: by 10.50.66.133 with SMTP id f5mr1701543igt.38.1365170736394; Fri, 05 Apr 2013 07:05:36 -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 wx2sm2790159igb.4.2013.04.05.07.05.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Apr 2013 07:05:35 -0700 (PDT) Message-ID: <515EDA2D.10306@inktank.com> Date: Fri, 05 Apr 2013 09:05:33 -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 17/20] libceph: set message data when building osd request References: <515ED849.9060901@inktank.com> In-Reply-To: <515ED849.9060901@inktank.com> X-Gm-Message-State: ALoCoQkGL2ZSct0aS1wTP1LzdKEStwgE8KxEXbEhHan6OSWOxvYi6/owZzY7Hpkz+S80f6122ttg Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org All calls of ceph_osdc_start_request() are preceded (in the case of rbd, almost) immediately by a call to ceph_osdc_build_request(). Move the build calls at the top of ceph_osdc_start_request() out of there and into the ceph_osdc_build_request(). Nothing prevents moving these calls to the top of ceph_osdc_build_request(), either (and we're going to want them there in the next patch) so put them at the top. This and the next patch are related to: http://tracker.ceph.com/issues/4657 Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- net/ceph/osd_client.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) @@ -1976,11 +1981,6 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc, { int rc = 0; - /* Set up response incoming data and request outgoing data fields */ - - ceph_osdc_msg_data_set(req->r_reply, &req->r_data_in); - ceph_osdc_msg_data_set(req->r_request, &req->r_data_out); - down_read(&osdc->map_sem); mutex_lock(&osdc->request_mutex); __register_request(osdc, req); diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index f80984e..40466ab 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1884,6 +1884,11 @@ void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off, u64 data_len; unsigned int i; + /* Set up response incoming data and request outgoing data fields */ + + ceph_osdc_msg_data_set(req->r_reply, &req->r_data_in); + ceph_osdc_msg_data_set(req->r_request, &req->r_data_out); + req->r_snapid = snap_id; req->r_snapc = ceph_get_snap_context(snapc);