]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging/lustre: Remove obd_export_evict_by_nid/uuid
authorOleg Drokin <green@linuxhacker.ru>
Sun, 27 Sep 2015 20:45:39 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:06:18 +0000 (04:06 +0200)
These functions only make sense on the server.

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

index 0bbe9f9b935e92f57ee8f093dbf2146864c30603..08ec2d016e40014024a8ef24cf745ebe3b630edc 100644 (file)
@@ -98,8 +98,6 @@ int class_notify_sptlrpc_conf(const char *fsname, int namelen);
 
 char *obd_export_nid2str(struct obd_export *exp);
 
-int obd_export_evict_by_nid(struct obd_device *obd, const char *nid);
-int obd_export_evict_by_uuid(struct obd_device *obd, const char *uuid);
 int obd_connect_flags2str(char *page, int count, __u64 flags, char *sep);
 
 int obd_zombie_impexp_init(void);
index 8a58b78cfdbf29dfcc90bc64ddac026c78d6da2c..44cb5bc64ce78b11fe70ab8c72d1a27a5d4e2f0b 100644 (file)
@@ -1278,96 +1278,6 @@ char *obd_export_nid2str(struct obd_export *exp)
 }
 EXPORT_SYMBOL(obd_export_nid2str);
 
-int obd_export_evict_by_nid(struct obd_device *obd, const char *nid)
-{
-       struct cfs_hash *nid_hash;
-       struct obd_export *doomed_exp = NULL;
-       int exports_evicted = 0;
-
-       lnet_nid_t nid_key = libcfs_str2nid((char *)nid);
-
-       spin_lock(&obd->obd_dev_lock);
-       /* umount has run already, so evict thread should leave
-        * its task to umount thread now */
-       if (obd->obd_stopping) {
-               spin_unlock(&obd->obd_dev_lock);
-               return exports_evicted;
-       }
-       nid_hash = obd->obd_nid_hash;
-       cfs_hash_getref(nid_hash);
-       spin_unlock(&obd->obd_dev_lock);
-
-       do {
-               doomed_exp = cfs_hash_lookup(nid_hash, &nid_key);
-               if (!doomed_exp)
-                       break;
-
-               LASSERTF(doomed_exp->exp_connection->c_peer.nid == nid_key,
-                        "nid %s found, wanted nid %s, requested nid %s\n",
-                        obd_export_nid2str(doomed_exp),
-                        libcfs_nid2str(nid_key), nid);
-               LASSERTF(doomed_exp != obd->obd_self_export,
-                        "self-export is hashed by NID?\n");
-               exports_evicted++;
-               LCONSOLE_WARN("%s: evicting %s (at %s) by administrative request\n",
-                             obd->obd_name,
-                             obd_uuid2str(&doomed_exp->exp_client_uuid),
-                             obd_export_nid2str(doomed_exp));
-               class_fail_export(doomed_exp);
-               class_export_put(doomed_exp);
-       } while (1);
-
-       cfs_hash_putref(nid_hash);
-
-       if (!exports_evicted)
-               CDEBUG(D_HA,
-                      "%s: can't disconnect NID '%s': no exports found\n",
-                      obd->obd_name, nid);
-       return exports_evicted;
-}
-EXPORT_SYMBOL(obd_export_evict_by_nid);
-
-int obd_export_evict_by_uuid(struct obd_device *obd, const char *uuid)
-{
-       struct cfs_hash *uuid_hash;
-       struct obd_export *doomed_exp = NULL;
-       struct obd_uuid doomed_uuid;
-       int exports_evicted = 0;
-
-       spin_lock(&obd->obd_dev_lock);
-       if (obd->obd_stopping) {
-               spin_unlock(&obd->obd_dev_lock);
-               return exports_evicted;
-       }
-       uuid_hash = obd->obd_uuid_hash;
-       cfs_hash_getref(uuid_hash);
-       spin_unlock(&obd->obd_dev_lock);
-
-       obd_str2uuid(&doomed_uuid, uuid);
-       if (obd_uuid_equals(&doomed_uuid, &obd->obd_uuid)) {
-               CERROR("%s: can't evict myself\n", obd->obd_name);
-               cfs_hash_putref(uuid_hash);
-               return exports_evicted;
-       }
-
-       doomed_exp = cfs_hash_lookup(uuid_hash, &doomed_uuid);
-
-       if (!doomed_exp) {
-               CERROR("%s: can't disconnect %s: no exports found\n",
-                      obd->obd_name, uuid);
-       } else {
-               CWARN("%s: evicting %s at administrative request\n",
-                      obd->obd_name, doomed_exp->exp_client_uuid.uuid);
-               class_fail_export(doomed_exp);
-               class_export_put(doomed_exp);
-               exports_evicted++;
-       }
-       cfs_hash_putref(uuid_hash);
-
-       return exports_evicted;
-}
-EXPORT_SYMBOL(obd_export_evict_by_uuid);
-
 #if LUSTRE_TRACKS_LOCK_EXP_REFS
 void (*class_export_dump_hook)(struct obd_export *) = NULL;
 EXPORT_SYMBOL(class_export_dump_hook);