From patchwork Sat Feb 16 16:38:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2151881 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 7C1F7DF2A1 for ; Sat, 16 Feb 2013 16:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753582Ab3BPQiF (ORCPT ); Sat, 16 Feb 2013 11:38:05 -0500 Received: from mail-qc0-f175.google.com ([209.85.216.175]:37764 "EHLO mail-qc0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753559Ab3BPQiF (ORCPT ); Sat, 16 Feb 2013 11:38:05 -0500 Received: by mail-qc0-f175.google.com with SMTP id j3so1563817qcs.6 for ; Sat, 16 Feb 2013 08:38:03 -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=nnMYv4uF8Oas+IwagtivvufPW1jJmrhfbDJZeA1n9KA=; b=lLMVqEUsRA1FxtkqOyLMm/TyCK/8mdZRsRDm0qnRZiT/7VLfBcOzeVY6b8hFfm2zAm cCPD9chQG63VtfYLHDXbJoJdjV8i3kg32Iyowj59gHLxgQxhL0S4KYhhH/kUGLWalZND xfCStJBOij7N17i7U16fSP0bx/dy6mU6pU9O63cDNak4sAmNUinRe5DEYv7AbhNK6pVY JsAGeObXAzo8nAWCmga0WS5eqciHD86sYIzuLKmI6jOqvf996fGe9VTumgBZ29zH9ivv DTDyLoVGZVyWfg7KJ3d1o9o5eLi2T8d586P5COwMOqcmaeu1ZHX2hX8hL/XUhMk/Dll+ XPTg== X-Received: by 10.229.111.94 with SMTP id r30mr535448qcp.129.1361032683536; Sat, 16 Feb 2013 08:38:03 -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 s6sm1535146qaz.13.2013.02.16.08.38.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 16 Feb 2013 08:38:02 -0800 (PST) Message-ID: <511FB5E9.4010800@inktank.com> Date: Sat, 16 Feb 2013 10:38:01 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 2/2] libceph: kill ceph_osdc_wait_event() References: <511FB598.50603@inktank.com> In-Reply-To: <511FB598.50603@inktank.com> X-Gm-Message-State: ALoCoQkxmygcjVD93XGg7vXIf9oQXUfATGaCgosawuDTBI8R3APSDIq3LoGyehqwnFXoEsDW9d96 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org There are no actual users of ceph_osdc_wait_event(). This would have been one-shot events, but we no longer support those so just get rid of this function. Since this leaves nothing else that waits for the completion of an event, we can get rid of the completion in a struct ceph_osd_event. Signed-off-by: Alex Elder --- include/linux/ceph/osd_client.h | 3 --- net/ceph/osd_client.c | 18 ------------------ 2 files changed, 21 deletions(-) event->cookie = ++osdc->event_count; @@ -1530,7 +1529,6 @@ static void do_event_work(struct work_struct *work) dout("do_event_work completing %p\n", event); event->cb(ver, notify_id, opcode, event->data); - complete(&event->completion); dout("do_event_work completed %p\n", event); ceph_osdc_put_event(event); kfree(event_work); @@ -1588,7 +1586,6 @@ static void handle_watch_notify(struct ceph_osd_client *osdc, return; done_err: - complete(&event->completion); ceph_osdc_put_event(event); return; @@ -1597,21 +1594,6 @@ bad: return; } -int ceph_osdc_wait_event(struct ceph_osd_event *event, unsigned long timeout) -{ - int err; - - dout("wait_event %p\n", event); - err = wait_for_completion_interruptible_timeout(&event->completion, - timeout * HZ); - ceph_osdc_put_event(event); - if (err > 0) - err = 0; - dout("wait_event %p returns %d\n", event, err); - return err; -} -EXPORT_SYMBOL(ceph_osdc_wait_event); - /* * Register request, send initial attempt. */ diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 39c55d6..388158f 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h @@ -107,7 +107,6 @@ struct ceph_osd_event { struct rb_node node; struct list_head osd_node; struct kref kref; - struct completion completion; }; struct ceph_osd_event_work { @@ -275,8 +274,6 @@ extern int ceph_osdc_create_event(struct ceph_osd_client *osdc, void (*event_cb)(u64, u64, u8, void *), void *data, struct ceph_osd_event **pevent); extern void ceph_osdc_cancel_event(struct ceph_osd_event *event); -extern int ceph_osdc_wait_event(struct ceph_osd_event *event, - unsigned long timeout); extern void ceph_osdc_put_event(struct ceph_osd_event *event); #endif diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 4322faa..ad6b8b3 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1494,7 +1494,6 @@ int ceph_osdc_create_event(struct ceph_osd_client *osdc, RB_CLEAR_NODE(&event->node); kref_init(&event->kref); /* one ref for us */ kref_get(&event->kref); /* one ref for the caller */ - init_completion(&event->completion); spin_lock(&osdc->event_lock);