From patchwork Sat Jan 26 20:40:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2050291 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 0C9C6DF23A for ; Sat, 26 Jan 2013 20:40:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754236Ab3AZUkn (ORCPT ); Sat, 26 Jan 2013 15:40:43 -0500 Received: from mail-ia0-f181.google.com ([209.85.210.181]:34874 "EHLO mail-ia0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754120Ab3AZUkm (ORCPT ); Sat, 26 Jan 2013 15:40:42 -0500 Received: by mail-ia0-f181.google.com with SMTP id k25so2430467iah.12 for ; Sat, 26 Jan 2013 12:40:42 -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=sEjrGBh9YqJXULxK6XKcUXJ/dDSlol8r6w2G9eRf0vc=; b=g9QzqL/hte/LkOqdSAAzFPPpMcBYHZDJpfcoEx9GJPQiHFt0z/40ujV5Pqz6cNxsmf XaLZhocY1Xd0dq63SEM0RxNI6bBWl5KqX+tWBc9GzoaTyi0vFnkDaWQ1yHfEHCDW+QFU AGfNIx+gpgXmXfaW5SH1p7xSSNaqWrbZjZXktBM4jmptPOX6BqfyIZobkgenqDmkuI0H ZGKTnLRyDdTcPkuDSmAkTUPDiWqYg2noDNRjwRPe9C5GsI7Veove4GPYY+hZxPTyhtD6 dZh32ld807a7aSIZrc9HVoZw8z7LD3t/gUhnMUfPvyT65ldaLaU3pcE8u9xN9uV/VxIo r/fw== X-Received: by 10.50.33.138 with SMTP id r10mr1750767igi.6.1359232842475; Sat, 26 Jan 2013 12:40:42 -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 eo7sm2362304igc.12.2013.01.26.12.40.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Jan 2013 12:40:41 -0800 (PST) Message-ID: <51043F49.2020904@inktank.com> Date: Sat, 26 Jan 2013 14:40:41 -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 1/4] rbd: unregister linger in watch sync routine References: <51043EF2.4070305@inktank.com> In-Reply-To: <51043EF2.4070305@inktank.com> X-Gm-Message-State: ALoCoQknTV7i3LhcJKqkLv3WSMPM4Uv6TjJg1yv2F3pWu7cjVK/wEWq+HoeI2hSHfxma6rLMozF5 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Move the code that unregisters an rbd device's lingering header object watch request into rbd_dev_header_watch_sync(), so it occurs in the same function that originally sets up that request. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- drivers/block/rbd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) if (ret) @@ -4040,12 +4044,6 @@ static void rbd_dev_release(struct device *dev) { struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); - if (rbd_dev->watch_request) { - struct ceph_client *client = rbd_dev->rbd_client->client; - - ceph_osdc_unregister_linger_request(&client->osdc, - rbd_dev->watch_request); - } if (rbd_dev->watch_event) rbd_dev_header_watch_sync(rbd_dev, 0); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 47e5798..363a813 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1730,6 +1730,10 @@ static int rbd_dev_header_watch_sync(struct rbd_device *rbd_dev, int start) if (start) { rbd_dev->watch_request = obj_request->osd_req; ceph_osdc_set_request_linger(osdc, rbd_dev->watch_request); + } else { + ceph_osdc_unregister_linger_request(osdc, + rbd_dev->watch_request); + rbd_dev->watch_request = NULL; } ret = rbd_obj_request_submit(osdc, obj_request);