From patchwork Thu Jan 24 16:35:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2033861 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E758B3FDBC for ; Thu, 24 Jan 2013 16:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753190Ab3AXQfs (ORCPT ); Thu, 24 Jan 2013 11:35:48 -0500 Received: from mail-ia0-f182.google.com ([209.85.210.182]:62618 "EHLO mail-ia0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150Ab3AXQfr (ORCPT ); Thu, 24 Jan 2013 11:35:47 -0500 Received: by mail-ia0-f182.google.com with SMTP id w33so5091460iag.13 for ; Thu, 24 Jan 2013 08:35:47 -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=VSN9Xk5L8m8b9i895qevrmr9x3z/vAxf8gmLpmOF6bo=; b=JlAiBs6D/0scL/hwutx2E/pfOAoqLYH2AkYg9IvDtKtIuMKkLNKnDu6jc6NqfNg+c3 fkyK7JChfuAUAQBcrXNqx+iXz75zgDEaRAGWAgzfQv5tZdoXhWxeT2Mb5556VRaDx+d4 eeMOaPscjlyb3VRqYnBfYM9ckTzMGKNsJWjklua/XWNK2VPt/G3xm0R6/ySptiIsdEWI G1/oKKV00hH8Ar6+V3rZkLi/rZAKYWnIdWusi0NY3vwv5TNEmfHjOsIFpnmi0Z52Qp3a +k/a1+JdHeCy208Bjz/Umb3P4BSigZeSBWZKcvA42C+k4xDJn7qrTHS5xdcQ4vJB+kpb O5Jg== X-Received: by 10.42.180.65 with SMTP id bt1mr1518389icb.41.1359045347071; Thu, 24 Jan 2013 08:35:47 -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 hi2sm1573845igc.16.2013.01.24.08.35.45 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Jan 2013 08:35:45 -0800 (PST) Message-ID: <510162E0.1040403@inktank.com> Date: Thu, 24 Jan 2013 10:35:44 -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 10/12, v2] rbd: send notify ack asynchronously References: <50FF11EA.3000808@inktank.com> <50FF128B.1030405@inktank.com> <5101406E.4060602@inktank.com> In-Reply-To: <5101406E.4060602@inktank.com> X-Gm-Message-State: ALoCoQmpwrJYCQ+D2DahW7tCJuUTjQknuGCEv3zpQZV0IplV2a9ojjKJ8XN4glprhi4Mwgm5Y35z Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org When we receive notification of a change to an rbd image's header object we need to refresh our information about the image (its size and snapshot context). Once we have refreshed our rbd image we need to acknowledge the notification. This acknowledgement was previously done synchronously, but there's really no need to wait for it to complete. Change it so the caller doesn't wait for the notify acknowledgement request to complete. And change the name to reflect it's no longer synchronous. This resolves: http://tracker.newdream.net/issues/3877 Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- drivers/block/rbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) struct rbd_obj_request *obj_request; @@ -1808,11 +1808,11 @@ static int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, goto out; osdc = &rbd_dev->rbd_client->client->osdc; + obj_request->callback = rbd_obj_request_put; ret = rbd_obj_request_submit(osdc, obj_request); - if (!ret) - ret = rbd_obj_request_wait(obj_request); out: - rbd_obj_request_put(obj_request); + if (ret) + rbd_obj_request_put(obj_request); return ret; } @@ -1834,7 +1834,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data) rbd_warn(rbd_dev, "got notification but failed to " " update snaps: %d\n", rc); - rbd_obj_notify_ack_sync(rbd_dev, hver, notify_id); + rbd_obj_notify_ack(rbd_dev, hver, notify_id); } /* diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b952b2f..48650d1 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1784,7 +1784,7 @@ static int rbd_img_request_submit(struct rbd_img_request *img_request) return 0; } -static int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, +static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 ver, u64 notify_id) {