]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ipc: add more comments to message copying related code
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Fri, 9 Nov 2012 03:05:09 +0000 (14:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Nov 2012 04:55:24 +0000 (15:55 +1100)
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
ipc/msg.c

index 8493e1d7e3538c9aa6558e3c9078b2a47b0535c6..950572f9d7963858d46e01998fea00e14024f26b 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -770,6 +770,10 @@ static long do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz)
 }
 
 #ifdef CONFIG_CHECKPOINT_RESTORE
+/*
+ * This function creates new kernel message structure, large enough to store
+ * bufsz message bytes.
+ */
 static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
                                           int msgflg, long *msgtyp,
                                           unsigned long *copy_number)
@@ -881,6 +885,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
                                msg = ERR_PTR(-E2BIG);
                                goto out_unlock;
                        }
+                       /*
+                        * If we are copying, then do not unlink message and do
+                        * not update queue parameters.
+                        */
                        if (msgflg & MSG_COPY)
                                goto out_unlock;
                        list_del(&msg->m_list);