Staging: lustre: include: Convert macro class_export_lock_get into static inline...
authorKsenija Stanojevic <ksenija.stanojevic@gmail.com>
Sat, 17 Oct 2015 16:18:34 +0000 (18:18 +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 0b4cdbcbadbd3c99a1709fe3e11882fb222bfad0..ea2b66764a3de9dff9b71eaa3fbfe84b893c748f 100644 (file)
@@ -223,14 +223,15 @@ static inline void class_export_rpc_dec(struct obd_export *exp)
               (exp), atomic_read(&(exp)->exp_rpc_count));
 }
 
-#define class_export_lock_get(exp, lock)                               \
-({                                                                   \
-       atomic_inc(&(exp)->exp_locks_count);                    \
-       __class_export_add_lock_ref(exp, lock);                  \
-       CDEBUG(D_INFO, "lock GETting export %p : new locks_count %d\n", \
-              (exp), atomic_read(&(exp)->exp_locks_count));    \
-       class_export_get(exp);                                    \
-})
+static inline struct obd_export *class_export_lock_get(struct obd_export *exp,
+                                                      struct ldlm_lock *lock)
+{
+       atomic_inc(&(exp)->exp_locks_count);
+       __class_export_add_lock_ref(exp, lock);
+       CDEBUG(D_INFO, "lock GETting export %p : new locks_count %d\n",
+              (exp), atomic_read(&(exp)->exp_locks_count));
+       return class_export_get(exp);
+}
 
 #define class_export_lock_put(exp, lock)                               \
 ({                                                                   \