#include <lu_object.h>
#include <lustre_param.h>
#include <lustre_fid.h>
+#include <lustre_nodemap.h>
#include "mdd_internal.h"
const char *dev;
ENTRY;
+ /* LU-8040 Set defaults here, before values configs */
+ mdd->mdd_cl.mc_flags = 0; /* off by default */
+ mdd->mdd_cl.mc_mask = CHANGELOG_DEFMASK;
+
dev = lustre_cfg_string(lcfg, 0);
if (dev == NULL)
RETURN(rc);
if (rc)
GOTO(out_cleanup, rc);
- rc = llog_cat_init_and_process(env, ctxt->loc_handle);
+ rc = llog_init_handle(env, ctxt->loc_handle, LLOG_F_IS_CAT, NULL);
if (rc)
GOTO(out_close, rc);
uctxt->loc_handle->lgh_logops->lop_add = llog_cat_add_rec;
uctxt->loc_handle->lgh_logops->lop_declare_add = llog_cat_declare_add_rec;
- rc = llog_cat_init_and_process(env, uctxt->loc_handle);
+ rc = llog_init_handle(env, uctxt->loc_handle, LLOG_F_IS_CAT, NULL);
if (rc)
GOTO(out_uclose, rc);
mdd->mdd_cl.mc_index = 0;
spin_lock_init(&mdd->mdd_cl.mc_lock);
mdd->mdd_cl.mc_starttime = cfs_time_current_64();
- mdd->mdd_cl.mc_flags = 0; /* off by default */
- mdd->mdd_cl.mc_mask = CHANGELOG_DEFMASK;
spin_lock_init(&mdd->mdd_cl.mc_user_lock);
mdd->mdd_cl.mc_lastuser = 0;
GOTO(out_cleanup, rc);
}
- rc = llog_cat_init_and_process(env, ctxt->loc_handle);
+ rc = llog_init_handle(env, ctxt->loc_handle, LLOG_F_IS_CAT, NULL);
if (rc)
GOTO(out_close, rc);
mdd_changelog_fini(env, m);
orph_index_fini(env, m);
mdd_dot_lustre_cleanup(env, m);
+ nm_config_file_deregister_tgt(env, mdd2obd_dev(m)->u.obt.obt_nodemap_config_file);
if (m->mdd_los != NULL) {
local_oid_storage_fini(env, m->mdd_los);
m->mdd_los = NULL;
struct lu_device *pdev,
struct lu_device *cdev)
{
- struct mdd_device *mdd = lu2mdd_dev(cdev);
- struct lu_device *next = &mdd->mdd_child->dd_lu_dev;
- struct lu_fid fid;
- int rc;
+ struct mdd_device *mdd = lu2mdd_dev(cdev);
+ struct lu_device *next = &mdd->mdd_child->dd_lu_dev;
+ struct nm_config_file *nodemap_config;
+ struct lu_fid fid;
+ int rc;
ENTRY;
if (rc != 0)
GOTO(out_changelog, rc);
+ nodemap_config = nm_config_file_register_tgt(env, mdd->mdd_bottom,
+ mdd->mdd_los);
+ if (IS_ERR(nodemap_config))
+ GOTO(out_hsm, rc = PTR_ERR(nodemap_config));
+
+ mdd2obd_dev(mdd)->u.obt.obt_nodemap_config_file = nodemap_config;
+
rc = lfsck_register(env, mdd->mdd_bottom, mdd->mdd_child,
mdd2obd_dev(mdd), mdd_lfsck_out_notify,
mdd, true);
if (rc != 0) {
CERROR("%s: failed to initialize lfsck: rc = %d\n",
mdd2obd_dev(mdd)->obd_name, rc);
- GOTO(out_hsm, rc);
+ GOTO(out_nodemap, rc);
}
+
RETURN(0);
+
+out_nodemap:
+ nm_config_file_deregister_tgt(env, mdd2obd_dev(mdd)->u.obt.obt_nodemap_config_file);
+ mdd2obd_dev(mdd)->u.obt.obt_nodemap_config_file = NULL;
out_hsm:
mdd_hsm_actions_llog_fini(env, mdd);
out_changelog:
(struct lfsck_stop *)karg);
RETURN(rc);
}
- }
+ case OBD_IOC_QUERY_LFSCK: {
+ rc = lfsck_query(env, mdd->mdd_bottom, NULL, NULL,
+ (struct lfsck_query *)karg);
+ RETURN(rc);
+ }
+ }
/* Below ioctls use obd_ioctl_data */
if (len != sizeof(*data)) {