Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236959

[PATCH 11/32] staging/lustre/ldlm: Get rid of lr_converting queue

From green@linuxhacker.ru
Newsgroups linux.kernel
Subject [PATCH 11/32] staging/lustre/ldlm: Get rid of lr_converting queue
Date 2015-10-01 06:30 +0200
Message-ID <qeDFf-1hq-7@gated-at.bofh.it> (permalink)
References <qeDvz-13Y-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Oleg Drokin <green@linuxhacker.ru>

Now that we removed all the lock conversion functions,
also get rid of the converson queue since nothing could ever
get there anyway.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h |  2 --
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     | 10 +---------
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  9 ---------
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 12 ------------
 4 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index bea526b..40377b2 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -883,8 +883,6 @@ struct ldlm_resource {
 	 * @{ */
 	/** List of locks in granted state */
 	struct list_head		lr_granted;
-	/** List of locks waiting to change their granted mode (converted) */
-	struct list_head		lr_converting;
 	/**
 	 * List of locks that could not be granted due to conflicts and
 	 * that are waiting for conflicts to go away */
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 0597fec..7f9d3c1 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1260,12 +1260,6 @@ ldlm_mode_t ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
 		rc = 0;
 		goto out;
 	}
-	lock = search_queue(&res->lr_converting, &mode, policy, old_lock,
-			    flags, unref);
-	if (lock != NULL) {
-		rc = 1;
-		goto out;
-	}
 	lock = search_queue(&res->lr_waiting, &mode, policy, old_lock,
 			    flags, unref);
 	if (lock != NULL) {
@@ -1634,9 +1628,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,
 	 * FIXME (bug 268): Detect obvious lies by checking compatibility in
 	 * granted/converting queues. */
 	if (local) {
-		if (*flags & LDLM_FL_BLOCK_CONV)
-			ldlm_resource_add_lock(res, &res->lr_converting, lock);
-		else if (*flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED))
+		if (*flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED))
 			ldlm_resource_add_lock(res, &res->lr_waiting, lock);
 		else
 			ldlm_grant_lock(lock, NULL);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 5bd66c3..760c745 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -1878,15 +1878,6 @@ int ldlm_resource_foreach(struct ldlm_resource *res, ldlm_iterator_t iter,
 		}
 	}
 
-	list_for_each_safe(tmp, next, &res->lr_converting) {
-		lock = list_entry(tmp, struct ldlm_lock, l_res_link);
-
-		if (iter(lock, closure) == LDLM_ITER_STOP) {
-			rc = LDLM_ITER_STOP;
-			goto out;
-		}
-	}
-
 	list_for_each_safe(tmp, next, &res->lr_waiting) {
 		lock = list_entry(tmp, struct ldlm_lock, l_res_link);
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index cc212b9..dac2ec2 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -792,7 +792,6 @@ static int ldlm_resource_clean(struct cfs_hash *hs, struct cfs_hash_bd *bd,
 	__u64 flags = *(__u64 *)arg;
 
 	cleanup_resource(res, &res->lr_granted, flags);
-	cleanup_resource(res, &res->lr_converting, flags);
 	cleanup_resource(res, &res->lr_waiting, flags);
 
 	return 0;
@@ -1059,7 +1058,6 @@ static struct ldlm_resource *ldlm_resource_new(void)
 		return NULL;
 
 	INIT_LIST_HEAD(&res->lr_granted);
-	INIT_LIST_HEAD(&res->lr_converting);
 	INIT_LIST_HEAD(&res->lr_waiting);
 
 	/* Initialize interval trees for each lock mode. */
@@ -1224,11 +1222,6 @@ static void __ldlm_resource_putref_final(struct cfs_hash_bd *bd,
 		LBUG();
 	}
 
-	if (!list_empty(&res->lr_converting)) {
-		ldlm_resource_dump(D_ERROR, res);
-		LBUG();
-	}
-
 	if (!list_empty(&res->lr_waiting)) {
 		ldlm_resource_dump(D_ERROR, res);
 		LBUG();
@@ -1451,11 +1444,6 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res)
 			}
 		}
 	}
-	if (!list_empty(&res->lr_converting)) {
-		CDEBUG(level, "Converting locks:\n");
-		list_for_each_entry(lock, &res->lr_converting, l_res_link)
-			LDLM_DEBUG_LIMIT(level, lock, "###");
-	}
 	if (!list_empty(&res->lr_waiting)) {
 		CDEBUG(level, "Waiting locks:\n");
 		list_for_each_entry(lock, &res->lr_waiting, l_res_link)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/32] Lustre (mostly locking) unused code removal green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 21/32] staging/lustre/ldlm: Remove ldlm_refresh/del_waiting_lock() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 04/32] staging/lustre/llite: Remove unused ll_rmdir_entry() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 18/32] staging/lustre/ldlm: Remove ldlm_namespace_free() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 12/32] staging/lustre/ldlm: Remove unused ldlm_cli_enqueue_local() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 25/32] staging/lustre/ldlm: Remove unused ldlm_blocking_ast/_nocheck() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 06/32] staging/lustre/lov: Remove unused lov_lsm_decref() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 29/32] staging/lustre/ldlm: Remove unused exported symbols. green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 20/32] staging/lustre/ldlm: Remove unused ldlm_pool_set_slv() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 16/32] staging/lustre/ldlm: Remove ldlm_glimpse_ast() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 28/32] staging/lustre/ldlm: Remove server side code from pool support. green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 24/32] staging/lustre/ldlm: Remove unused ldlm_resource_insert_lock_after() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 19/32] staging/lustre/ldlm: Remove unused ldlm_pool_get_clv() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 30/32] staging/lustre/ldlm: Remove ldlm_namespace_inactive_list() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 05/32] staging/lustre/lov: Remove unused lov_dump_lmm/pool() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 02/32] staging/lustre: KEY_DEFAULT/MAX_COOKIESIZE key is unused, remove them green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 32/32] staging/lustre/ldlm: Make ldlm_add_ast_work_item() static green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 13/32] staging/lustre/ldlm: Remove unused ldlm_init/fini_flock_export green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 08/32] staging/lustre/ldlm: Remove unused ldlm_cancel_locks_for_exports() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 07/32] staging/lustre/ldlm: Remove unused interval tree bits green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 03/32] staging/lustre: Remove ununused ll_ra_read_get() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 14/32] staging/lustre/ldlm: Remove unused ldlm_enqueue_pack() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 26/32] staging/lustre: Remove ns_is_client() green@linuxhacker.ru - 2015-10-01 06:20 +0200
  [PATCH 11/32] staging/lustre/ldlm: Get rid of lr_converting queue green@linuxhacker.ru - 2015-10-01 06:30 +0200
  [PATCH 10/32] staging/lustre/ldlm: Remove unimplemented lock conversion traces. green@linuxhacker.ru - 2015-10-01 06:30 +0200

csiph-web