* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Intel, Inc.
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <obd_class.h>
#include <lustre_param.h>
+#include <lustre_log.h>
#include "osp_internal.h"
if (rc)
GOTO(out, rc);
}
+ CDEBUG(D_HA, "%s: Read last used ID: "LPU64"\n", m->opd_obd->obd_name,
+ le64_to_cpu(m->opd_last_used_id));
RETURN(0);
out:
CERROR("%s: can't initialize lov_objid: %d\n",
* of the cleanup RPCs fails (e.g. ldlm cancel, etc). We don't
* fully deactivate the import, or that would drop all requests. */
LASSERT(imp != NULL);
- cfs_spin_lock(&imp->imp_lock);
+ spin_lock(&imp->imp_lock);
imp->imp_deactive = 1;
- cfs_spin_unlock(&imp->imp_lock);
+ spin_unlock(&imp->imp_lock);
ptlrpc_deactivate_import(imp);
(void)ptlrpc_pinger_del_import(imp);
rc = ptlrpc_disconnect_import(imp, 0);
- if (rc && rc != -ETIMEDOUT)
+ if (rc == -ETIMEDOUT || rc == -ENOTCONN || rc == -ESHUTDOWN)
+ rc = 0;
+ if (rc)
CERROR("%s: can't disconnect: rc = %d\n",
d->opd_obd->obd_name, rc);
* layer above osp (usually lod) can use ffree to estimate
* how many objects are available for immediate creation
*/
- cfs_spin_lock(&d->opd_pre_lock);
+ spin_lock(&d->opd_pre_lock);
sfs->os_fprecreated = d->opd_pre_last_created - d->opd_pre_used_id;
sfs->os_fprecreated -= d->opd_pre_reserved;
- cfs_spin_unlock(&d->opd_pre_lock);
+ spin_unlock(&d->opd_pre_lock);
- LASSERT(sfs->os_fprecreated <= OST_MAX_PRECREATE);
+ LASSERT(sfs->os_fprecreated <= OST_MAX_PRECREATE * 2);
CDEBUG(D_OTHER, "%s: "LPU64" blocks, "LPU64" free, "LPU64" avail, "
LPU64" files, "LPU64" free files\n", d->opd_obd->obd_name,
OBD_CONNECT_REQPORTAL |
OBD_CONNECT_SKIP_ORPHAN |
OBD_CONNECT_VERSION |
- OBD_CONNECT_FID;
+ OBD_CONNECT_FID |
+ OBD_CONNECT_LVB_TYPE;
if (is_osp_on_ost(osp->opd_obd->obd_name))
ocd->ocd_connect_flags |= OBD_CONNECT_LIGHTWEIGHT;
/* Since the request might also come from lprocfs, so we need
* sync this with client_disconnect_export Bug15684 */
- cfs_down_read(&exp->exp_obd->u.cli.cl_sem);
+ down_read(&exp->exp_obd->u.cli.cl_sem);
if (exp->exp_obd->u.cli.cl_import)
imp = class_import_get(exp->exp_obd->u.cli.cl_import);
- cfs_up_read(&exp->exp_obd->u.cli.cl_sem);
+ up_read(&exp->exp_obd->u.cli.cl_sem);
if (!imp)
RETURN(-ENODEV);
ldlm_namespace_cleanup(obd->obd_namespace, LDLM_FL_LOCAL_ONLY);
break;
case IMP_EVENT_OCD:
+ case IMP_EVENT_DEACTIVATE:
+ case IMP_EVENT_ACTIVATE:
break;
default:
CERROR("%s: unsupported import event: %#x\n",
.o_statfs = osp_obd_statfs,
};
+struct llog_operations osp_mds_ost_orig_logops;
+
static int __init osp_mod_init(void)
{
struct lprocfs_static_vars lvars;
return rc;
}
+ /* Note: add_rec/delcare_add_rec will be only used by catalogs */
+ osp_mds_ost_orig_logops = llog_osd_ops;
+ osp_mds_ost_orig_logops.lop_add = llog_cat_add_rec;
+ osp_mds_ost_orig_logops.lop_declare_add = llog_cat_declare_add_rec;
+
osc_proc_dir = lprocfs_srch(proc_lustre_root, "osc");
if (osc_proc_dir == NULL) {
osc_proc_dir = lprocfs_register("osc", proc_lustre_root, NULL,