memcpy(&oa.o_inline, ost_uuid, sizeof(*ost_uuid));
oa.o_valid |= OBD_MD_FLINLINE;
}
- rc = obd_create(mds->mds_osc_exp, &oa, &empty_ea, &oti);
+ rc = obd_create(mds->mds_lov_exp, &oa, &empty_ea, &oti);
RETURN(rc);
}
LASSERT(mds->mds_lov_objids != NULL);
- rc = obd_set_info(mds->mds_osc_exp, strlen("next_id"), "next_id",
+ rc = obd_set_info(mds->mds_lov_exp, strlen("next_id"), "next_id",
mds->mds_lov_desc.ld_tgt_count, mds->mds_lov_objids);
RETURN(rc);
}
int rc;
ENTRY;
- rc = obd_set_info(mds->mds_osc_exp, strlen("growth_count"),
+ rc = obd_set_info(mds->mds_lov_exp, strlen("growth_count"),
"growth_count", sizeof(count), &count);
RETURN(rc);
{
struct mds_obd *mds = &obd->u.mds;
struct lustre_handle conn = {0,};
- char name[32] = "CATLIST";
- int rc, i, valsize;
- __u32 group;
+ int rc, i;
ENTRY;
- if (IS_ERR(mds->mds_osc_obd))
- RETURN(PTR_ERR(mds->mds_osc_obd));
+ if (IS_ERR(mds->mds_lov_obd))
+ RETURN(PTR_ERR(mds->mds_lov_obd));
- if (mds->mds_osc_obd)
+ if (mds->mds_lov_obd)
RETURN(0);
spin_lock_init(&mds->mds_lov_lock);
- mds->mds_osc_obd = class_name2obd(lov_name);
- if (!mds->mds_osc_obd) {
- CERROR("MDS cannot locate LOV %s\n",
- lov_name);
- mds->mds_osc_obd = ERR_PTR(-ENOTCONN);
+ mds->mds_lov_obd = class_name2obd(lov_name);
+ if (!mds->mds_lov_obd) {
+ CERROR("MDS cannot locate LOV %s\n", lov_name);
+ mds->mds_lov_obd = ERR_PTR(-ENOTCONN);
RETURN(-ENOTCONN);
}
CDEBUG(D_HA, "obd: %s osc: %s lov_name: %s\n",
- obd->obd_name, mds->mds_osc_obd->obd_name, lov_name);
+ obd->obd_name, mds->mds_lov_obd->obd_name, lov_name);
- rc = obd_connect(&conn, mds->mds_osc_obd, &obd->obd_uuid,
+ rc = obd_connect(&conn, mds->mds_lov_obd, &obd->obd_uuid,
mds->mds_num + FILTER_GROUP_FIRST_MDS);
if (rc) {
- CERROR("MDS cannot connect to LOV %s (%d)\n",
- lov_name, rc);
- mds->mds_osc_obd = ERR_PTR(rc);
+ CERROR("MDS cannot connect to LOV %s (%d)\n", lov_name, rc);
+ mds->mds_lov_obd = ERR_PTR(rc);
RETURN(rc);
}
- mds->mds_osc_exp = class_conn2export(&conn);
+ mds->mds_lov_exp = class_conn2export(&conn);
- rc = obd_register_observer(mds->mds_osc_obd, obd);
+ rc = obd_register_observer(mds->mds_lov_obd, obd);
if (rc) {
CERROR("MDS cannot register as observer of LOV %s (%d)\n",
lov_name, rc);
GOTO(err_discon, rc);
}
- rc = mds_lov_update_desc(obd, mds->mds_osc_exp);
+ rc = mds_lov_update_desc(obd, mds->mds_lov_exp);
if (rc)
GOTO(err_reg, rc);
}
rc = obd_llog_cat_initialize(obd, &obd->obd_llogs,
- mds->mds_lov_desc.ld_tgt_count, name);
+ mds->mds_lov_desc.ld_tgt_count, CATLIST);
if (rc) {
CERROR("failed to initialize catalog %d\n", rc);
GOTO(err_reg, rc);
}
- /* FIXME before set info call is made, we must initialize logging */
- group = FILTER_GROUP_FIRST_MDS + mds->mds_num;
- valsize = sizeof(group);
- rc = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"), "mds_conn",
- valsize, &group);
- if (rc)
- GOTO(err_reg, rc);
-
/* If we're mounting this code for the first time on an existing FS,
* we need to populate the objids array from the real OST values */
if (!mds->mds_lov_objids_valid) {
int size = sizeof(obd_id) * mds->mds_lov_desc.ld_tgt_count;
- rc = obd_get_info(mds->mds_osc_exp, strlen("last_id"),
+ rc = obd_get_info(mds->mds_lov_exp, strlen("last_id"),
"last_id", &size, mds->mds_lov_objids);
if (!rc) {
for (i = 0; i < mds->mds_lov_desc.ld_tgt_count; i++)
RETURN(rc);
err_reg:
- obd_register_observer(mds->mds_osc_obd, NULL);
+ obd_register_observer(mds->mds_lov_obd, NULL);
err_discon:
- obd_disconnect(mds->mds_osc_exp, 0);
- mds->mds_osc_exp = NULL;
- mds->mds_osc_obd = ERR_PTR(rc);
+ obd_disconnect(mds->mds_lov_exp, 0);
+ mds->mds_lov_exp = NULL;
+ mds->mds_lov_obd = ERR_PTR(rc);
RETURN(rc);
}
int rc = 0;
ENTRY;
- if (!IS_ERR(mds->mds_osc_obd) && mds->mds_osc_exp != NULL) {
+ if (!IS_ERR(mds->mds_lov_obd) && mds->mds_lov_exp != NULL) {
/* cleanup all llogging subsystems */
rc = obd_llog_finish(obd, &obd->obd_llogs,
mds->mds_lov_desc.ld_tgt_count);
if (rc)
CERROR("failed to cleanup llogging subsystems\n");
- obd_register_observer(mds->mds_osc_obd, NULL);
+ obd_register_observer(mds->mds_lov_obd, NULL);
- rc = obd_disconnect(mds->mds_osc_exp, flags);
+ rc = obd_disconnect(mds->mds_lov_exp, flags);
/* if obd_disconnect fails (probably because the
* export was disconnected by class_disconnect_exports)
* then we just need to drop our ref. */
if (rc != 0)
- class_export_put(mds->mds_osc_exp);
- mds->mds_osc_exp = NULL;
- mds->mds_osc_obd = NULL;
+ class_export_put(mds->mds_lov_exp);
+ mds->mds_lov_exp = NULL;
+ mds->mds_lov_obd = NULL;
}
RETURN(rc);
OBD_FREE(cfg_buf, data->ioc_plen1);
RETURN(rc);
}
- case OBD_IOC_SNAP_ADD: {
- char *name = data->ioc_inlbuf1;
- if (name) {
- rc = fsfilt_set_snap_item(obd, mds->mds_sb, name);
- }
- RETURN(rc);
- }
case OBD_IOC_PARSE: {
struct llog_ctxt *ctxt =
llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
RETURN(rc);
}
-
case OBD_IOC_DUMP_LOG: {
struct llog_ctxt *ctxt =
llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
RETURN(rc);
}
-
case OBD_IOC_SET_READONLY: {
void *handle;
struct inode *inode = obd->u.mds.mds_sb->s_root->d_inode;
case OBD_IOC_LLOG_REMOVE: {
struct llog_ctxt *ctxt =
llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
- char name[32] = "CATLIST";
- int rc2;
+ int rc2, valsize;
+ __u32 group;
obd_llog_finish(obd, &obd->obd_llogs,
mds->mds_lov_desc.ld_tgt_count);
pop_ctxt(&saved, ctxt->loc_lvfs_ctxt, NULL);
obd_llog_cat_initialize(obd, &obd->obd_llogs,
mds->mds_lov_desc.ld_tgt_count,
- name);
- rc2 = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"),
- "mds_conn", 0, NULL);
+ CATLIST);
+ group = FILTER_GROUP_FIRST_MDS + mds->mds_num;
+ valsize = sizeof(group);
+ rc2 = obd_set_info(mds->mds_lov_exp, strlen("mds_conn"),
+ "mds_conn", valsize, &group);
if (!rc)
rc = rc2;
RETURN(rc);
case OBD_IOC_ABORT_RECOVERY:
target_stop_recovery_thread(obd);
RETURN(0);
+ case OBD_IOC_ROOT_SQUASH: {
+ __u32 *p = (__u32 *) data->ioc_inlbuf1;
+
+ if (data->ioc_inllen1 !=
+ (sizeof(__u32) * 4 + sizeof(ptl_nid_t)))
+ RETURN(-EINVAL);
+ if (*p == 0) { /* get */
+ p += 2;
+ *p++ = mds->mds_squash_uid;
+ *p++ = mds->mds_squash_gid;
+ *((ptl_nid_t*) p) = mds->mds_nosquash_nid;
+ } else { /* set */
+ p += 2;
+ mds->mds_squash_uid = *p++;
+ mds->mds_squash_gid = *p++;
+ mds->mds_nosquash_nid = *((ptl_nid_t*) p);
+ CWARN("MDS: squash root to %d:%d, except nid 0x%llx\n",
+ mds->mds_squash_uid, mds->mds_squash_gid,
+ mds->mds_nosquash_nid);
+ }
+ RETURN(0);
+ }
default:
RETURN(-EINVAL);
}
old_count = mds->mds_lov_desc.ld_tgt_count;
- rc = mds_lov_update_desc(obd, mds->mds_osc_exp);
+ rc = mds_lov_update_desc(obd, mds->mds_lov_exp);
if (rc)
RETURN(rc);
if (!active)
RETURN(0);
+ if (!strcmp(watched->obd_type->typ_name, LUSTRE_MDC_NAME))
+ RETURN(0);
+
if (strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME)) {
CERROR("unexpected notification of %s %s!\n",
watched->obd_type->typ_name, watched->obd_name);
ctxt = llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
rc = class_config_process_llog(ctxt, name, &cfg);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- if (rc == 0) {
+ if (rc == 0)
mds->mds_config_version = version;
- }
CWARN("Finished applying configuration log %s: %d\n", name, rc);
OBD_FREE(name, namelen);
if (le32_to_cpu(lmm->lmm_magic) == LOV_MAGIC)
RETURN(0);
- CWARN("converting LOV EA on %lu/%u from V0 to V1\n",
- inode->i_ino, inode->i_generation);
- rc = obd_unpackmd(obd->u.mds.mds_osc_exp, &lsm, lmm, lmm_size);
+ CDEBUG(D_INODE, "converting LOV EA on %lu/%u from V0 to V1\n",
+ inode->i_ino, inode->i_generation);
+ rc = obd_unpackmd(obd->u.mds.mds_lov_exp, &lsm, lmm, lmm_size);
if (rc < 0)
GOTO(conv_end, rc);
- rc = obd_packmd(obd->u.mds.mds_osc_exp, &lmm, lsm);
+ rc = obd_packmd(obd->u.mds.mds_lov_exp, &lmm, lsm);
if (rc < 0)
GOTO(conv_free, rc);
lmm_size = rc;
rc = err ? err : lmm_size;
GOTO(conv_free, rc);
conv_free:
- obd_free_memmd(obd->u.mds.mds_osc_exp, &lsm);
+ obd_free_memmd(obd->u.mds.mds_lov_exp, &lsm);
conv_end:
return rc;
}
struct lustre_msg *msg, int offset)
{
struct mds_obd *mds = &obd->u.mds;
- struct obd_export *osc_exp = mds->mds_osc_exp;
+ struct obd_export *osc_exp = mds->mds_lov_exp;
struct lov_mds_md *lmm= NULL;
struct lov_stripe_md *lsm = NULL;
struct obdo *oa;