From: Al Viro Date: Fri, 22 Jan 2016 04:17:37 +0000 (-0500) Subject: orangefs: move wakeups into set_op_state_{serviced,purged}() X-Git-Tag: v4.6-rc1~2^2~85 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=831d0949799be75ed84c1c6a4541ebcd74edba6c;p=linux.git orangefs: move wakeups into set_op_state_{serviced,purged}() Signed-off-by: Al Viro Signed-off-by: Mike Marshall --- diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c index b58fab2a9c26..dadeb381f9fc 100644 --- a/fs/orangefs/devorangefs-req.c +++ b/fs/orangefs/devorangefs-req.c @@ -415,8 +415,6 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb, 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 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb, } 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; diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 825545a7d167..160c4c6a4d17 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -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) diff --git a/fs/orangefs/orangefs-mod.c b/fs/orangefs/orangefs-mod.c index 7434fa036328..d0257f8b8cd3 100644 --- a/fs/orangefs/orangefs-mod.c +++ b/fs/orangefs/orangefs-mod.c @@ -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); } } } diff --git a/fs/orangefs/waitqueue.c b/fs/orangefs/waitqueue.c index 0b04f4197526..641de05fa739 100644 --- a/fs/orangefs/waitqueue.c +++ b/fs/orangefs/waitqueue.c @@ -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); }