Linux 5.8-rc4
[linux/fpc-iii.git] / fs / ubifs / misc.c
blobcd23de0f211dd074a7d949cc0ab771bf94fa80bd
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/kernel.h>
3 #include "ubifs.h"
5 /* Normal UBIFS messages */
6 void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...)
8 struct va_format vaf;
9 va_list args;
11 va_start(args, fmt);
13 vaf.fmt = fmt;
14 vaf.va = &args;
16 pr_notice("UBIFS (ubi%d:%d): %pV\n",
17 c->vi.ubi_num, c->vi.vol_id, &vaf);
19 va_end(args);
20 } \
22 /* UBIFS error messages */
23 void ubifs_err(const struct ubifs_info *c, const char *fmt, ...)
25 struct va_format vaf;
26 va_list args;
28 va_start(args, fmt);
30 vaf.fmt = fmt;
31 vaf.va = &args;
33 pr_err("UBIFS error (ubi%d:%d pid %d): %ps: %pV\n",
34 c->vi.ubi_num, c->vi.vol_id, current->pid,
35 __builtin_return_address(0),
36 &vaf);
38 va_end(args);
39 } \
41 /* UBIFS warning messages */
42 void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...)
44 struct va_format vaf;
45 va_list args;
47 va_start(args, fmt);
49 vaf.fmt = fmt;
50 vaf.va = &args;
52 pr_warn("UBIFS warning (ubi%d:%d pid %d): %ps: %pV\n",
53 c->vi.ubi_num, c->vi.vol_id, current->pid,
54 __builtin_return_address(0),
55 &vaf);
57 va_end(args);
60 static char *assert_names[] = {
61 [ASSACT_REPORT] = "report",
62 [ASSACT_RO] = "read-only",
63 [ASSACT_PANIC] = "panic",
66 const char *ubifs_assert_action_name(struct ubifs_info *c)
68 return assert_names[c->assert_action];