Blame view

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