]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: lustre: include: Convert macro class_export_lock_put into static inline...
authorKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Sat, 17 Oct 2015 16:19:46 +0000 (18:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 03:16:37 +0000 (20:16 -0700)
Static inline functions are preferred over macros. This change is safe
because the types of arguments at all the call sites are same.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd_class.h

index ea2b66764a3de9dff9b71eaa3fbfe84b893c748f..f5d0a98b73f0c521f3fd7408debc050c07123ecc 100644 (file)
@@ -233,15 +233,16 @@ static inline struct obd_export *class_export_lock_get(struct obd_export *exp,
        return class_export_get(exp);
 }
 
-#define class_export_lock_put(exp, lock)                               \
-({                                                                   \
-       LASSERT_ATOMIC_POS(&exp->exp_locks_count);                    \
-       atomic_dec(&(exp)->exp_locks_count);                    \
-       __class_export_del_lock_ref(exp, lock);                  \
-       CDEBUG(D_INFO, "lock PUTting export %p : new locks_count %d\n", \
-              (exp), atomic_read(&(exp)->exp_locks_count));    \
-       class_export_put(exp);                                    \
-})
+static inline void class_export_lock_put(struct obd_export *exp,
+                                        struct ldlm_lock *lock)
+{
+       LASSERT_ATOMIC_POS(&exp->exp_locks_count);
+       atomic_dec(&(exp)->exp_locks_count);
+       __class_export_del_lock_ref(exp, lock);
+       CDEBUG(D_INFO, "lock PUTting export %p : new locks_count %d\n",
+              (exp), atomic_read(&(exp)->exp_locks_count));
+       class_export_put(exp);
+}
 
 #define class_export_cb_get(exp)                                       \
 ({                                                                   \