staging/lustre/ldlm: Remove ldlm_init/destroy_export()
authorOleg Drokin <green@linuxhacker.ru>
Thu, 1 Oct 2015 04:12:19 +0000 (00:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Oct 2015 09:17:19 +0000 (11:17 +0200)
These functions are used on the server-only, so get rid of them.
Also get rid of ldlm export hash operations and the struct.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre_dlm.h
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c

index 1ac08e1c055914d022724635d33d1b02e080a460..03eea32c90fd3b892e357a6967f0cc12e92e4743 100644 (file)
@@ -1114,8 +1114,6 @@ int ldlm_del_waiting_lock(struct ldlm_lock *lock);
 int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout);
 int ldlm_get_ref(void);
 void ldlm_put_ref(void);
-int ldlm_init_export(struct obd_export *exp);
-void ldlm_destroy_export(struct obd_export *exp);
 struct ldlm_lock *ldlm_request_lock(struct ptlrpc_request *req);
 
 /* ldlm_lock.c */
index a78c4a4c9bd496901094394dc5acc06470307d65..57f6128d570146252f7d71adf8b41b2a58c0b049 100644 (file)
@@ -887,111 +887,6 @@ void ldlm_put_ref(void)
 }
 EXPORT_SYMBOL(ldlm_put_ref);
 
-/*
- * Export handle<->lock hash operations.
- */
-static unsigned
-ldlm_export_lock_hash(struct cfs_hash *hs, const void *key, unsigned mask)
-{
-       return cfs_hash_u64_hash(((struct lustre_handle *)key)->cookie, mask);
-}
-
-static void *
-ldlm_export_lock_key(struct hlist_node *hnode)
-{
-       struct ldlm_lock *lock;
-
-       lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash);
-       return &lock->l_remote_handle;
-}
-
-static void
-ldlm_export_lock_keycpy(struct hlist_node *hnode, void *key)
-{
-       struct ldlm_lock     *lock;
-
-       lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash);
-       lock->l_remote_handle = *(struct lustre_handle *)key;
-}
-
-static int
-ldlm_export_lock_keycmp(const void *key, struct hlist_node *hnode)
-{
-       return lustre_handle_equal(ldlm_export_lock_key(hnode), key);
-}
-
-static void *
-ldlm_export_lock_object(struct hlist_node *hnode)
-{
-       return hlist_entry(hnode, struct ldlm_lock, l_exp_hash);
-}
-
-static void
-ldlm_export_lock_get(struct cfs_hash *hs, struct hlist_node *hnode)
-{
-       struct ldlm_lock *lock;
-
-       lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash);
-       LDLM_LOCK_GET(lock);
-}
-
-static void
-ldlm_export_lock_put(struct cfs_hash *hs, struct hlist_node *hnode)
-{
-       struct ldlm_lock *lock;
-
-       lock = hlist_entry(hnode, struct ldlm_lock, l_exp_hash);
-       LDLM_LOCK_RELEASE(lock);
-}
-
-static cfs_hash_ops_t ldlm_export_lock_ops = {
-       .hs_hash        = ldlm_export_lock_hash,
-       .hs_key  = ldlm_export_lock_key,
-       .hs_keycmp      = ldlm_export_lock_keycmp,
-       .hs_keycpy      = ldlm_export_lock_keycpy,
-       .hs_object      = ldlm_export_lock_object,
-       .hs_get  = ldlm_export_lock_get,
-       .hs_put  = ldlm_export_lock_put,
-       .hs_put_locked  = ldlm_export_lock_put,
-};
-
-int ldlm_init_export(struct obd_export *exp)
-{
-       int rc;
-
-       exp->exp_lock_hash =
-               cfs_hash_create(obd_uuid2str(&exp->exp_client_uuid),
-                               HASH_EXP_LOCK_CUR_BITS,
-                               HASH_EXP_LOCK_MAX_BITS,
-                               HASH_EXP_LOCK_BKT_BITS, 0,
-                               CFS_HASH_MIN_THETA, CFS_HASH_MAX_THETA,
-                               &ldlm_export_lock_ops,
-                               CFS_HASH_DEFAULT | CFS_HASH_REHASH_KEY |
-                               CFS_HASH_NBLK_CHANGE);
-
-       if (!exp->exp_lock_hash)
-               return -ENOMEM;
-
-       rc = ldlm_init_flock_export(exp);
-       if (rc)
-               goto err;
-
-       return 0;
-err:
-       ldlm_destroy_export(exp);
-       return rc;
-}
-EXPORT_SYMBOL(ldlm_init_export);
-
-void ldlm_destroy_export(struct obd_export *exp)
-{
-       cfs_hash_putref(exp->exp_lock_hash);
-       exp->exp_lock_hash = NULL;
-
-       ldlm_destroy_flock_export(exp);
-}
-EXPORT_SYMBOL(ldlm_destroy_export);
-
 extern unsigned int ldlm_cancel_unused_locks_before_replay;
 
 static ssize_t cancel_unused_locks_before_replay_show(struct kobject *kobj,