From b5336a6505cbd5abe75f0c26fe2ca0556370b1c0 Mon Sep 17 00:00:00 2001
From: green <green>
Date: Mon, 15 Mar 2004 20:55:58 +0000
Subject: [PATCH] b=2926 r=phik Make mds_reint_create to use mds_lock_new_child
 everywhere instead of taking the lock (and incorrect one) on its own.

---
 lustre/mds/mds_reint.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c
index 40c49f35fd..9e5f972071 100644
--- a/lustre/mds/mds_reint.c
+++ b/lustre/mds/mds_reint.c
@@ -655,9 +655,6 @@ static int mds_reint_create(struct mds_update_record *rec, int offset,
                                inode->i_ino, inode->i_generation);
                 } else {
                         struct lustre_handle child_ino_lockh;
-                        struct ldlm_res_id child_res_id =
-                             { .name = { inode->i_ino, 0 } };
-                        int lock_flags = 0;
 
                         CDEBUG(D_INODE, "created ino %lu with gen %x\n",
                                inode->i_ino, inode->i_generation);
@@ -668,12 +665,7 @@ static int mds_reint_create(struct mds_update_record *rec, int offset,
                          * in unlink, to avoid replay problems if this reply
                          * makes it out to the client but the unlink's does not.
                          * See bug 2029 for more detail.*/
-                        rc = ldlm_cli_enqueue(NULL, NULL, obd->obd_namespace,
-                                              child_res_id, LDLM_PLAIN, NULL,
-                                              LCK_EX, &lock_flags,
-                                              mds_blocking_ast,
-                                              ldlm_completion_ast, NULL, NULL,
-                                              NULL, 0, NULL, &child_ino_lockh);
+                        rc = mds_lock_new_child(obd, inode, &child_ino_lockh);
                         if (rc != ELDLM_OK) {
                                 CERROR("error locking for unlink/create sync: "
                                        "%d\n", rc);
-- 
GitLab