public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: green@linuxhacker.ru
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	"John L. Hammond" <john.hammond@intel.com>,
	Oleg Drokin <green@linuxhacker.ru>
Subject: [PATCH 14/43] staging/lustre/lmv: remove lmv_init_{lock,unlock}()
Date: Wed, 30 Mar 2016 12:47:46 -0400	[thread overview]
Message-ID: <1459356495-2794775-15-git-send-email-green@linuxhacker.ru> (raw)
In-Reply-To: <1459356495-2794775-1-git-send-email-green@linuxhacker.ru>

From: "John L. Hammond" <john.hammond@intel.com>

In struct lmv_obd rename the init_mutex member to
lmv_init_mutex. Remove the compat macros lmv_init_{lock,unlock}() and
use mutex_{lock,unlock}(&lmv->lmv_init_mutex) instead.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/12115
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/include/obd.h      |  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_internal.h |  3 ---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c      | 24 ++++++++++++------------
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 26182ca..15c514c 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -512,7 +512,7 @@ struct lmv_obd {
 	struct obd_uuid		cluuid;
 	struct obd_export	*exp;
 
-	struct mutex		init_mutex;
+	struct mutex		lmv_init_mutex;
 	int			connected;
 	int			max_easize;
 	int			max_def_easize;
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
index 8a00871..7007e4c 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h
+++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
@@ -42,9 +42,6 @@
 
 #define LMV_MAX_TGT_COUNT 128
 
-#define lmv_init_lock(lmv)   mutex_lock(&lmv->init_mutex)
-#define lmv_init_unlock(lmv) mutex_unlock(&lmv->init_mutex)
-
 #define LL_IT2STR(it)					\
 	((it) ? ldlm_it2str((it)->it_op) : "0")
 
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index e3a7216..8bd2dc5 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -425,7 +425,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 
 	CDEBUG(D_CONFIG, "Target uuid: %s. index %d\n", uuidp->uuid, index);
 
-	lmv_init_lock(lmv);
+	mutex_lock(&lmv->lmv_init_mutex);
 
 	if (lmv->desc.ld_tgt_count == 0) {
 		struct obd_device *mdc_obd;
@@ -433,7 +433,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 		mdc_obd = class_find_client_obd(uuidp, LUSTRE_MDC_NAME,
 						&obd->obd_uuid);
 		if (!mdc_obd) {
-			lmv_init_unlock(lmv);
+			mutex_unlock(&lmv->lmv_init_mutex);
 			CERROR("%s: Target %s not attached: rc = %d\n",
 			       obd->obd_name, uuidp->uuid, -EINVAL);
 			return -EINVAL;
@@ -445,7 +445,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 		CERROR("%s: UUID %s already assigned at LOV target index %d: rc = %d\n",
 		       obd->obd_name,
 		       obd_uuid2str(&tgt->ltd_uuid), index, -EEXIST);
-		lmv_init_unlock(lmv);
+		mutex_unlock(&lmv->lmv_init_mutex);
 		return -EEXIST;
 	}
 
@@ -459,7 +459,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 			newsize <<= 1;
 		newtgts = kcalloc(newsize, sizeof(*newtgts), GFP_NOFS);
 		if (!newtgts) {
-			lmv_init_unlock(lmv);
+			mutex_unlock(&lmv->lmv_init_mutex);
 			return -ENOMEM;
 		}
 
@@ -481,7 +481,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 
 	tgt = kzalloc(sizeof(*tgt), GFP_NOFS);
 	if (!tgt) {
-		lmv_init_unlock(lmv);
+		mutex_unlock(&lmv->lmv_init_mutex);
 		return -ENOMEM;
 	}
 
@@ -507,7 +507,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 		}
 	}
 
-	lmv_init_unlock(lmv);
+	mutex_unlock(&lmv->lmv_init_mutex);
 	return rc;
 }
 
@@ -522,14 +522,14 @@ int lmv_check_connect(struct obd_device *obd)
 	if (lmv->connected)
 		return 0;
 
-	lmv_init_lock(lmv);
+	mutex_lock(&lmv->lmv_init_mutex);
 	if (lmv->connected) {
-		lmv_init_unlock(lmv);
+		mutex_unlock(&lmv->lmv_init_mutex);
 		return 0;
 	}
 
 	if (lmv->desc.ld_tgt_count == 0) {
-		lmv_init_unlock(lmv);
+		mutex_unlock(&lmv->lmv_init_mutex);
 		CERROR("%s: no targets configured.\n", obd->obd_name);
 		return -EINVAL;
 	}
@@ -551,7 +551,7 @@ int lmv_check_connect(struct obd_device *obd)
 	lmv->connected = 1;
 	easize = lmv_get_easize(lmv);
 	lmv_init_ea_size(obd->obd_self_export, easize, 0, 0, 0);
-	lmv_init_unlock(lmv);
+	mutex_unlock(&lmv->lmv_init_mutex);
 	return 0;
 
  out_disc:
@@ -572,7 +572,7 @@ int lmv_check_connect(struct obd_device *obd)
 		}
 	}
 	class_disconnect(lmv->exp);
-	lmv_init_unlock(lmv);
+	mutex_unlock(&lmv->lmv_init_mutex);
 	return rc;
 }
 
@@ -1269,7 +1269,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 	lmv->lmv_placement = PLACEMENT_CHAR_POLICY;
 
 	spin_lock_init(&lmv->lmv_lock);
-	mutex_init(&lmv->init_mutex);
+	mutex_init(&lmv->lmv_init_mutex);
 
 	lprocfs_lmv_init_vars(&lvars);
 
-- 
2.1.0

  parent reply	other threads:[~2016-03-30 16:59 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 16:47 [PATCH 00/43] Lustre IO stack simplifications and cleanups green
2016-03-30 16:47 ` [PATCH 01/43] staging/lustre/obdclass: limit lu_site hash table size green
2016-03-30 16:47 ` [PATCH 02/43] staging/lustre: Get rid of CFS_PAGE_MASK green
2016-03-30 16:47 ` [PATCH 03/43] staging/lustre: merge lclient/*.c into llite/ green
2016-03-30 16:47 ` [PATCH 04/43] staging/lustre: Reintroduce global env list green
2016-03-30 16:47 ` [PATCH 05/43] staging/lustre/osc: Adjustment on osc LRU for performance green
2016-03-30 16:47 ` [PATCH 06/43] staging/lustre/osc: to drop LRU pages with cl_lru_work green
2016-03-30 16:47 ` [PATCH 07/43] staging/lustre/clio: collapse layer of cl_page green
2016-03-30 16:47 ` [PATCH 08/43] staging/lustre/obdclass: Add a preallocated percpu cl_env green
2016-03-30 16:47 ` [PATCH 09/43] staging/lustre/clio: add pages into writeback cache in batches green
2016-03-30 16:47 ` [PATCH 10/43] staging/lustre/osc: add weight function for DLM lock green
2016-03-30 16:47 ` [PATCH 11/43] staging/lustre/clio: remove stackable cl_page completely green
2016-03-30 16:47 ` [PATCH 12/43] staging/lustre/clio: optimize read ahead code green
2016-03-30 16:47 ` [PATCH 13/43] staging/lustre/llite: remove lli_lvb green
2016-03-30 16:47 ` green [this message]
2016-03-30 16:47 ` [PATCH 15/43] staging/lustre/obd: remove struct client_obd_lock green
2016-03-30 16:47 ` [PATCH 16/43] staging/lustre/llite: remove some cl wrappers green
2016-03-30 16:47 ` [PATCH 17/43] staging/lustre: Remove struct ll_iattr green
2016-03-30 16:47 ` [PATCH 18/43] staging/lustre/clio: generalize cl_sync_io green
2016-03-30 16:47 ` [PATCH 19/43] staging/lustre/clio: cl_lock simplification green
2016-03-30 16:47 ` [PATCH 20/43] staging/lustre: update comments after " green
2016-03-30 16:47 ` [PATCH 21/43] staging/lustre/llite: clip page correctly for vvp_io_commit_sync green
2016-03-30 16:47 ` [PATCH 22/43] staging/lustre/llite: deadlock for page write green
2016-03-30 16:47 ` [PATCH 23/43] staging/lustre/llite: make sure we do cl_page_clip on the last page green
2016-03-30 16:47 ` [PATCH 24/43] staging/lustre/llite: merge lclient.h into llite/vvp_internal.h green
2016-03-30 16:47 ` [PATCH 25/43] staging/lustre/llite: rename ccc_device to vvp_device green
2016-03-30 16:47 ` [PATCH 26/43] staging/lustre/llite: rename ccc_object to vvp_object green
2016-03-30 16:47 ` [PATCH 27/43] staging/lustre/llite: rename ccc_page to vvp_page green
2016-03-30 16:48 ` [PATCH 28/43] staging/lustre/llite: rename ccc_lock to vvp_lock green
2016-03-30 16:48 ` [PATCH 29/43] staging/lustre:llite: remove struct ll_ra_read green
2016-03-30 16:48 ` [PATCH 30/43] staging/lustre/llite: merge ccc_io and vvp_io green
2016-03-30 16:48 ` [PATCH 31/43] staging/lustre/llite: use vui prefix for struct vvp_io members green
2016-03-30 16:48 ` [PATCH 32/43] staging/lustre/llite: move vvp_io functions to vvp_io.c green
2016-03-30 16:48 ` [PATCH 33/43] staging/lustre/llite: rename ccc_req to vvp_req green
2016-03-30 16:48 ` [PATCH 34/43] staging/lustre/llite: Rename struct ccc_grouplock to ll_grouplock green
2016-03-30 16:48 ` [PATCH 35/43] staging/lustre/llite: Rename struct vvp_thread_info to ll_thread_info green
2016-03-30 23:13   ` kbuild test robot
2016-03-30 23:39     ` [lustre-devel] " Oleg Drokin
2016-03-30 16:48 ` [PATCH 36/43] staging/lustre/llite: rename struct ccc_thread_info to vvp_thread_info green
2016-03-30 16:48 ` [PATCH 37/43] staging/lustre/llite: Remove ccc_global_{init,fini}() green
2016-03-30 16:48 ` [PATCH 38/43] staging/lustre/llite: Move ll_dirent_type_get and make it static green
2016-03-30 16:48 ` [PATCH 39/43] staging/lustre/llite: Move several declarations to llite_internal.h green
2016-03-30 16:48 ` [PATCH 40/43] staging/lustre/llite: Remove unused vui_local_lock field green
2016-03-30 16:48 ` [PATCH 41/43] staging/lustre/ldlm: ELC picks locks in a safer policy green
2016-03-30 16:48 ` [PATCH 42/43] staging/lustre/ldlm: revert changes to ldlm_cancel_aged_policy() green
2016-03-30 16:48 ` [PATCH 43/43] staging/lustre/ldlm: restore the ELC for enqueue green

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459356495-2794775-15-git-send-email-green@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.hammond@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox