Commit 3eb9d961 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

staging: lustre: remove unused hash tables.

exp_lock_hash and exp_flock_hash are unused in
the client, so remove all references.

Also remove unused hashtable size definitions.
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f1e7bb9
...@@ -629,16 +629,6 @@ struct ldlm_lock { ...@@ -629,16 +629,6 @@ struct ldlm_lock {
* Tree node for ldlm_extent. * Tree node for ldlm_extent.
*/ */
struct ldlm_interval *l_tree_node; struct ldlm_interval *l_tree_node;
/**
* Per export hash of locks.
* Protected by per-bucket exp->exp_lock_hash locks.
*/
struct hlist_node l_exp_hash;
/**
* Per export hash of flock locks.
* Protected by per-bucket exp->exp_flock_hash locks.
*/
struct hlist_node l_exp_flock_hash;
/** /**
* Requested mode. * Requested mode.
* Protected by lr_lock. * Protected by lr_lock.
......
...@@ -102,13 +102,6 @@ struct obd_export { ...@@ -102,13 +102,6 @@ struct obd_export {
struct ptlrpc_connection *exp_connection; struct ptlrpc_connection *exp_connection;
/** Connection count value from last successful reconnect rpc */ /** Connection count value from last successful reconnect rpc */
__u32 exp_conn_cnt; __u32 exp_conn_cnt;
/** Hash list of all ldlm locks granted on this export */
struct cfs_hash *exp_lock_hash;
/**
* Hash list for Posix lock deadlock detection, added with
* ldlm_lock::l_exp_flock_hash.
*/
struct cfs_hash *exp_flock_hash;
struct list_head exp_outstanding_replies; struct list_head exp_outstanding_replies;
struct list_head exp_uncommitted_replies; struct list_head exp_uncommitted_replies;
spinlock_t exp_uncommitted_replies_lock; spinlock_t exp_uncommitted_replies_lock;
......
...@@ -67,27 +67,9 @@ extern char obd_jobid_var[]; ...@@ -67,27 +67,9 @@ extern char obd_jobid_var[];
#define HASH_UUID_BKT_BITS 5 #define HASH_UUID_BKT_BITS 5
#define HASH_UUID_CUR_BITS 7 #define HASH_UUID_CUR_BITS 7
#define HASH_UUID_MAX_BITS 12 #define HASH_UUID_MAX_BITS 12
#define HASH_NID_BKT_BITS 5
#define HASH_NID_CUR_BITS 7
#define HASH_NID_MAX_BITS 12
#define HASH_NID_STATS_BKT_BITS 5
#define HASH_NID_STATS_CUR_BITS 7
#define HASH_NID_STATS_MAX_BITS 12
#define HASH_LQE_BKT_BITS 5
#define HASH_LQE_CUR_BITS 7
#define HASH_LQE_MAX_BITS 12
#define HASH_CONN_BKT_BITS 5 #define HASH_CONN_BKT_BITS 5
#define HASH_CONN_CUR_BITS 5 #define HASH_CONN_CUR_BITS 5
#define HASH_CONN_MAX_BITS 15 #define HASH_CONN_MAX_BITS 15
#define HASH_EXP_LOCK_BKT_BITS 5
#define HASH_EXP_LOCK_CUR_BITS 7
#define HASH_EXP_LOCK_MAX_BITS 16
#define HASH_CL_ENV_BKT_BITS 5
#define HASH_CL_ENV_BITS 10
#define HASH_JOB_STATS_BKT_BITS 5
#define HASH_JOB_STATS_CUR_BITS 7
#define HASH_JOB_STATS_MAX_BITS 12
/* Timeout definitions */ /* Timeout definitions */
#define OBD_TIMEOUT_DEFAULT 100 #define OBD_TIMEOUT_DEFAULT 100
/* Time to wait for all clients to reconnect during recovery (hard limit) */ /* Time to wait for all clients to reconnect during recovery (hard limit) */
......
...@@ -83,9 +83,6 @@ ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode mode) ...@@ -83,9 +83,6 @@ ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode mode)
LDLM_DEBUG(lock, "%s(mode: %d)", LDLM_DEBUG(lock, "%s(mode: %d)",
__func__, mode); __func__, mode);
/* Safe to not lock here, since it should be empty anyway */
LASSERT(hlist_unhashed(&lock->l_exp_flock_hash));
list_del_init(&lock->l_res_link); list_del_init(&lock->l_res_link);
/* client side - set a flag to prevent sending a CANCEL */ /* client side - set a flag to prevent sending a CANCEL */
...@@ -263,15 +260,9 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req) ...@@ -263,15 +260,9 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
lock->l_policy_data.l_flock.start = lock->l_policy_data.l_flock.start =
new->l_policy_data.l_flock.end + 1; new->l_policy_data.l_flock.end + 1;
new2->l_conn_export = lock->l_conn_export; new2->l_conn_export = lock->l_conn_export;
if (lock->l_export) { if (lock->l_export)
new2->l_export = class_export_lock_get(lock->l_export, new2->l_export = class_export_lock_get(lock->l_export,
new2); new2);
if (new2->l_export->exp_lock_hash &&
hlist_unhashed(&new2->l_exp_hash))
cfs_hash_add(new2->l_export->exp_lock_hash,
&new2->l_remote_handle,
&new2->l_exp_hash);
}
ldlm_lock_addref_internal_nolock(new2, ldlm_lock_addref_internal_nolock(new2,
lock->l_granted_mode); lock->l_granted_mode);
......
...@@ -318,18 +318,6 @@ static int ldlm_lock_destroy_internal(struct ldlm_lock *lock) ...@@ -318,18 +318,6 @@ static int ldlm_lock_destroy_internal(struct ldlm_lock *lock)
} }
ldlm_set_destroyed(lock); ldlm_set_destroyed(lock);
if (lock->l_export && lock->l_export->exp_lock_hash) {
/* NB: it's safe to call cfs_hash_del() even lock isn't
* in exp_lock_hash.
*/
/* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
/* coverity[overrun-buffer-val] */
cfs_hash_del(lock->l_export->exp_lock_hash,
&lock->l_remote_handle, &lock->l_exp_hash);
}
ldlm_lock_remove_from_lru(lock); ldlm_lock_remove_from_lru(lock);
class_handle_unhash(&lock->l_handle); class_handle_unhash(&lock->l_handle);
...@@ -419,8 +407,6 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource) ...@@ -419,8 +407,6 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
lock->l_blocking_lock = NULL; lock->l_blocking_lock = NULL;
INIT_LIST_HEAD(&lock->l_sl_mode); INIT_LIST_HEAD(&lock->l_sl_mode);
INIT_LIST_HEAD(&lock->l_sl_policy); INIT_LIST_HEAD(&lock->l_sl_policy);
INIT_HLIST_NODE(&lock->l_exp_hash);
INIT_HLIST_NODE(&lock->l_exp_flock_hash);
lprocfs_counter_incr(ldlm_res_to_ns(resource)->ns_stats, lprocfs_counter_incr(ldlm_res_to_ns(resource)->ns_stats,
LDLM_NSS_LOCKS); LDLM_NSS_LOCKS);
......
...@@ -405,19 +405,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, ...@@ -405,19 +405,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
cleanup_phase = 0; cleanup_phase = 0;
lock_res_and_lock(lock); lock_res_and_lock(lock);
/* Key change rehash lock in per-export hash with new key */ lock->l_remote_handle = reply->lock_handle;
if (exp->exp_lock_hash) {
/* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
/* coverity[overrun-buffer-val] */
cfs_hash_rehash_key(exp->exp_lock_hash,
&lock->l_remote_handle,
&reply->lock_handle,
&lock->l_exp_hash);
} else {
lock->l_remote_handle = reply->lock_handle;
}
*flags = ldlm_flags_from_wire(reply->lock_flags); *flags = ldlm_flags_from_wire(reply->lock_flags);
lock->l_flags |= ldlm_flags_from_wire(reply->lock_flags & lock->l_flags |= ldlm_flags_from_wire(reply->lock_flags &
...@@ -1884,18 +1872,7 @@ static int replay_lock_interpret(const struct lu_env *env, ...@@ -1884,18 +1872,7 @@ static int replay_lock_interpret(const struct lu_env *env,
/* Key change rehash lock in per-export hash with new key */ /* Key change rehash lock in per-export hash with new key */
exp = req->rq_export; exp = req->rq_export;
if (exp && exp->exp_lock_hash) { lock->l_remote_handle = reply->lock_handle;
/* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
/* coverity[overrun-buffer-val] */
cfs_hash_rehash_key(exp->exp_lock_hash,
&lock->l_remote_handle,
&reply->lock_handle,
&lock->l_exp_hash);
} else {
lock->l_remote_handle = reply->lock_handle;
}
LDLM_DEBUG(lock, "replayed lock:"); LDLM_DEBUG(lock, "replayed lock:");
ptlrpc_import_recovery_state_machine(req->rq_import); ptlrpc_import_recovery_state_machine(req->rq_import);
......
...@@ -721,8 +721,6 @@ struct obd_export *class_new_export(struct obd_device *obd, ...@@ -721,8 +721,6 @@ struct obd_export *class_new_export(struct obd_device *obd,
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
export->exp_conn_cnt = 0; export->exp_conn_cnt = 0;
export->exp_lock_hash = NULL;
export->exp_flock_hash = NULL;
atomic_set(&export->exp_refcount, 2); atomic_set(&export->exp_refcount, 2);
atomic_set(&export->exp_rpc_count, 0); atomic_set(&export->exp_rpc_count, 0);
atomic_set(&export->exp_cb_count, 0); atomic_set(&export->exp_cb_count, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment