GOTO(out, rc = -EINVAL);
}
- if (!fid_is_norm(f) && !fid_is_igif(f) && !fid_is_root(f)) {
+ if (!fid_is_norm(f) && !fid_is_igif(f) && !fid_is_root(f) &&
+ !fid_seq_is_dot(f->f_seq)) {
CWARN("%s: "DFID" is invalid, sequence should be "
">= "LPX64" or within ["LPX64","LPX64"].\n",
mdd2obd_dev(mdd)->obd_name, PFID(f),
if (rc < 0)
GOTO(out_los, rc);
+ lu_root_fid(&fid);
if (mdd_seq_site(mdd)->ss_node_id == 0) {
- lu_root_fid(&fid);
rc = mdd_local_file_create(env, mdd, &mdd->mdd_local_root_fid,
mdd_root_dir_name, S_IFDIR |
S_IRUGO | S_IWUSR | S_IXUGO, &fid);
mdd2obd_dev(mdd)->obd_name, rc);
GOTO(out_los, rc);
}
- mdd->mdd_root_fid = fid;
+ mdd->mdd_root_fid = fid;
rc = mdd_dot_lustre_setup(env, mdd);
if (rc != 0) {
CERROR("%s: initializing .lustre failed: rc = %d\n",
if (rc)
GOTO(out_los, rc);
+ } else {
+ /* Normal client usually send root access to MDT0 directly,
+ * the root FID on non-MDT0 will only be used by echo client. */
+ mdd->mdd_root_fid = fid;
}
rc = orph_index_init(env, mdd);
* No permission check is needed.
*/
static int mdd_statfs(const struct lu_env *env, struct md_device *m,
- struct obd_statfs *sfs)
+ struct obd_statfs *sfs)
{
- struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
- int rc;
+ struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
+ int rc;
- ENTRY;
+ ENTRY;
- rc = mdd_child_ops(mdd)->dt_statfs(env, mdd->mdd_child, sfs);
+ rc = mdd_child_ops(mdd)->dt_statfs(env, mdd->mdd_child, sfs);
- RETURN(rc);
+ sfs->os_namelen = min_t(__u32, sfs->os_namelen, NAME_MAX);
+
+ RETURN(rc);
}
/*
struct mdd_device *m = lu2mdd_dev(lu);
ENTRY;
- LASSERT(cfs_atomic_read(&lu->ld_ref) == 0);
+ LASSERT(atomic_read(&lu->ld_ref) == 0);
md_device_fini(&m->mdd_md_dev);
OBD_FREE_PTR(m);
RETURN(NULL);
RETURN(rc);
}
-static int mdd_obd_health_check(const struct lu_env *env,
- struct obd_device *obd)
+static int mdd_obd_get_info(const struct lu_env *env, struct obd_export *exp,
+ __u32 keylen, void *key, __u32 *vallen, void *val,
+ struct lov_stripe_md *lsm)
{
- struct mdd_device *mdd = lu2mdd_dev(obd->obd_lu_dev);
- int rc;
- ENTRY;
+ int rc = -EINVAL;
+
+ if (KEY_IS(KEY_OSP_CONNECTED)) {
+ struct obd_device *obd = exp->exp_obd;
+ struct mdd_device *mdd;
+
+ if (!obd->obd_set_up || obd->obd_stopping)
+ RETURN(-EAGAIN);
+
+ mdd = lu2mdd_dev(obd->obd_lu_dev);
+ LASSERT(mdd);
+ rc = obd_get_info(env, mdd->mdd_child_exp, keylen, key, vallen,
+ val, lsm);
+ RETURN(rc);
+ }
- LASSERT(mdd);
- rc = obd_health_check(env, mdd->mdd_child_exp->exp_obd);
RETURN(rc);
}
.o_owner = THIS_MODULE,
.o_connect = mdd_obd_connect,
.o_disconnect = mdd_obd_disconnect,
- .o_health_check = mdd_obd_health_check
-};
-
-/*
- * context key constructor/destructor:
- * mdd_capainfo_key_init, mdd_capainfo_key_fini
- */
-LU_KEY_INIT_FINI(mdd_capainfo, struct md_capainfo);
-
-struct lu_context_key mdd_capainfo_key = {
- .lct_tags = LCT_SESSION,
- .lct_init = mdd_capainfo_key_init,
- .lct_fini = mdd_capainfo_key_fini
+ .o_get_info = mdd_obd_get_info,
};
-struct md_capainfo *md_capainfo(const struct lu_env *env)
-{
- /* NB, in mdt_init0 */
- if (env->le_ses == NULL)
- return NULL;
- return lu_context_key_get(env->le_ses, &mdd_capainfo_key);
-}
-EXPORT_SYMBOL(md_capainfo);
-
static int mdd_changelog_user_register(const struct lu_env *env,
struct mdd_device *mdd, int *id)
{
}
/* type constructor/destructor: mdd_type_init, mdd_type_fini */
-LU_TYPE_INIT_FINI(mdd, &mdd_thread_key, &mdd_capainfo_key);
+LU_TYPE_INIT_FINI(mdd, &mdd_thread_key);
const struct md_device_operations mdd_ops = {
.mdo_statfs = mdd_statfs,
hsm_actions_logops.lop_add = llog_cat_add_rec;
hsm_actions_logops.lop_declare_add = llog_cat_declare_add_rec;
- rc = class_register_type(&mdd_obd_device_ops, NULL, lvars.module_vars,
- LUSTRE_MDD_NAME, &mdd_device_type);
+ rc = class_register_type(&mdd_obd_device_ops, NULL, NULL,
+#ifndef HAVE_ONLY_PROCFS_SEQ
+ lvars.module_vars,
+#endif
+ LUSTRE_MDD_NAME, &mdd_device_type);
if (rc)
lu_kmem_fini(mdd_caches);
return rc;