Whamcloud - gitweb
LU-7403 obd: const correct md_set_lock_data()
[fs/lustre-release.git] / lustre / mdc / mdc_locks.c
index 115a733..53c74e7 100644 (file)
@@ -99,8 +99,8 @@ int it_open_error(int phase, struct lookup_intent *it)
 EXPORT_SYMBOL(it_open_error);
 
 /* this must be called on a lockh that is known to have a referenced lock */
-int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
-                      __u64 *bits)
+int mdc_set_lock_data(struct obd_export *exp, const struct lustre_handle *lockh,
+                     void *data, __u64 *bits)
 {
        struct ldlm_lock *lock;
        struct inode *new_inode = data;
@@ -109,10 +109,10 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
         if(bits)
                 *bits = 0;
 
-        if (!*lockh)
-                RETURN(0);
+       if (!lustre_handle_is_used(lockh))
+               RETURN(0);
 
-        lock = ldlm_handle2lock((struct lustre_handle *)lockh);
+       lock = ldlm_handle2lock(lockh);
 
         LASSERT(lock != NULL);
         lock_res_and_lock(lock);