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__ #ifndef __CR_NS_H__
#define __CR_NS_H__ #define __CR_NS_H__
#include "compiler.h"
#include "files.h" #include "files.h"
struct ns_desc { struct ns_desc {
...@@ -114,7 +115,11 @@ typedef int (*uns_call_t)(void *arg, int fd, pid_t pid); ...@@ -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 case we're not in userns, just call the callback immediatelly
* in the context of calling task. * in the context of calling task.
*/ */
int userns_call(uns_call_t call, int flags, extern int __userns_call(const char *func_name, uns_call_t call, int flags,
void *arg, size_t arg_size, int fd); 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__ */ #endif /* __CR_NS_H__ */
...@@ -1015,7 +1015,7 @@ static int usernsd(int sk) ...@@ -1015,7 +1015,7 @@ static int usernsd(int sk)
} }
} }
int userns_call(uns_call_t call, int flags, int __userns_call(const char *func_name, uns_call_t call, int flags,
void *arg, size_t arg_size, int fd) void *arg, size_t arg_size, int fd)
{ {
int ret, res, sk; int ret, res, sk;
...@@ -1031,7 +1031,7 @@ int userns_call(uns_call_t call, int flags, ...@@ -1031,7 +1031,7 @@ int userns_call(uns_call_t call, int flags,
return call(arg, fd, getpid()); return call(arg, fd, getpid());
sk = get_service_fd(USERNSD_SK); 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) 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