From 1341d2a46b00c7f2a4508004f4dd36e11040e73a Mon Sep 17 00:00:00 2001 From: wangdi Date: Wed, 11 Oct 2006 16:08:05 +0000 Subject: [PATCH] Branch: b_new_cmd use ma in cmm_thread_info, not allocate MA --- lustre/cmm/cmm_split.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lustre/cmm/cmm_split.c b/lustre/cmm/cmm_split.c index b32065d..0555565 100644 --- a/lustre/cmm/cmm_split.c +++ b/lustre/cmm/cmm_split.c @@ -447,17 +447,14 @@ static struct lu_buf *cmm_buf_get(const struct lu_env *env, void *area, int cml_try_to_split(const struct lu_env *env, struct md_object *mo) { struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo)); - struct md_attr *ma; + struct md_attr *ma = &cmm_env_info(env)->cmi_ma; struct lu_buf *buf; int rc = 0; ENTRY; LASSERT(S_ISDIR(lu_object_attr(&mo->mo_lu))); - - OBD_ALLOC_PTR(ma); - if (ma == NULL) - RETURN(-ENOMEM); - + + memset(ma, 0, sizeof(*ma)); ma->ma_need = MA_INODE|MA_LMV; rc = mo_attr_get(env, mo, ma); if (rc) @@ -494,7 +491,7 @@ int cml_try_to_split(const struct lu_env *env, struct md_object *mo) cleanup: if (ma->ma_lmv_size && ma->ma_lmv) OBD_FREE(ma->ma_lmv, ma->ma_lmv_size); - - OBD_FREE_PTR(ma); + RETURN(rc); } + -- 1.8.3.1