#define DEBUG_SUBSYSTEM S_MDS
#include <linux/kthread.h>
-#include <obd_class.h>
+
#include <lustre_ioctl.h>
-#include <lustre_param.h>
#include <lustre_log.h>
+#include <lustre_obdo.h>
+#include <lustre_param.h>
+#include <obd_class.h>
#include "osp_internal.h"
struct obd_statfs *sfs)
{
struct osp_device *d = dt2osp_dev(dev);
+ struct obd_import *imp = d->opd_obd->u.cli.cl_import;
ENTRY;
+ if (imp->imp_state == LUSTRE_IMP_CLOSED)
+ RETURN(-ESHUTDOWN);
+
if (unlikely(d->opd_imp_active == 0))
RETURN(-ENOTCONN);
case IMP_EVENT_INACTIVE:
d->opd_imp_active = 0;
d->opd_imp_connected = 0;
+ d->opd_obd->obd_inactive = 1;
if (d->opd_connect_mdt)
break;
d->opd_new_connection = 1;
d->opd_imp_connected = 1;
d->opd_imp_seen_connected = 1;
+ d->opd_obd->obd_inactive = 0;
if (d->opd_connect_mdt)
break;
CDEBUG(D_HA, "got connected\n");
break;
case IMP_EVENT_INVALIDATE:
+ if (d->opd_connect_mdt)
+ osp_invalidate_request(d);
+
if (obd->obd_namespace == NULL)
break;
ldlm_namespace_cleanup(obd->obd_namespace, LDLM_FL_LOCAL_ONLY);
* \retval negative negative errno if the ioctl handling failed.
*/
static int osp_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
- void *karg, void *uarg)
+ void *karg, void __user *uarg)
{
struct obd_device *obd = exp->exp_obd;
struct osp_device *d;
* \retval 0 0 if initialization succeeds.
* \retval negative negative errno if initialization failed.
*/
-static int __init osp_mod_init(void)
+static int __init osp_init(void)
{
struct obd_type *type;
int rc;
* This callback is called when kernel unloads OSP module from memory, and
* it will deregister OSP and LWP device type from obd_types (\see class_obd.c).
*/
-static void __exit osp_mod_exit(void)
+static void __exit osp_exit(void)
{
class_unregister_type(LUSTRE_LWP_NAME);
class_unregister_type(LUSTRE_OSP_NAME);
}
MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>");
-MODULE_DESCRIPTION("Lustre OST Proxy Device ("LUSTRE_OSP_NAME")");
+MODULE_DESCRIPTION("Lustre OSD Storage Proxy ("LUSTRE_OSP_NAME")");
MODULE_VERSION(LUSTRE_VERSION_STRING);
MODULE_LICENSE("GPL");
-module_init(osp_mod_init);
-module_exit(osp_mod_exit);
+module_init(osp_init);
+module_exit(osp_exit);