Subject: Re: [PATCH RFC 3/5] printk: modify printk interface for syslog_namespace

From: Rui Xiang <[email-masked]>
Date: Wed, 21 Nov 2012 17:41:58 +0800

From: Libo Chen <[email-masked]>

On 2012-11-19 22:29, Serge E. Hallyn wrote:> Quoting Rui Xiang ([email-masked]):
>> From: Libo Chen <[email-masked]>
>>
>> We re-implement printk by additional syslog_ns.
>>
>> The function include printk, /dev/kmsg, do_syslog and kmsg_dump should be modifyed
>> for syslog_ns. Previous identifier *** such as log_first_seq should be replaced
>> by syslog_ns->***.
>>
>> Signed-off-by: Libo Chen <[email-masked]>
>> Signed-off-by: Xiang Rui <[email-masked]>
>> ---

.......

>>  	lockdep_on();
>> @@ -1624,7 +1618,8 @@ EXPORT_SYMBOL(vprintk_emit);
>>
>>  asmlinkage int vprintk(const char *fmt, va_list args)
>>  {
>> -	return vprintk_emit(0, -1, NULL, 0, fmt, args);
>> +	return vprintk_emit(0, -1, NULL, 0, fmt, args,
>> +				current_syslog_ns());
>>  }
>>  EXPORT_SYMBOL(vprintk);
>>
>> @@ -1636,7 +1631,8 @@ asmlinkage int printk_emit(int facility, int level,
>>  	int r;
>>
>>  	va_start(args, fmt);
>> -	r = vprintk_emit(facility, level, dict, dictlen, fmt, args);
>> +	r = vprintk_emit(facility, level, dict, dictlen, fmt, args,
>> +						current_syslog_ns());
>>  	va_end(args);
>>
>>  	return r;
>> @@ -1678,7 +1674,7 @@ asmlinkage int printk(const char *fmt, ...)
>>  	}
>>  #endif
>>  	va_start(args, fmt);
>> -	r = vprintk_emit(0, -1, NULL, 0, fmt, args);
>> +	r = vprintk_emit(0, -1, NULL, 0, fmt, args, current_syslog_ns());
>
> Current is meaningless here.  The default should be using init_syslog_ns.

Thank for your attention.

I understand what you mean.
printk -> init_syslog_log
nsprintk(ns) -> container syslog

I think it makes sense.

thanks
Libo Chen