From: Oleg Drokin <green@xxxxxxxxxxxxxx> These functions only make sense on the server. Signed-off-by: Oleg Drokin <green@xxxxxxxxxxxxxx> --- drivers/staging/lustre/lustre/include/obd_class.h | 2 - drivers/staging/lustre/lustre/obdclass/genops.c | 90 ----------------------- 2 files changed, 92 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 0bbe9f9..08ec2d0 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -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); diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 8a58b78..44cb5bc 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -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); -- 2.1.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel