From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: akpm@linux-foundation.org
Cc: ebiederm@xmission.com, devel@openvz.org,
linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
jmorris@namei.org
Subject: [PATCH 2/4] ipc: convert prepare_copy() from macro to function
Date: Wed, 07 Nov 2012 13:05:00 +0300 [thread overview]
Message-ID: <20121107100500.22846.143.stgit@localhost.localdomain> (raw)
In-Reply-To: <20121107100317.22846.94715.stgit@localhost.localdomain>
This code works if CONFIG_CHECKPOINT_RESTORE is disabled.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
ipc/msg.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ipc/msg.c b/ipc/msg.c
index f1070c3..ad194f8 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -803,8 +803,15 @@ static inline void free_copy(struct msg_msg *copy)
free_msg(copy);
}
#else
-#define prepare_copy(buf, sz, msgflg, msgtyp, copy_nr) ERR_PTR(-ENOSYS)
#define fill_copy(copy_nr, msg_nr, msg, copy) NULL
+
+static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
+ int msgflg, long *msgtyp,
+ unsigned long *copy_number)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
static inline void free_copy(struct msg_msg *copy)
{
}
@@ -819,7 +826,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
int mode;
struct ipc_namespace *ns;
struct msg_msg *copy = NULL;
- unsigned long __maybe_unused copy_number;
+ unsigned long __maybe_unused copy_number = 0;
if (msqid < 0 || (long) bufsz < 0)
return -EINVAL;
next prev parent reply other threads:[~2012-11-07 10:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-07 10:04 [PATCH 0/4] IPC: CRIU enhancements fixes and cleanup Stanislav Kinsbursky
2012-11-07 10:04 ` [PATCH 1/4] ipc: simplify free_copy() call Stanislav Kinsbursky
2012-11-07 10:05 ` Stanislav Kinsbursky [this message]
2012-11-07 19:20 ` [PATCH 2/4] ipc: convert prepare_copy() from macro to function Andrew Morton
2012-11-07 10:05 ` [PATCH 3/4] ipc: simplify message copying Stanislav Kinsbursky
2012-11-07 10:05 ` [PATCH 4/4] ipc: add more comments to message copying related code Stanislav Kinsbursky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121107100500.22846.143.stgit@localhost.localdomain \
--to=skinsbursky@parallels.com \
--cc=akpm@linux-foundation.org \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox