Commit 049a7c82 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

userns: Wrap call with a macro fore readability

Pass function name into a helper instead of pointer
wich doesn't provide much useful info.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 01a99c0a
#ifndef __CR_NS_H__
#define __CR_NS_H__
#include "compiler.h"
#include "files.h"
struct ns_desc {
......@@ -114,7 +115,11 @@ typedef int (*uns_call_t)(void *arg, int fd, pid_t pid);
* In case we're not in userns, just call the callback immediatelly
* in the context of calling task.
*/
int userns_call(uns_call_t call, int flags,
void *arg, size_t arg_size, int fd);
extern int __userns_call(const char *func_name, uns_call_t call, int flags,
void *arg, size_t arg_size, int fd);
#define userns_call(__call, __flags, __arg, __arg_size, __fd) \
__userns_call(__stringify(__call), __call, __flags, \
__arg, __arg_size, __fd)
#endif /* __CR_NS_H__ */
......@@ -1015,8 +1015,8 @@ static int usernsd(int sk)
}
}
int userns_call(uns_call_t call, int flags,
void *arg, size_t arg_size, int fd)
int __userns_call(const char *func_name, uns_call_t call, int flags,
void *arg, size_t arg_size, int fd)
{
int ret, res, sk;
bool async = flags & UNS_ASYNC;
......@@ -1031,7 +1031,7 @@ int userns_call(uns_call_t call, int flags,
return call(arg, fd, getpid());
sk = get_service_fd(USERNSD_SK);
pr_debug("UNS: calling %p (%d, %x)\n", call, fd, flags);
pr_debug("UNS: calling %s (%d, %x)\n", func_name, fd, flags);
if (!async)
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment