+
+ push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ rc = llog_write_rec(mds->mds_cfg_llh, &rec, NULL, 0,
+ cfg_buf, -1);
+ pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+
+ OBD_FREE(cfg_buf, data->ioc_plen1);
+ RETURN(rc);
+ }
+
+ case OBD_IOC_PARSE: {
+ struct llog_ctxt *ctxt =
+ llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
+ push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ rc = class_config_parse_llog(ctxt, data->ioc_inlbuf1, NULL);
+ pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ if (rc)
+ RETURN(rc);
+
+ RETURN(rc);
+ }
+
+ case OBD_IOC_DUMP_LOG: {
+ struct llog_ctxt *ctxt =
+ llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
+ push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ rc = class_config_dump_llog(ctxt, data->ioc_inlbuf1, NULL);
+ pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ if (rc)
+ RETURN(rc);
+
+ RETURN(rc);
+ }
+
+ case OBD_IOC_SET_READONLY: {
+ void *handle;
+ struct inode *inode = obd->u.mds.mds_sb->s_root->d_inode;
+ BDEVNAME_DECLARE_STORAGE(tmp);
+ CERROR("setting device %s read-only\n",
+ ll_bdevname(obd->u.mds.mds_sb, tmp));
+
+ handle = fsfilt_start(obd, inode, FSFILT_OP_MKNOD, NULL);
+ LASSERT(handle);
+ rc = fsfilt_commit(obd, inode, handle, 1);
+
+ dev_set_rdonly(ll_sbdev(obd->u.mds.mds_sb), 2);
+ RETURN(0);
+ }
+
+ case OBD_IOC_CATLOGLIST: {
+ int count = mds->mds_lov_desc.ld_tgt_count;
+ rc = llog_catlog_list(obd, count, data);
+ RETURN(rc);
+
+ }
+ case OBD_IOC_LLOG_CHECK:
+ case OBD_IOC_LLOG_CANCEL:
+ case OBD_IOC_LLOG_REMOVE: {
+ struct llog_ctxt *ctxt =
+ llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
+ int rc2;
+
+ obd_llog_finish(obd, &obd->obd_llogs,
+ mds->mds_lov_desc.ld_tgt_count);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ rc = llog_ioctl(ctxt, cmd, data);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ llog_cat_initialize(obd, &obd->obd_llogs,
+ mds->mds_lov_desc.ld_tgt_count);
+ rc2 = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"), "mds_conn",
+ 0, NULL);
+ if (!rc)
+ rc = rc2;
+ RETURN(rc);
+ }
+ case OBD_IOC_LLOG_INFO:
+ case OBD_IOC_LLOG_PRINT: {
+ struct llog_ctxt *ctxt =
+ llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
+
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ rc = llog_ioctl(ctxt, cmd, data);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);