Loading...
1#include <linux/kernel.h>
2#include "ubifs.h"
3
4/* Normal UBIFS messages */
5void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...)
6{
7 struct va_format vaf;
8 va_list args;
9
10 va_start(args, fmt);
11
12 vaf.fmt = fmt;
13 vaf.va = &args;
14
15 pr_notice("UBIFS (ubi%d:%d): %pV\n",
16 c->vi.ubi_num, c->vi.vol_id, &vaf);
17
18 va_end(args);
19} \
20
21/* UBIFS error messages */
22void ubifs_err(const struct ubifs_info *c, const char *fmt, ...)
23{
24 struct va_format vaf;
25 va_list args;
26
27 va_start(args, fmt);
28
29 vaf.fmt = fmt;
30 vaf.va = &args;
31
32 pr_err("UBIFS error (ubi%d:%d pid %d): %ps: %pV\n",
33 c->vi.ubi_num, c->vi.vol_id, current->pid,
34 __builtin_return_address(0),
35 &vaf);
36
37 va_end(args);
38} \
39
40/* UBIFS warning messages */
41void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...)
42{
43 struct va_format vaf;
44 va_list args;
45
46 va_start(args, fmt);
47
48 vaf.fmt = fmt;
49 vaf.va = &args;
50
51 pr_warn("UBIFS warning (ubi%d:%d pid %d): %ps: %pV\n",
52 c->vi.ubi_num, c->vi.vol_id, current->pid,
53 __builtin_return_address(0),
54 &vaf);
55
56 va_end(args);
57}
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/kernel.h>
3#include "ubifs.h"
4
5/* Normal UBIFS messages */
6void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...)
7{
8 struct va_format vaf;
9 va_list args;
10
11 va_start(args, fmt);
12
13 vaf.fmt = fmt;
14 vaf.va = &args;
15
16 pr_notice("UBIFS (ubi%d:%d): %pV\n",
17 c->vi.ubi_num, c->vi.vol_id, &vaf);
18
19 va_end(args);
20} \
21
22/* UBIFS error messages */
23void ubifs_err(const struct ubifs_info *c, const char *fmt, ...)
24{
25 struct va_format vaf;
26 va_list args;
27
28 va_start(args, fmt);
29
30 vaf.fmt = fmt;
31 vaf.va = &args;
32
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);
37
38 va_end(args);
39} \
40
41/* UBIFS warning messages */
42void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...)
43{
44 struct va_format vaf;
45 va_list args;
46
47 va_start(args, fmt);
48
49 vaf.fmt = fmt;
50 vaf.va = &args;
51
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);
56
57 va_end(args);
58}
59
60static char *assert_names[] = {
61 [ASSACT_REPORT] = "report",
62 [ASSACT_RO] = "read-only",
63 [ASSACT_PANIC] = "panic",
64};
65
66const char *ubifs_assert_action_name(struct ubifs_info *c)
67{
68 return assert_names[c->assert_action];
69}