pstore: Introduce get_reason_str() to pstore
authorSeiji Aguchi <seiji.aguchi@hds.com>
Fri, 16 Mar 2012 22:36:59 +0000 (15:36 -0700)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 9 Apr 2012 13:52:02 +0000 (07:52 -0600)
commitb64eba27b4222f5b57705291f7fa44fb5e220703
tree6d3f9fa74dac06a0b2a81da2b521d6afe4f137b4
parent584a92b6948dfd640f5b4da3dc1a693b9d69ca04
pstore: Introduce get_reason_str() to pstore

BugLink: http://bugs.launchpad.net/bugs/944772

Recently, there has been some changes in kmsg_dump() below and they have been applied to linus-tree.
 (1) kmsg_dump(KMSG_DUMP_KEXEC) was removed.
     http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=a3dd3323058d281abd584b15ad4c5b65064d7a61

 (2) The order of "enum kmsg_dump_reason" was modified.
     http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=c22ab332902333f83766017478c1ef6607ace681

Replace the fragile reason_str array with a more robust solution that
will not be broken by future re-arrangements of the enum values.

Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Link: https://lkml.org/lkml/2012/3/16/417
Signed-off-by: Tony Luck <tony.luck@intel.com>
(cherry picked from commit 381b872cf7942ab8c95de156ce403bd906f3915d)
Acked-by: Colin King <colin.king@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/pstore/platform.c