set_op_state_serviced(op);
spin_unlock(&op->lock);
- wake_up_interruptible(&op->waitq);
-
while (1) {
spin_lock(&op->lock);
prepare_to_wait_exclusive(
} 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;
#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)