X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=lib%2Fvsprintf.c;h=40f560959b169b4c4ac6154d658cfe76cfd0c5a6;hb=586b222d748e91c619d68e9239654ebc7fed9b0c;hp=426418253fd4d312554aba1c84143eb0598a5528;hpb=4173cf6fb6b7d1b4569cca08af318c4561356fb5;p=linux-block.git diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 426418253fd4..40f560959b16 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -2052,6 +2052,25 @@ char *format_page_flags(char *buf, char *end, unsigned long flags) return buf; } +static +char *format_page_type(char *buf, char *end, unsigned int page_type) +{ + buf = number(buf, end, page_type, default_flag_spec); + + if (buf < end) + *buf = '('; + buf++; + + if (page_type_has_type(page_type)) + buf = format_flags(buf, end, ~page_type, pagetype_names); + + if (buf < end) + *buf = ')'; + buf++; + + return buf; +} + static noinline_for_stack char *flags_string(char *buf, char *end, void *flags_ptr, struct printf_spec spec, const char *fmt) @@ -2065,6 +2084,8 @@ char *flags_string(char *buf, char *end, void *flags_ptr, switch (fmt[1]) { case 'p': return format_page_flags(buf, end, *(unsigned long *)flags_ptr); + case 't': + return format_page_type(buf, end, *(unsigned int *)flags_ptr); case 'v': flags = *(unsigned long *)flags_ptr; names = vmaflag_names;