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

Rui Xiang leo.ruixiang at gmail.com
Wed Nov 21 09:41:58 UTC 2012


From: Libo Chen <clbchenlibo.chen at huawei.com>

On 2012-11-19 22:29, Serge E. Hallyn wrote:> Quoting Rui Xiang (leo.ruixiang at gmail.com):
>> From: Libo Chen <clbchenlibo.chen at huawei.com>
>>
>> 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 <clbchenlibo.chen at huawei.com>
>> Signed-off-by: Xiang Rui <rui.xiang at huawei.com>
>> ---

.......

>>  	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


More information about the Containers mailing list