ipc: remove msg handling from queue scan
In preparation for refactoring the queue scan into a separate function, relocate msg copying. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Acked-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
2b3097a294
commit
852028af86
14
ipc/msg.c
14
ipc/msg.c
@@ -862,16 +862,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
|
|||||||
walk_msg->m_type != 1) {
|
walk_msg->m_type != 1) {
|
||||||
msgtyp = walk_msg->m_type - 1;
|
msgtyp = walk_msg->m_type - 1;
|
||||||
} else if (msgflg & MSG_COPY) {
|
} else if (msgflg & MSG_COPY) {
|
||||||
if (copy_number == msg_counter) {
|
if (copy_number == msg_counter)
|
||||||
/*
|
|
||||||
* Found requested message.
|
|
||||||
* Copy it.
|
|
||||||
*/
|
|
||||||
msg = copy_msg(msg, copy);
|
|
||||||
if (IS_ERR(msg))
|
|
||||||
goto out_unlock;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
msg = ERR_PTR(-EAGAIN);
|
msg = ERR_PTR(-EAGAIN);
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
@@ -892,8 +884,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
|
|||||||
* If we are copying, then do not unlink message and do
|
* If we are copying, then do not unlink message and do
|
||||||
* not update queue parameters.
|
* not update queue parameters.
|
||||||
*/
|
*/
|
||||||
if (msgflg & MSG_COPY)
|
if (msgflg & MSG_COPY) {
|
||||||
|
msg = copy_msg(msg, copy);
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
}
|
||||||
list_del(&msg->m_list);
|
list_del(&msg->m_list);
|
||||||
msq->q_qnum--;
|
msq->q_qnum--;
|
||||||
msq->q_rtime = get_seconds();
|
msq->q_rtime = get_seconds();
|
||||||
|
Reference in New Issue
Block a user