orangefs: move wakeups into set_op_state_{serviced,purged}()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 22 Jan 2016 04:17:37 +0000 (23:17 -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/devorangefs-req.c
fs/orangefs/orangefs-kernel.h
fs/orangefs/orangefs-mod.c
fs/orangefs/waitqueue.c

index b58fab2a9c265c1a970d482fb87e77f0a42b3f1f..dadeb381f9fc38285307ac95f559855054899511 100644 (file)
@@ -415,8 +415,6 @@ wakeup:
                set_op_state_serviced(op);
                spin_unlock(&op->lock);
 
-               wake_up_interruptible(&op->waitq);
-
                while (1) {
                        spin_lock(&op->lock);
                        prepare_to_wait_exclusive(
@@ -464,17 +462,14 @@ wakeup:
        } else {
                /*
                 * tell the vfs op waiting on a waitqueue that
-                * this op is done
-                */
-               spin_lock(&op->lock);
-               set_op_state_serviced(op);
-               spin_unlock(&op->lock);
-               /*
+                * this op is done -
                 * for every other operation (i.e. non-I/O), we need to
                 * wake up the callers for downcall completion
                 * notification
                 */
-               wake_up_interruptible(&op->waitq);
+               spin_lock(&op->lock);
+               set_op_state_serviced(op);
+               spin_unlock(&op->lock);
        }
 out:
        return ret;
index 825545a7d1672f076c4c3250d0e07471867cee4c..160c4c6a4d1760ee77a33c2cf71922ab32f6bb35 100644 (file)
@@ -105,8 +105,16 @@ enum orangefs_vfs_op_states {
 
 #define set_op_state_waiting(op)     ((op)->op_state = OP_VFS_STATE_WAITING)
 #define set_op_state_inprogress(op)  ((op)->op_state = OP_VFS_STATE_INPROGR)
-#define set_op_state_serviced(op)    ((op)->op_state = OP_VFS_STATE_SERVICED)
-#define set_op_state_purged(op)      ((op)->op_state |= OP_VFS_STATE_PURGED)
+static inline void set_op_state_serviced(struct orangefs_kernel_op_s *op)
+{
+       op->op_state = OP_VFS_STATE_SERVICED;
+       wake_up_interruptible(&op->waitq);
+}
+static inline void set_op_state_purged(struct orangefs_kernel_op_s *op)
+{
+       op->op_state |= OP_VFS_STATE_PURGED;
+       wake_up_interruptible(&op->waitq);
+}
 
 #define op_state_waiting(op)     ((op)->op_state & OP_VFS_STATE_WAITING)
 #define op_state_in_progress(op) ((op)->op_state & OP_VFS_STATE_INPROGR)
index 7434fa0363280d8d0c51a7a4e7adb042498906ed..d0257f8b8cd39584838e0ebb360047dbd5de94c7 100644 (file)
@@ -303,7 +303,6 @@ void purge_inprogress_ops(void)
                                get_opname_string(op));
                        set_op_state_purged(op);
                        spin_unlock(&op->lock);
-                       wake_up_interruptible(&op->waitq);
                }
        }
 }
index 0b04f4197526a87f530f775258ec9dcdde05c8a6..641de05fa7392a0a30aafb4335c37b981bf22922 100644 (file)
@@ -36,7 +36,6 @@ void purge_waiting_ops(void)
                spin_lock(&op->lock);
                set_op_state_purged(op);
                spin_unlock(&op->lock);
-               wake_up_interruptible(&op->waitq);
        }
        spin_unlock(&orangefs_request_list_lock);
 }
This page took 0.040056 seconds and 5 git commands to generate.