Skip to content

Commit

Permalink
Merge branch 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/aegl/linux-2.6

* 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  efivars: Introduce PSTORE_EFI_ATTRIBUTES
  efivars: Use string functions in pstore_write
  efivars: introduce utf16_strncmp
  efivars: String functions
  efi: Add support for using efivars as a pstore backend
  pstore: Allow the user to explicitly choose a backend
  pstore: Make "part" unsigned
  pstore: Add extra context for writes and erases
  pstore: Extend API for more flexibility in new backends
  • Loading branch information
Linus Torvalds committed Aug 1, 2011
2 parents 72f9adf + 7644c16 commit a2d7730
Show file tree
Hide file tree
Showing 9 changed files with 296 additions and 34 deletions.
6 changes: 6 additions & 0 deletions Documentation/ABI/testing/pstore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ Description: Generic interface to platform dependent persistent storage.
multiple) files based on the record size of the underlying
persistent storage until at least this amount is reached.
Default is 10 Kbytes.

Pstore only supports one backend at a time. If multiple
backends are available, the preferred backend may be
set by passing the pstore.backend= argument to the kernel at
boot time.

2 changes: 2 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
[HW,MOUSE] Controls Logitech smartscroll autorepeat.
0 = disabled, 1 = enabled (default).

pstore.backend= Specify the name of the pstore backend to use

pt. [PARIDE]
See Documentation/blockdev/paride.txt.

Expand Down
20 changes: 15 additions & 5 deletions drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,11 @@ static int erst_check_table(struct acpi_table_erst *erst_tab)
static int erst_open_pstore(struct pstore_info *psi);
static int erst_close_pstore(struct pstore_info *psi);
static ssize_t erst_reader(u64 *id, enum pstore_type_id *type,
struct timespec *time);
static u64 erst_writer(enum pstore_type_id type, size_t size);
struct timespec *time, struct pstore_info *psi);
static u64 erst_writer(enum pstore_type_id type, unsigned int part,
size_t size, struct pstore_info *psi);
static int erst_clearer(enum pstore_type_id type, u64 id,
struct pstore_info *psi);

static struct pstore_info erst_info = {
.owner = THIS_MODULE,
Expand All @@ -942,7 +945,7 @@ static struct pstore_info erst_info = {
.close = erst_close_pstore,
.read = erst_reader,
.write = erst_writer,
.erase = erst_clear
.erase = erst_clearer
};

#define CPER_CREATOR_PSTORE \
Expand Down Expand Up @@ -983,7 +986,7 @@ static int erst_close_pstore(struct pstore_info *psi)
}

static ssize_t erst_reader(u64 *id, enum pstore_type_id *type,
struct timespec *time)
struct timespec *time, struct pstore_info *psi)
{
int rc;
ssize_t len = 0;
Expand Down Expand Up @@ -1037,7 +1040,8 @@ static ssize_t erst_reader(u64 *id, enum pstore_type_id *type,
return (rc < 0) ? rc : (len - sizeof(*rcd));
}

static u64 erst_writer(enum pstore_type_id type, size_t size)
static u64 erst_writer(enum pstore_type_id type, unsigned int part,
size_t size, struct pstore_info *psi)
{
struct cper_pstore_record *rcd = (struct cper_pstore_record *)
(erst_info.buf - sizeof(*rcd));
Expand Down Expand Up @@ -1080,6 +1084,12 @@ static u64 erst_writer(enum pstore_type_id type, size_t size)
return rcd->hdr.record_id;
}

static int erst_clearer(enum pstore_type_id type, u64 id,
struct pstore_info *psi)
{
return erst_clear(id);
}

static int __init erst_init(void)
{
int rc = 0;
Expand Down
Loading

0 comments on commit a2d7730

Please sign in to comment.