From patchwork Mon Dec 17 18:33:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1888521 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 7E17BDF266 for ; Mon, 17 Dec 2012 18:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141Ab2LQSdm (ORCPT ); Mon, 17 Dec 2012 13:33:42 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:61905 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079Ab2LQSdl (ORCPT ); Mon, 17 Dec 2012 13:33:41 -0500 Received: by mail-ie0-f174.google.com with SMTP id c11so9808017ieb.19 for ; Mon, 17 Dec 2012 10:33:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=J12/tqAwPdjFbMzIYwrc+jsSM2qCvlaoCDX84NtBYzo=; b=GVU7E20e/wxiqE4RSwwpF5YAnMJlI9UMXfFewwM+7mDUnvbGoJt03kIii+rpssR0iI sky4Vo2ceByn7rQTQlwBXI20EQfaHao0vuzHtMmcD4PES5fZVHRdSc11QjxQIocquoVo NE0z/E3WUsxpM2AbL+t13A0TDeh41j8okUMca7vjCXpqI4slkJ72Uuc1waPxHX/amDmJ 4aZAwGdLqqod4hUjNetBiV82mK14Iu4tgFi5g7RRGK9pSJ2AKBfZMXHQgRRpi5hQEtDp AeY4/c8h3FPB2bbIA2uFYNT4nauy5TyppCHDXzQ2jj8lGbz8R1r2c4dipwkRivnd6HWO Z12g== Received: by 10.50.33.138 with SMTP id r10mr10188324igi.6.1355769221111; Mon, 17 Dec 2012 10:33:41 -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 b13sm6786712igp.7.2012.12.17.10.33.39 (version=SSLv3 cipher=OTHER); Mon, 17 Dec 2012 10:33:40 -0800 (PST) Message-ID: <50CF6587.70108@inktank.com> Date: Mon, 17 Dec 2012 12:33:43 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 3/3] libceph: don't use rb_init_node() in ceph_osdc_alloc_request() References: <50CF6501.5070707@inktank.com> In-Reply-To: <50CF6501.5070707@inktank.com> X-Gm-Message-State: ALoCoQkErC7pSHh0YIu0ur3x3IZX/l34EtpnaK9KWgHmaUuAH+3g9QAipfYdZPgp++w7w4AHwRcJ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The red-black node in the ceph osd request structure is initialized in ceph_osdc_alloc_request() using rbd_init_node(). We do need to initialize this, because in __unregister_request() we call RB_EMPTY_NODE(), which expects the node it's checking to have been initialized. But rb_init_node() is apparently overkill, and may in fact be on its way out. So use RB_CLEAR_NODE() instead. For a little more background, see this commit: 4c199a93 rbtree: empty nodes have no color" Signed-off-by: Alex Elder --- net/ceph/osd_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) INIT_LIST_HEAD(&req->r_linger_osd); diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 2bce3d4..7cd0a7f 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -221,7 +221,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, kref_init(&req->r_kref); init_completion(&req->r_completion); init_completion(&req->r_safe_completion); - rb_init_node(&req->r_node); + RB_CLEAR_NODE(&req->r_node); INIT_LIST_HEAD(&req->r_unsafe_item); INIT_LIST_HEAD(&req->r_linger_item);