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>
This commit is contained in:
parent
b7ae37b09e
commit
831d094979
4 changed files with 14 additions and 13 deletions
|
@ -415,8 +415,6 @@ wakeup:
|
||||||
set_op_state_serviced(op);
|
set_op_state_serviced(op);
|
||||||
spin_unlock(&op->lock);
|
spin_unlock(&op->lock);
|
||||||
|
|
||||||
wake_up_interruptible(&op->waitq);
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
spin_lock(&op->lock);
|
spin_lock(&op->lock);
|
||||||
prepare_to_wait_exclusive(
|
prepare_to_wait_exclusive(
|
||||||
|
@ -464,17 +462,14 @@ wakeup:
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* tell the vfs op waiting on a waitqueue that
|
* tell the vfs op waiting on a waitqueue that
|
||||||
* this op is done
|
* this op is done -
|
||||||
*/
|
|
||||||
spin_lock(&op->lock);
|
|
||||||
set_op_state_serviced(op);
|
|
||||||
spin_unlock(&op->lock);
|
|
||||||
/*
|
|
||||||
* for every other operation (i.e. non-I/O), we need to
|
* for every other operation (i.e. non-I/O), we need to
|
||||||
* wake up the callers for downcall completion
|
* wake up the callers for downcall completion
|
||||||
* notification
|
* notification
|
||||||
*/
|
*/
|
||||||
wake_up_interruptible(&op->waitq);
|
spin_lock(&op->lock);
|
||||||
|
set_op_state_serviced(op);
|
||||||
|
spin_unlock(&op->lock);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -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_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_inprogress(op) ((op)->op_state = OP_VFS_STATE_INPROGR)
|
||||||
#define set_op_state_serviced(op) ((op)->op_state = OP_VFS_STATE_SERVICED)
|
static inline void set_op_state_serviced(struct orangefs_kernel_op_s *op)
|
||||||
#define set_op_state_purged(op) ((op)->op_state |= OP_VFS_STATE_PURGED)
|
{
|
||||||
|
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_waiting(op) ((op)->op_state & OP_VFS_STATE_WAITING)
|
||||||
#define op_state_in_progress(op) ((op)->op_state & OP_VFS_STATE_INPROGR)
|
#define op_state_in_progress(op) ((op)->op_state & OP_VFS_STATE_INPROGR)
|
||||||
|
|
|
@ -303,7 +303,6 @@ void purge_inprogress_ops(void)
|
||||||
get_opname_string(op));
|
get_opname_string(op));
|
||||||
set_op_state_purged(op);
|
set_op_state_purged(op);
|
||||||
spin_unlock(&op->lock);
|
spin_unlock(&op->lock);
|
||||||
wake_up_interruptible(&op->waitq);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ void purge_waiting_ops(void)
|
||||||
spin_lock(&op->lock);
|
spin_lock(&op->lock);
|
||||||
set_op_state_purged(op);
|
set_op_state_purged(op);
|
||||||
spin_unlock(&op->lock);
|
spin_unlock(&op->lock);
|
||||||
wake_up_interruptible(&op->waitq);
|
|
||||||
}
|
}
|
||||||
spin_unlock(&orangefs_request_list_lock);
|
spin_unlock(&orangefs_request_list_lock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue