From patchwork Wed May 30 17:43:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 10439479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 36BA0602CC for ; Wed, 30 May 2018 17:43:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2390D289F1 for ; Wed, 30 May 2018 17:43:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17F7E28A4A; Wed, 30 May 2018 17:43:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D48289F1 for ; Wed, 30 May 2018 17:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932150AbeE3Rn4 (ORCPT ); Wed, 30 May 2018 13:43:56 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53642 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139AbeE3Rnx (ORCPT ); Wed, 30 May 2018 13:43:53 -0400 Received: by mail-wm0-f68.google.com with SMTP id a67-v6so49135369wmf.3 for ; Wed, 30 May 2018 10:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BxWv8AO/8WMhHD52jK9AzR4hSHRwh3YIrKeMBpOtelQ=; b=lR3YaMh3o/C71+q0nx5X9Kju8DUa9IwmxGXJCDUC/IA0rmxjNduYK43Et9NNQpJwBo Wo+v6pNNtZUdsKs6Kl+0TiaLvtzjiRjf2JGfqNSiHlZ9X5qf5223Mga7HqUj3/+QKkbW IIw8G2pL34S/4EEa0P5VRne2ni/FFSRCCwslbjTwExbQp8zZjsI8aVIfHUnp9/0JufR/ W3+EdPbdlO+oGHGg3TYyLykCskFBcm1J7r20Z32/S4se9F/uPhqHDTBbBRo74QIghbXB 9fDmJSntsca6riWksdunj8gpmOPkzFgE6FVRI1CEQn05WwO5LCkiCdty34+Kc95TQdSi ymhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BxWv8AO/8WMhHD52jK9AzR4hSHRwh3YIrKeMBpOtelQ=; b=kVOcZojJgwDu37wfcXe41z6HLL3LBBO20lIFUgk2YV+e4xtOgNDVgcInCh8Kh9T4x7 FA/PrUQGmVpiC8GVa4hp0lviszJ6S8XnQiNTAAFCpBiet3k5Znwg6/7p41HaUhkDHrnp rbVtPPSxbfZw1jItYdhJydJ0qCfZx4yG+IOPVSw+PsE9a+2RnilGm7Hm1sXDTc7SDpJ2 ReSLqFl8oZjLkMQscA/ym8KtvsS+4MOtvu4SGbduL1shevcsu+j2oCmO7l17I5rpBhVY G28lXoaTsJPU8Dfmz25/AA1BpZxKl4oyZmmbdqOezcTugxda3WqgSyxkSK71EYXknlwy KklQ== X-Gm-Message-State: ALKqPwdPxf7ZZ9LR0HDsUCtSI68aDOIzJEHryFqzsbb2uBQ1jOPpbYjS RLUHdFPgancRvmVbw+Z8CZI7aZYI X-Google-Smtp-Source: ADUXVKIAe5rmIC7vYTItxq1Y8h3irXpTBg3zlzLDep1WeTzgbC/tMObnPu7PONEbxwOpOJozPRoGuA== X-Received: by 2002:a1c:6b57:: with SMTP id g84-v6mr2031779wmc.127.1527702232113; Wed, 30 May 2018 10:43:52 -0700 (PDT) Received: from orange.brq.redhat.com. (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id p3-v6sm18647658wrn.31.2018.05.30.10.43.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 10:43:51 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Jeff Layton Subject: [PATCH 1/7] libceph: move more code into __complete_request() Date: Wed, 30 May 2018 19:43:36 +0200 Message-Id: <1527702222-8232-2-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1527702222-8232-1-git-send-email-idryomov@gmail.com> References: <1527702222-8232-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move req->r_completion wake up and req->r_kref decrement into __complete_request(). Signed-off-by: Ilya Dryomov --- net/ceph/osd_client.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index bcedeea80cd5..a78f578a2da7 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -2320,11 +2320,13 @@ static void finish_request(struct ceph_osd_request *req) static void __complete_request(struct ceph_osd_request *req) { - if (req->r_callback) { - dout("%s req %p tid %llu cb %pf result %d\n", __func__, req, - req->r_tid, req->r_callback, req->r_result); + dout("%s req %p tid %llu cb %pf result %d\n", __func__, req, + req->r_tid, req->r_callback, req->r_result); + + if (req->r_callback) req->r_callback(req); - } + complete_all(&req->r_completion); + ceph_osdc_put_request(req); } /* @@ -2337,8 +2339,6 @@ static void complete_request(struct ceph_osd_request *req, int err) req->r_result = err; finish_request(req); __complete_request(req); - complete_all(&req->r_completion); - ceph_osdc_put_request(req); } static void cancel_map_check(struct ceph_osd_request *req) @@ -3602,8 +3602,6 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg) up_read(&osdc->lock); __complete_request(req); - complete_all(&req->r_completion); - ceph_osdc_put_request(req); return; fail_request: