@@ -350,11 +350,6 @@ static int console_msg_format = MSG_FORMAT_DEFAULT;
350
350
* non-prinatable characters are escaped in the "\xff" notation.
351
351
*/
352
352
353
- enum log_flags {
354
- LOG_NEWLINE = 2 , /* text ended with a newline */
355
- LOG_CONT = 8 , /* text is a fragment of a continuation line */
356
- };
357
-
358
353
/* syslog_lock protects syslog_* variables and write access to clear_seq. */
359
354
static DEFINE_RAW_SPINLOCK (syslog_lock );
360
355
@@ -1965,19 +1960,20 @@ static inline u32 printk_caller_id(void)
1965
1960
*
1966
1961
* @text: The terminated text message.
1967
1962
* @level: A pointer to the current level value, will be updated.
1968
- * @lflags : A pointer to the current log flags, will be updated.
1963
+ * @flags : A pointer to the current printk_info flags, will be updated.
1969
1964
*
1970
1965
* @level may be NULL if the caller is not interested in the parsed value.
1971
1966
* Otherwise the variable pointed to by @level must be set to
1972
1967
* LOGLEVEL_DEFAULT in order to be updated with the parsed value.
1973
1968
*
1974
- * @lflags may be NULL if the caller is not interested in the parsed value.
1975
- * Otherwise the variable pointed to by @lflags will be OR'd with the parsed
1969
+ * @flags may be NULL if the caller is not interested in the parsed value.
1970
+ * Otherwise the variable pointed to by @flags will be OR'd with the parsed
1976
1971
* value.
1977
1972
*
1978
1973
* Return: The length of the parsed level and control flags.
1979
1974
*/
1980
- static u16 parse_prefix (char * text , int * level , enum log_flags * lflags )
1975
+ static u16 parse_prefix (char * text , int * level ,
1976
+ enum printk_info_flags * flags )
1981
1977
{
1982
1978
u16 prefix_len = 0 ;
1983
1979
int kern_level ;
@@ -1993,8 +1989,8 @@ static u16 parse_prefix(char *text, int *level, enum log_flags *lflags)
1993
1989
* level = kern_level - '0' ;
1994
1990
break ;
1995
1991
case 'c' : /* KERN_CONT */
1996
- if (lflags )
1997
- * lflags |= LOG_CONT ;
1992
+ if (flags )
1993
+ * flags |= LOG_CONT ;
1998
1994
}
1999
1995
2000
1996
prefix_len += 2 ;
@@ -2004,8 +2000,9 @@ static u16 parse_prefix(char *text, int *level, enum log_flags *lflags)
2004
2000
return prefix_len ;
2005
2001
}
2006
2002
2007
- static u16 printk_sprint (char * text , u16 size , int facility , enum log_flags * lflags ,
2008
- const char * fmt , va_list args )
2003
+ static u16 printk_sprint (char * text , u16 size , int facility ,
2004
+ enum printk_info_flags * flags , const char * fmt ,
2005
+ va_list args )
2009
2006
{
2010
2007
u16 text_len ;
2011
2008
@@ -2014,7 +2011,7 @@ static u16 printk_sprint(char *text, u16 size, int facility, enum log_flags *lfl
2014
2011
/* Mark and strip a trailing newline. */
2015
2012
if (text_len && text [text_len - 1 ] == '\n' ) {
2016
2013
text_len -- ;
2017
- * lflags |= LOG_NEWLINE ;
2014
+ * flags |= LOG_NEWLINE ;
2018
2015
}
2019
2016
2020
2017
/* Strip log level and control flags. */
@@ -2038,7 +2035,7 @@ int vprintk_store(int facility, int level,
2038
2035
{
2039
2036
const u32 caller_id = printk_caller_id ();
2040
2037
struct prb_reserved_entry e ;
2041
- enum log_flags lflags = 0 ;
2038
+ enum printk_info_flags flags = 0 ;
2042
2039
struct printk_record r ;
2043
2040
u16 trunc_msg_len = 0 ;
2044
2041
char prefix_buf [8 ];
@@ -2070,22 +2067,22 @@ int vprintk_store(int facility, int level,
2070
2067
2071
2068
/* Extract log level or control flags. */
2072
2069
if (facility == 0 )
2073
- parse_prefix (& prefix_buf [0 ], & level , & lflags );
2070
+ parse_prefix (& prefix_buf [0 ], & level , & flags );
2074
2071
2075
2072
if (level == LOGLEVEL_DEFAULT )
2076
2073
level = default_message_loglevel ;
2077
2074
2078
2075
if (dev_info )
2079
- lflags |= LOG_NEWLINE ;
2076
+ flags |= LOG_NEWLINE ;
2080
2077
2081
- if (lflags & LOG_CONT ) {
2078
+ if (flags & LOG_CONT ) {
2082
2079
prb_rec_init_wr (& r , reserve_size );
2083
2080
if (prb_reserve_in_last (& e , prb , & r , caller_id , LOG_LINE_MAX )) {
2084
2081
text_len = printk_sprint (& r .text_buf [r .info -> text_len ], reserve_size ,
2085
- facility , & lflags , fmt , args );
2082
+ facility , & flags , fmt , args );
2086
2083
r .info -> text_len += text_len ;
2087
2084
2088
- if (lflags & LOG_NEWLINE ) {
2085
+ if (flags & LOG_NEWLINE ) {
2089
2086
r .info -> flags |= LOG_NEWLINE ;
2090
2087
prb_final_commit (& e );
2091
2088
} else {
@@ -2112,20 +2109,20 @@ int vprintk_store(int facility, int level,
2112
2109
}
2113
2110
2114
2111
/* fill message */
2115
- text_len = printk_sprint (& r .text_buf [0 ], reserve_size , facility , & lflags , fmt , args );
2112
+ text_len = printk_sprint (& r .text_buf [0 ], reserve_size , facility , & flags , fmt , args );
2116
2113
if (trunc_msg_len )
2117
2114
memcpy (& r .text_buf [text_len ], trunc_msg , trunc_msg_len );
2118
2115
r .info -> text_len = text_len + trunc_msg_len ;
2119
2116
r .info -> facility = facility ;
2120
2117
r .info -> level = level & 7 ;
2121
- r .info -> flags = lflags & 0x1f ;
2118
+ r .info -> flags = flags & 0x1f ;
2122
2119
r .info -> ts_nsec = ts_nsec ;
2123
2120
r .info -> caller_id = caller_id ;
2124
2121
if (dev_info )
2125
2122
memcpy (& r .info -> dev_info , dev_info , sizeof (r .info -> dev_info ));
2126
2123
2127
2124
/* A message without a trailing newline can be continued. */
2128
- if (!(lflags & LOG_NEWLINE ))
2125
+ if (!(flags & LOG_NEWLINE ))
2129
2126
prb_commit (& e );
2130
2127
else
2131
2128
prb_final_commit (& e );
0 commit comments