From patchwork Thu Jul 26 18:57:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1244171 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 85A2B3FC5A for ; Thu, 26 Jul 2012 18:57:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752437Ab2GZS5g (ORCPT ); Thu, 26 Jul 2012 14:57:36 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:37892 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426Ab2GZS5g (ORCPT ); Thu, 26 Jul 2012 14:57:36 -0400 Received: by gglu4 with SMTP id u4so2327042ggl.19 for ; Thu, 26 Jul 2012 11:57:35 -0700 (PDT) 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=bPcK7Dfojir29j/sCiWxPeW1M4I+CNXyGrjtWcBLCck=; b=KAJi7ZUPwUNIEGUVhDwoghfuqnM0JqWoKqc1N3ihrKISaWJL2dmhprXTx6dhxE3dvb mCKXXKo1Z7uJuRe+YYa4zy0lq/dI3or/sXhubyj+mGRm1M51WBnkifgqPLAhVWN7327C rbA2LDdSVA7jdVB3pjaqrnt/eTYMOo/Mt0NqkJWT0Z+RPr+E+Uvgz2eYmoRsekvYOOZH q7qrMcNXKaTetr01V7ChsQDjX8P8GwdXURUOikjRfAWvNSodWAImemcaewliaE9laADS Vyxa0YB4eN1g963D8zln1qDjs6e5B2YtqXpANNPSMjZfJ9VR/IzVYbVrqej+61xhwtWH 7N0A== Received: by 10.236.91.48 with SMTP id g36mr28907530yhf.53.1343329055497; Thu, 26 Jul 2012 11:57:35 -0700 (PDT) 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 u23sm43481023yhl.21.2012.07.26.11.57.34 (version=SSLv3 cipher=OTHER); Thu, 26 Jul 2012 11:57:34 -0700 (PDT) Message-ID: <5011931E.8040409@inktank.com> Date: Thu, 26 Jul 2012 13:57:34 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 4/7] rbd: drop "object_name" from rbd_req_sync_watch() References: <50119076.1030307@inktank.com> In-Reply-To: <50119076.1030307@inktank.com> X-Gm-Message-State: ALoCoQnr7ugNiWrPu82DPBSYNjlDcch6v0QjXLJpA4mtNJCQdmSGL9+XgAzaemnIvIJGl3GQSX70 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org rbd_req_sync_watch() is only called in one place, and in that place it passes rbd_dev->header_name as the value of the "object_name" parameter. This value is available within the function already. Having the extra parameter leaves the impression the object name could take on different values, but it does not. So get rid of the parameter. We can always add it back again if we find we want to watch some other object in the future. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc; @@ -1252,7 +1250,7 @@ static int rbd_req_sync_watch(struct rbd_device *rbd_dev, if (ret < 0) goto fail; - ops[0].watch.ver = cpu_to_le64(ver); + ops[0].watch.ver = cpu_to_le64(rbd_dev->header.obj_version); ops[0].watch.cookie = cpu_to_le64(rbd_dev->watch_event->cookie); ops[0].watch.flag = 1; @@ -1261,7 +1259,8 @@ static int rbd_req_sync_watch(struct rbd_device *rbd_dev, 0, CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, ops, - object_name, 0, 0, NULL, + rbd_dev->header_name, + 0, 0, NULL, &rbd_dev->watch_request, NULL); if (ret < 0) @@ -2186,8 +2185,7 @@ static int rbd_init_watch_dev(struct rbd_device *rbd_dev) int ret, rc; do { - ret = rbd_req_sync_watch(rbd_dev, rbd_dev->header_name, - rbd_dev->header.obj_version); + ret = rbd_req_sync_watch(rbd_dev); if (ret == -ERANGE) { mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); rc = __rbd_refresh_header(rbd_dev); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index a748448..5cfeeaf 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1236,9 +1236,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data) /* * Request sync osd watch */ -static int rbd_req_sync_watch(struct rbd_device *rbd_dev, - const char *object_name, - u64 ver) +static int rbd_req_sync_watch(struct rbd_device *rbd_dev) { struct ceph_osd_req_op *ops;