orangefs: get rid of <censored> macros
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 19 Jan 2016 17:26:13 +0000 (12:26 -0500)
committerMike Marshall <hubcap@omnibond.com>
Sat, 23 Jan 2016 17:42:43 +0000 (12:42 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/orangefs-kernel.h
fs/orangefs/waitqueue.c

index 6dcc38a5f1177b8bdca5423c0c3153da30c26b06..d9b5b512bd839d6e285f5d90d31c84af70f4cab5 100644 (file)
@@ -619,47 +619,6 @@ extern wait_queue_head_t orangefs_bufmap_init_waitq;
 /*
  * misc convenience macros
  */
-#define add_op_to_request_list(op)                             \
-do {                                                           \
-       spin_lock(&orangefs_request_list_lock);                 \
-       spin_lock(&op->lock);                                   \
-       set_op_state_waiting(op);                               \
-       list_add_tail(&op->list, &orangefs_request_list);               \
-       spin_unlock(&orangefs_request_list_lock);                       \
-       spin_unlock(&op->lock);                                 \
-       wake_up_interruptible(&orangefs_request_list_waitq);    \
-} while (0)
-
-#define add_priority_op_to_request_list(op)                            \
-       do {                                                            \
-               spin_lock(&orangefs_request_list_lock);                 \
-               spin_lock(&op->lock);                                   \
-               set_op_state_waiting(op);                               \
-                                                                       \
-               list_add(&op->list, &orangefs_request_list);            \
-               spin_unlock(&orangefs_request_list_lock);                       \
-               spin_unlock(&op->lock);                                 \
-               wake_up_interruptible(&orangefs_request_list_waitq);    \
-} while (0)
-
-#define remove_op_from_request_list(op)                                        \
-       do {                                                            \
-               struct list_head *tmp = NULL;                           \
-               struct list_head *tmp_safe = NULL;                      \
-               struct orangefs_kernel_op_s *tmp_op = NULL;             \
-                                                                       \
-               spin_lock(&orangefs_request_list_lock);                 \
-               list_for_each_safe(tmp, tmp_safe, &orangefs_request_list) { \
-                       tmp_op = list_entry(tmp,                        \
-                                           struct orangefs_kernel_op_s,        \
-                                           list);                      \
-                       if (tmp_op && (tmp_op == op)) {                 \
-                               list_del(&tmp_op->list);                \
-                               break;                                  \
-                       }                                               \
-               }                                                       \
-               spin_unlock(&orangefs_request_list_lock);                       \
-       } while (0)
 
 #define ORANGEFS_OP_INTERRUPTIBLE 1   /* service_operation() is interruptible */
 #define ORANGEFS_OP_PRIORITY      2   /* service_operation() is high priority */
index 751c3c640a52c6913c0243a4b07840a8551abd36..4730baf686b2e08410c26372cf92e5aba7b3b6a9 100644 (file)
@@ -41,6 +41,31 @@ void purge_waiting_ops(void)
        spin_unlock(&orangefs_request_list_lock);
 }
 
+static inline void
+add_op_to_request_list(struct orangefs_kernel_op_s *op)
+{
+       spin_lock(&orangefs_request_list_lock);
+       spin_lock(&op->lock);
+       set_op_state_waiting(op);
+       list_add_tail(&op->list, &orangefs_request_list);
+       spin_unlock(&orangefs_request_list_lock);
+       spin_unlock(&op->lock);
+       wake_up_interruptible(&orangefs_request_list_waitq);
+}
+
+static inline
+void add_priority_op_to_request_list(struct orangefs_kernel_op_s *op)
+{
+       spin_lock(&orangefs_request_list_lock);
+       spin_lock(&op->lock);
+       set_op_state_waiting(op);
+
+       list_add(&op->list, &orangefs_request_list);
+       spin_unlock(&orangefs_request_list_lock);
+       spin_unlock(&op->lock);
+       wake_up_interruptible(&orangefs_request_list_waitq);
+}
+
 /*
  * submits a ORANGEFS operation and waits for it to complete
  *
@@ -252,6 +277,25 @@ retry_servicing:
        return ret;
 }
 
+static inline void remove_op_from_request_list(struct orangefs_kernel_op_s *op)
+{
+       struct list_head *tmp = NULL;
+       struct list_head *tmp_safe = NULL;
+       struct orangefs_kernel_op_s *tmp_op = NULL;
+
+       spin_lock(&orangefs_request_list_lock);
+       list_for_each_safe(tmp, tmp_safe, &orangefs_request_list) {
+               tmp_op = list_entry(tmp,
+                                   struct orangefs_kernel_op_s,
+                                   list);
+               if (tmp_op && (tmp_op == op)) {
+                       list_del(&tmp_op->list);
+                       break;
+               }
+       }
+       spin_unlock(&orangefs_request_list_lock);
+}
+
 void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op)
 {
        /*