Skip to content

Commit 831d094

Browse files
Al Virohubcapsc
authored andcommitted
orangefs: move wakeups into set_op_state_{serviced,purged}()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
1 parent b7ae37b commit 831d094

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎fs/orangefs/devorangefs-req.c‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
415415
set_op_state_serviced(op);
416416
spin_unlock(&op->lock);
417417

418-
wake_up_interruptible(&op->waitq);
419-
420418
while (1) {
421419
spin_lock(&op->lock);
422420
prepare_to_wait_exclusive(
@@ -464,17 +462,14 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
464462
} else {
465463
/*
466464
* tell the vfs op waiting on a waitqueue that
467-
* this op is done
468-
*/
469-
spin_lock(&op->lock);
470-
set_op_state_serviced(op);
471-
spin_unlock(&op->lock);
472-
/*
465+
* this op is done -
473466
* for every other operation (i.e. non-I/O), we need to
474467
* wake up the callers for downcall completion
475468
* notification
476469
*/
477-
wake_up_interruptible(&op->waitq);
470+
spin_lock(&op->lock);
471+
set_op_state_serviced(op);
472+
spin_unlock(&op->lock);
478473
}
479474
out:
480475
return ret;

‎fs/orangefs/orangefs-kernel.h‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,16 @@ enum orangefs_vfs_op_states {
105105

106106
#define set_op_state_waiting(op) ((op)->op_state = OP_VFS_STATE_WAITING)
107107
#define set_op_state_inprogress(op) ((op)->op_state = OP_VFS_STATE_INPROGR)
108-
#define set_op_state_serviced(op) ((op)->op_state = OP_VFS_STATE_SERVICED)
109-
#define set_op_state_purged(op) ((op)->op_state |= OP_VFS_STATE_PURGED)
108+
static inline void set_op_state_serviced(struct orangefs_kernel_op_s *op)
109+
{
110+
op->op_state = OP_VFS_STATE_SERVICED;
111+
wake_up_interruptible(&op->waitq);
112+
}
113+
static inline void set_op_state_purged(struct orangefs_kernel_op_s *op)
114+
{
115+
op->op_state |= OP_VFS_STATE_PURGED;
116+
wake_up_interruptible(&op->waitq);
117+
}
110118

111119
#define op_state_waiting(op) ((op)->op_state & OP_VFS_STATE_WAITING)
112120
#define op_state_in_progress(op) ((op)->op_state & OP_VFS_STATE_INPROGR)

‎fs/orangefs/orangefs-mod.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ void purge_inprogress_ops(void)
303303
get_opname_string(op));
304304
set_op_state_purged(op);
305305
spin_unlock(&op->lock);
306-
wake_up_interruptible(&op->waitq);
307306
}
308307
}
309308
}

‎fs/orangefs/waitqueue.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ void purge_waiting_ops(void)
3636
spin_lock(&op->lock);
3737
set_op_state_purged(op);
3838
spin_unlock(&op->lock);
39-
wake_up_interruptible(&op->waitq);
4039
}
4140
spin_unlock(&orangefs_request_list_lock);
4241
}

0 commit comments

Comments
 (0)