misc.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include <linux/kernel.h>
  2. #include "ubifs.h"
  3. /* Normal UBIFS messages */
  4. void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...)
  5. {
  6. struct va_format vaf;
  7. va_list args;
  8. va_start(args, fmt);
  9. vaf.fmt = fmt;
  10. vaf.va = &args;
  11. pr_notice("UBIFS (ubi%d:%d): %pV\n",
  12. c->vi.ubi_num, c->vi.vol_id, &vaf);
  13. va_end(args);
  14. } \
  15. /* UBIFS error messages */
  16. void ubifs_err(const struct ubifs_info *c, const char *fmt, ...)
  17. {
  18. struct va_format vaf;
  19. va_list args;
  20. va_start(args, fmt);
  21. vaf.fmt = fmt;
  22. vaf.va = &args;
  23. pr_err("UBIFS error (ubi%d:%d pid %d): %ps: %pV\n",
  24. c->vi.ubi_num, c->vi.vol_id, current->pid,
  25. __builtin_return_address(0),
  26. &vaf);
  27. va_end(args);
  28. } \
  29. /* UBIFS warning messages */
  30. void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...)
  31. {
  32. struct va_format vaf;
  33. va_list args;
  34. va_start(args, fmt);
  35. vaf.fmt = fmt;
  36. vaf.va = &args;
  37. pr_warn("UBIFS warning (ubi%d:%d pid %d): %ps: %pV\n",
  38. c->vi.ubi_num, c->vi.vol_id, current->pid,
  39. __builtin_return_address(0),
  40. &vaf);
  41. va_end(args);
  42. }