[CRIU] [PATCH 2/3] usernsd: move MAX_MSG_SIZE to namespaces.h

Pavel Emelyanov xemul at parallels.com
Tue Aug 18 08:19:00 PDT 2015


On 08/14/2015 01:58 AM, Tycho Andersen wrote:
> We'll use this size in the next patch to avoid having to do some dynamic
> allocation.
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
>  include/namespaces.h | 2 ++
>  namespaces.c         | 2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/namespaces.h b/include/namespaces.h
> index 52d2f34..bcaeda8 100644
> --- a/include/namespaces.h
> +++ b/include/namespaces.h
> @@ -95,6 +95,8 @@ typedef int (*uns_call_t)(void *arg, int fd);
>   */
>  #define UNS_FDOUT	0x2
>  
> +#define MAX_MSG_SIZE	256

Can we also have some less generic name in this generic header?
I don't know, like MAX_UNSFD_MSG_SIZE or somehting...

> +
>  /*
>   * When we're restoring inside user namespace, some things are
>   * not allowed to be done there due to insufficient capabilities.
> diff --git a/namespaces.c b/namespaces.c
> index 9ce4783..1677a7a 100644
> --- a/namespaces.c
> +++ b/namespaces.c
> @@ -849,8 +849,6 @@ struct unsc_msg {
>  	char c[CMSG_SPACE(sizeof(int))];
>  };
>  
> -#define MAX_MSG_SIZE	256
> -
>  static int usernsd_pid;
>  
>  static inline void unsc_msg_init(struct unsc_msg *m, uns_call_t *c,
> 



More information about the CRIU mailing list