X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdd%2Fmdd_device.c;h=7dc67d12bfbe37676599c91ae114b6a16680d935;hb=1c4d3d360bc21569c59f7ff440df0ed355df89b3;hp=48da062449554379c6334f04baa3f0640b570353;hpb=de143794d1837ba33362f60f98a770d6a4dd514a;p=fs%2Flustre-release.git diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 48da062..7dc67d1 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -1270,6 +1270,25 @@ struct md_capainfo *md_capainfo(const struct lu_env *env) } EXPORT_SYMBOL(md_capainfo); +/* + * context key constructor/destructor: + * mdd_quota_key_init, mdd_quota_key_fini + */ +LU_KEY_INIT_FINI(mdd_quota, struct md_quota); + +struct lu_context_key mdd_quota_key = { + .lct_tags = LCT_SESSION, + .lct_init = mdd_quota_key_init, + .lct_fini = mdd_quota_key_fini +}; + +struct md_quota *md_quota(const struct lu_env *env) +{ + LASSERT(env->le_ses != NULL); + return lu_context_key_get(env->le_ses, &mdd_quota_key); +} +EXPORT_SYMBOL(md_quota); + static int mdd_changelog_user_register(struct mdd_device *mdd, int *id) { struct llog_ctxt *ctxt; @@ -1491,7 +1510,8 @@ static int mdd_iocontrol(const struct lu_env *env, struct md_device *m, } /* type constructor/destructor: mdd_type_init, mdd_type_fini */ -LU_TYPE_INIT_FINI(mdd, &mdd_thread_key, &mdd_ucred_key, &mdd_capainfo_key); +LU_TYPE_INIT_FINI(mdd, &mdd_thread_key, &mdd_ucred_key, &mdd_capainfo_key, + &mdd_quota_key); const struct md_device_operations mdd_ops = { .mdo_statfs = mdd_statfs,