diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-04-30 22:14:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 11:12:57 -0400 |
commit | 852028af861ed6c7ab7e73053dd664eb28e55200 (patch) | |
tree | 1b3be153ff8d0f9d25e20417a1edc34659cbf88a /ipc | |
parent | 2b3097a294b6daaf390010de14ca50bfccbc6fb6 (diff) |
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>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/msg.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -862,16 +862,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, | |||
862 | walk_msg->m_type != 1) { | 862 | walk_msg->m_type != 1) { |
863 | msgtyp = walk_msg->m_type - 1; | 863 | msgtyp = walk_msg->m_type - 1; |
864 | } else if (msgflg & MSG_COPY) { | 864 | } else if (msgflg & MSG_COPY) { |
865 | if (copy_number == msg_counter) { | 865 | if (copy_number == msg_counter) |
866 | /* | ||
867 | * Found requested message. | ||
868 | * Copy it. | ||
869 | */ | ||
870 | msg = copy_msg(msg, copy); | ||
871 | if (IS_ERR(msg)) | ||
872 | goto out_unlock; | ||
873 | break; | 866 | break; |
874 | } | ||
875 | msg = ERR_PTR(-EAGAIN); | 867 | msg = ERR_PTR(-EAGAIN); |
876 | } else | 868 | } else |
877 | break; | 869 | break; |
@@ -892,8 +884,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, | |||
892 | * If we are copying, then do not unlink message and do | 884 | * If we are copying, then do not unlink message and do |
893 | * not update queue parameters. | 885 | * not update queue parameters. |
894 | */ | 886 | */ |
895 | if (msgflg & MSG_COPY) | 887 | if (msgflg & MSG_COPY) { |
888 | msg = copy_msg(msg, copy); | ||
896 | goto out_unlock; | 889 | goto out_unlock; |
890 | } | ||
897 | list_del(&msg->m_list); | 891 | list_del(&msg->m_list); |
898 | msq->q_qnum--; | 892 | msq->q_qnum--; |
899 | msq->q_rtime = get_seconds(); | 893 | msq->q_rtime = get_seconds(); |