Whamcloud - gitweb
LU-8726 osd-ldiskfs: bypass read for benchmarking
[fs/lustre-release.git] / lustre / lmv / lmv_intent.c
index 974f563..08a5a60 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -444,6 +440,9 @@ lmv_intent_lookup(struct obd_export *exp, struct md_op_data *op_data,
                }
        }
 
+       if (!it_has_reply_body(it))
+               RETURN(0);
+
        /*
         * MDS has returned success. Probably name has been resolved in
         * remote inode. Let's check this.
@@ -471,8 +470,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                    ldlm_blocking_callback cb_blocking,
                    __u64 extra_lock_flags)
 {
-       struct obd_device *obd = exp->exp_obd;
-       int                rc;
+       int rc;
        ENTRY;
 
        LASSERT(it != NULL);
@@ -483,11 +481,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
                (int)op_data->op_namelen, op_data->op_name,
                PFID(&op_data->op_fid1));
 
-       rc = lmv_check_connect(obd);
-       if (rc)
-               RETURN(rc);
-
-       if (it->it_op & (IT_LOOKUP | IT_GETATTR | IT_LAYOUT))
+       if (it->it_op & (IT_LOOKUP | IT_GETATTR | IT_LAYOUT | IT_GETXATTR))
                rc = lmv_intent_lookup(exp, op_data, it, reqp, cb_blocking,
                                       extra_lock_flags);
        else if (it->it_op & IT_OPEN)
@@ -501,8 +495,8 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 
                if (it->it_lock_mode != 0) {
                        lock_handle.cookie = it->it_lock_handle;
-                       ldlm_lock_decref(&lock_handle,
-                                        it->it_lock_mode);
+                       ldlm_lock_decref_and_cancel(&lock_handle,
+                                                   it->it_lock_mode);
                }
 
                it->it_lock_handle = 0;
@@ -510,8 +504,8 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 
                if (it->it_remote_lock_mode != 0) {
                        lock_handle.cookie = it->it_remote_lock_handle;
-                       ldlm_lock_decref(&lock_handle,
-                                        it->it_remote_lock_mode);
+                       ldlm_lock_decref_and_cancel(&lock_handle,
+                                                   it->it_remote_lock_mode);
                }
 
                it->it_remote_lock_handle = 0;