From patchwork Wed Jul 11 14:03:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1182791 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 AC12BDF25A for ; Wed, 11 Jul 2012 14:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932723Ab2GKODK (ORCPT ); Wed, 11 Jul 2012 10:03:10 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:38020 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932521Ab2GKODI (ORCPT ); Wed, 11 Jul 2012 10:03:08 -0400 Received: by ghrr11 with SMTP id r11so1227157ghr.19 for ; Wed, 11 Jul 2012 07:03:08 -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=OqJptTjm3M0eAv5eQadxXJ2m0ZGL1mx7RXWEm3nuBkM=; b=k9y3UT2Q2sDNiU6q6LpotRIOrM7paPzaHwPvlQd+0IgO2kxNoIOQGz2JLD2jpBGIrR r3kEhZ96KX8JFus+gEg+P6nuSxP0lt0xFWX0hqIhrfvPlly2ui1xnPutt1s955d3dcsK tissVTHg9UpWwWvLIMqOFS5qTphAR/4nAKbh1+CnAHZodCdkPBr+NtNfL1xCyfZtDVLY yD+oOD1h4BzEvL1BBGSBAGsSRzPCS7rsgLqpVVFsaT/QxEzjqPk3yH/Lxt3G3E3C8CU8 K05j6TT4SAenV/hNHJ7NNhxZIVSV1v/U9NfbIpvSZ28OZG/2O/SWCyB12jA2cyix9i2C N8Ew== Received: by 10.236.175.106 with SMTP id y70mr41379789yhl.110.1342015386392; Wed, 11 Jul 2012 07:03:06 -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 j17sm1506803anl.5.2012.07.11.07.03.05 (version=SSLv3 cipher=OTHER); Wed, 11 Jul 2012 07:03:06 -0700 (PDT) Message-ID: <4FFD8799.80105@inktank.com> Date: Wed, 11 Jul 2012 09:03:05 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 15/16] rbd: option symbol renames References: <4FFD847C.7070205@inktank.com> In-Reply-To: <4FFD847C.7070205@inktank.com> X-Gm-Message-State: ALoCoQnW6y/NFJbwIzqFBmNCWb2x3XYLhaoYkC/XRqGtT7wvHeq6xChrLGwiIuA3IMHeIMgtPshA Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Use the name "ceph_opts" consistently (rather than just "opt") for pointers to a ceph_options structure. Change the few spots that don't use "rbd_opts" for a rbd_options pointer to match the rest. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) struct rbd_client *rbdc; @@ -288,10 +288,10 @@ static struct rbd_client *rbd_client_create(struct ceph_options *opt, mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); - rbdc->client = ceph_create_client(opt, rbdc, 0, 0); + rbdc->client = ceph_create_client(ceph_opts, rbdc, 0, 0); if (IS_ERR(rbdc->client)) goto out_mutex; - opt = NULL; /* Now rbdc->client is responsible for opt */ + ceph_opts = NULL; /* Now rbdc->client is responsible for ceph_opts */ ret = ceph_open_session(rbdc->client); if (ret < 0) @@ -314,23 +314,23 @@ out_mutex: mutex_unlock(&ctl_mutex); kfree(rbdc); out_opt: - if (opt) - ceph_destroy_options(opt); + if (ceph_opts) + ceph_destroy_options(ceph_opts); return ERR_PTR(ret); } /* * Find a ceph client with specific addr and configuration. */ -static struct rbd_client *__rbd_client_find(struct ceph_options *opt) +static struct rbd_client *__rbd_client_find(struct ceph_options *ceph_opts) { struct rbd_client *client_node; - if (opt->flags & CEPH_OPT_NOSHARE) + if (ceph_opts->flags & CEPH_OPT_NOSHARE) return NULL; list_for_each_entry(client_node, &rbd_client_list, node) - if (ceph_compare_options(opt, client_node->client) == 0) + if (!ceph_compare_options(ceph_opts, client_node->client)) return client_node; return NULL; } @@ -346,7 +346,7 @@ enum { /* string args above */ }; -static match_table_t rbdopt_tokens = { +static match_table_t rbd_opts_tokens = { {Opt_notify_timeout, "notify_timeout=%d"}, /* int args above */ /* string args above */ @@ -355,11 +355,11 @@ static match_table_t rbdopt_tokens = { static int parse_rbd_opts_token(char *c, void *private) { - struct rbd_options *rbdopt = private; + struct rbd_options *rbd_opts = private; substring_t argstr[MAX_OPT_ARGS]; int token, intval, ret; - token = match_token(c, rbdopt_tokens, argstr); + token = match_token(c, rbd_opts_tokens, argstr); if (token < 0) return -EINVAL; @@ -380,7 +380,7 @@ static int parse_rbd_opts_token(char *c, void *private) switch (token) { case Opt_notify_timeout: - rbdopt->notify_timeout = intval; + rbd_opts->notify_timeout = intval; break; default: BUG_ON(token); @@ -397,7 +397,7 @@ static struct rbd_client *rbd_get_client(const char *mon_addr, char *options) { struct rbd_client *rbdc; - struct ceph_options *opt; + struct ceph_options *ceph_opts; struct rbd_options *rbd_opts; rbd_opts = kzalloc(sizeof(*rbd_opts), GFP_KERNEL); @@ -406,29 +406,29 @@ static struct rbd_client *rbd_get_client(const char *mon_addr, rbd_opts->notify_timeout = RBD_NOTIFY_TIMEOUT_DEFAULT; - opt = ceph_parse_options(options, mon_addr, + ceph_opts = ceph_parse_options(options, mon_addr, mon_addr + mon_addr_len, parse_rbd_opts_token, rbd_opts); - if (IS_ERR(opt)) { + if (IS_ERR(ceph_opts)) { kfree(rbd_opts); - return ERR_CAST(opt); + return ERR_CAST(ceph_opts); } spin_lock(&rbd_client_list_lock); - rbdc = __rbd_client_find(opt); + rbdc = __rbd_client_find(ceph_opts); if (rbdc) { /* using an existing client */ kref_get(&rbdc->kref); spin_unlock(&rbd_client_list_lock); - ceph_destroy_options(opt); + ceph_destroy_options(ceph_opts); kfree(rbd_opts); return rbdc; } spin_unlock(&rbd_client_list_lock); - rbdc = rbd_client_create(opt, rbd_opts); + rbdc = rbd_client_create(ceph_opts, rbd_opts); if (IS_ERR(rbdc)) kfree(rbd_opts); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d29c864..c99ea08 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -270,9 +270,9 @@ static const struct block_device_operations rbd_bd_ops = { /* * Initialize an rbd client instance. - * We own *opt. + * We own *ceph_opts. */ -static struct rbd_client *rbd_client_create(struct ceph_options *opt, +static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts, struct rbd_options *rbd_opts) {