From df38949063cae87d94876ebb3d46201998e1d170 Mon Sep 17 00:00:00 2001
From: pravins <pravins>
Date: Wed, 6 May 2009 12:44:36 +0000
Subject: [PATCH] b=16721 i=zam i=rread

create separate context to execute osd specific transaction to avoid mdd
callback related to stop/commit transaction.
---
 lustre/osd/osd_handler.c  | 11 ++++++++---
 lustre/osd/osd_internal.h |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c
index 454b9e3cfb..904b9d717a 100644
--- a/lustre/osd/osd_handler.c
+++ b/lustre/osd/osd_handler.c
@@ -523,17 +523,22 @@ static int osd_inode_remove(const struct lu_env *env, struct osd_object *obj)
         struct osd_device      *osd = osd_obj2dev(obj);
         struct osd_thread_info *oti = osd_oti_get(env);
         struct txn_param       *prm = &oti->oti_txn;
+        struct lu_env          *env_del_obj = &oti->oti_obj_delete_tx_env;
         struct thandle         *th;
         int result;
 
+        lu_env_init(env_del_obj, LCT_DT_THREAD);
         txn_param_init(prm, OSD_TXN_OI_DELETE_CREDITS +
                             OSD_TXN_INODE_DELETE_CREDITS);
-        th = osd_trans_start(env, &osd->od_dt_dev, prm);
+        th = osd_trans_start(env_del_obj, &osd->od_dt_dev, prm);
         if (!IS_ERR(th)) {
-                result = osd_oi_delete(oti, &osd->od_oi, fid, th);
-                osd_trans_stop(env, th);
+                result = osd_oi_delete(osd_oti_get(env_del_obj),
+                                       &osd->od_oi, fid, th);
+                osd_trans_stop(env_del_obj, th);
         } else
                 result = PTR_ERR(th);
+
+        lu_env_fini(env_del_obj);
         return result;
 }
 
diff --git a/lustre/osd/osd_internal.h b/lustre/osd/osd_internal.h
index df1600babd..6514dc7b70 100644
--- a/lustre/osd/osd_internal.h
+++ b/lustre/osd/osd_internal.h
@@ -241,6 +241,7 @@ struct osd_thread_info {
 #ifdef HAVE_QUOTA_SUPPORT
         struct osd_ctxt        oti_ctxt;
 #endif
+        struct lu_env          oti_obj_delete_tx_env;
 };
 
 #ifdef LPROCFS
-- 
GitLab