Will need this to emit ve messages with specified log level and device
info.

While on it, let's replace narrow __vprintk() helper with wider
ve_vprintk_emit().

https://virtuozzo.atlassian.net/browse/VSTOR-106826
Signed-off-by: Pavel Tikhomirov <[email protected]>
---
 include/linux/printk.h |  4 ++++
 kernel/printk/printk.c | 12 ++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index 05a8e361f3c01..d74ad6f389870 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -155,6 +155,10 @@ asmlinkage __printf(4, 0)
 int vprintk_emit(int facility, int level,
                 const struct dev_printk_info *dev_info,
                 const char *fmt, va_list args);
+asmlinkage __printf(4, 0)
+int ve_vprintk_emit(int facility, int level,
+                   const struct dev_printk_info *dev_info,
+                   const char *fmt, va_list args);
 
 asmlinkage __printf(1, 0)
 int vprintk(const char *fmt, va_list args);
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index b4c6b1f99eff0..f8e32b5fad0d7 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2510,11 +2510,15 @@ asmlinkage int vprintk_emit(int facility, int level,
 }
 EXPORT_SYMBOL(vprintk_emit);
 
-static int __vprintk(const char *fmt, va_list args)
+asmlinkage int ve_vprintk_emit(int facility, int level,
+                              const struct dev_printk_info *dev_info,
+                              const char *fmt, va_list args)
 {
-       return vprintk_emit_log(ve_log_state(), 0, LOGLEVEL_DEFAULT,
-                               NULL, fmt, args);
+       return vprintk_emit_log(ve_log_state(),
+                               facility, level, dev_info,
+                               fmt, args);
 }
+EXPORT_SYMBOL(ve_vprintk_emit);
 
 int vprintk_default(const char *fmt, va_list args)
 {
@@ -2531,7 +2535,7 @@ static asmlinkage int ve_vprintk(int dst, const char 
*fmt, va_list args)
        if (ve_is_super(get_exec_env()) || (dst & VE0_LOG))
                r = vprintk(fmt, args);
        if (!ve_is_super(get_exec_env()) && (dst & VE_LOG))
-               r = __vprintk(fmt, args2);
+               r = ve_vprintk_emit(0, LOGLEVEL_DEFAULT, NULL, fmt, args2);
        va_end(args2);
 
        return r;
-- 
2.51.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to