From patchwork Thu Jul 26 18:57:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1244161 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 853F73FC5A for ; Thu, 26 Jul 2012 18:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752430Ab2GZS5b (ORCPT ); Thu, 26 Jul 2012 14:57:31 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:54228 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426Ab2GZS5b (ORCPT ); Thu, 26 Jul 2012 14:57:31 -0400 Received: by yhmm54 with SMTP id m54so2338429yhm.19 for ; Thu, 26 Jul 2012 11:57:30 -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=l9eZwY8WldY9HUNosOxr6HwTiB+zdxlpadN5uqyFI4Q=; b=aMZfOE/DD2szVCq6jj5Gzsst0xD90ptqxhWyTsQKiLJLYQ18VoYlTfzzYs0aRHRVa7 ghVyZ2EEsABJTQGVrSvk7a7bO9cHhO/XXZpNmAQ3VBb+oMjfgX/M6RfYkOrmYd8yguLx FLOTninBmE+98Fq04XRX+WMS2v7o+S3455crrfU2vEhZNgxZsNguxT9Gp9GBl53NU/8K 6Gu7v0r1aCeqkhIibooiRCxOhtx054bLFul9SSO8dkcNk/tIGhBkJzxBHudT/2iu8rJ4 aj0O0obJ4DOAutWEMHF8wDOhzlIskDMjXuSQI9FyBWvMrhoI7fWgoKTdtRnIpW/Y7Tvt O9UQ== Received: by 10.236.191.42 with SMTP id f30mr28362249yhn.123.1343329050411; Thu, 26 Jul 2012 11:57:30 -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 i65sm17041yhb.3.2012.07.26.11.57.29 (version=SSLv3 cipher=OTHER); Thu, 26 Jul 2012 11:57:30 -0700 (PDT) Message-ID: <50119319.4050400@inktank.com> Date: Thu, 26 Jul 2012 13:57:29 -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 3/7] rbd: drop rbd_dev parameter in snap functions References: <50119076.1030307@inktank.com> In-Reply-To: <50119076.1030307@inktank.com> X-Gm-Message-State: ALoCoQlzI+2vi3Ctt+YVp097BRBmIFHzsUnSy0KnSMLfdfrlaorFp0/2Mi1AYXCfzJL2EuIw583+ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Both rbd_register_snap_dev() and __rbd_remove_snap_dev() have rbd_dev parameters that are unused. Remove them. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) /* @@ -2006,15 +2005,13 @@ static struct device_type rbd_snap_device_type = { .release = rbd_snap_dev_release, }; -static void __rbd_remove_snap_dev(struct rbd_device *rbd_dev, - struct rbd_snap *snap) +static void __rbd_remove_snap_dev(struct rbd_snap *snap) { list_del(&snap->node); device_unregister(&snap->dev); } -static int rbd_register_snap_dev(struct rbd_device *rbd_dev, - struct rbd_snap *snap, +static int rbd_register_snap_dev(struct rbd_snap *snap, struct device *parent) { struct device *dev = &snap->dev; @@ -2041,8 +2038,7 @@ static int __rbd_add_snap_dev(struct rbd_device *rbd_dev, snap->size = rbd_dev->header.snap_sizes[i]; snap->id = rbd_dev->header.snapc->snaps[i]; if (device_is_registered(&rbd_dev->dev)) { - ret = rbd_register_snap_dev(rbd_dev, snap, - &rbd_dev->dev); + ret = rbd_register_snap_dev(snap, &rbd_dev->dev); if (ret < 0) goto err; } @@ -2107,7 +2103,7 @@ static int __rbd_init_snaps_header(struct rbd_device *rbd_dev) */ if (rbd_dev->snap_id == old_snap->id) rbd_dev->snap_exists = false; - __rbd_remove_snap_dev(rbd_dev, old_snap); + __rbd_remove_snap_dev(old_snap); continue; } if (old_snap->id == cur_id) { @@ -2171,8 +2167,7 @@ static int rbd_bus_add_dev(struct rbd_device *rbd_dev) goto out; list_for_each_entry(snap, &rbd_dev->snaps, node) { - ret = rbd_register_snap_dev(rbd_dev, snap, - &rbd_dev->dev); + ret = rbd_register_snap_dev(snap, &rbd_dev->dev); if (ret < 0) break; } diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 597ebaa..a748448 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -202,8 +202,7 @@ static ssize_t rbd_snap_add(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); -static void __rbd_remove_snap_dev(struct rbd_device *rbd_dev, - struct rbd_snap *snap); +static void __rbd_remove_snap_dev(struct rbd_snap *snap); static ssize_t rbd_add(struct bus_type *bus, const char *buf, size_t count); @@ -1698,7 +1697,7 @@ static void __rbd_remove_all_snaps(struct rbd_device *rbd_dev) struct rbd_snap *next; list_for_each_entry_safe(snap, next, &rbd_dev->snaps, node) - __rbd_remove_snap_dev(rbd_dev, snap); + __rbd_remove_snap_dev(snap); }