[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1361845307-12737-8-git-send-email-peter@hurleysoftware.com>
Date: Mon, 25 Feb 2013 21:21:44 -0500
From: Peter Hurley <peter@...leysoftware.com>
To: Stanislav Kinsbursky <skinsbursky@...allels.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Dave Jones <davej@...hat.com>,
Peter Hurley <peter@...leysoftware.com>
Subject: [PATCH 07/10] 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@...leysoftware.com>
---
ipc/msg.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/ipc/msg.c b/ipc/msg.c
index 31cd1bf..e8d3f15 100644
--- a/ipc/msg.c
+++ b/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) {
msgtyp = walk_msg->m_type - 1;
} else if (msgflg & MSG_COPY) {
- if (copy_number == msg_counter) {
- /*
- * Found requested message.
- * Copy it.
- */
- msg = copy_msg(msg, copy);
- if (IS_ERR(msg))
- goto out_unlock;
+ if (copy_number == msg_counter)
break;
- }
} else
break;
msg_counter++;
@@ -891,8 +883,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
* not update queue parameters.
*/
- if (msgflg & MSG_COPY)
+ if (msgflg & MSG_COPY) {
+ msg = copy_msg(msg, copy);
goto out_unlock;
+ }
list_del(&msg->m_list);
msq->q_qnum--;
msq->q_rtime = get_seconds();
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists