diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 19:55:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 19:55:41 -0700 |
commit | 88875667ebbcb95da3f93a4cf657d5dad7db9673 (patch) | |
tree | 7ac0e4fd89c0dde4cb0ec22fd9f8ba9c71c2f8af /fs/ubifs/misc.c | |
parent | 8b306a2e7c8b23d65682fd70d861e2ba2ae10926 (diff) | |
parent | c27cb97218b3e72417ffc5e73dce488844017b39 (diff) |
Merge tag 'upstream-4.6-rc1' of git://git.infradead.org/linux-ubifs
Pull UBI/UBIFS updates from Richard Weinberger:
"This contains cleanups and a maintainer update for UBI and UBIFS"
* tag 'upstream-4.6-rc1' of git://git.infradead.org/linux-ubifs:
ubifs: Remove unused header
MAINTAINERS: Update UBIFS entry
mtd: ubi: Add logging functions ubi_msg, ubi_warn and ubi_err
ubifs: Add logging functions for ubifs_msg, ubifs_err and ubifs_warn
Diffstat (limited to 'fs/ubifs/misc.c')
-rw-r--r-- | fs/ubifs/misc.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/fs/ubifs/misc.c b/fs/ubifs/misc.c new file mode 100644 index 000000000000..486a2844949f --- /dev/null +++ b/fs/ubifs/misc.c @@ -0,0 +1,57 @@ +#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\n", + 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\n", + 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\n", + c->vi.ubi_num, c->vi.vol_id, current->pid, + __builtin_return_address(0), + &vaf); + + va_end(args); +} |