STRUCT PSTORE_INFO(9)
okay bestie, welcome to the struct pstore_info(9) page from the Kernel API Manual π
β this is the backend pstore driver structure, and weβre gonna go through every single field like itβs a group-chat screenshot. No skipping, fr fr.
π NAME π
struct pstore_info β backend pstore driver structure. Thatβs the whole vibe: itβs the struct a backend pstore driver is made of. π«Ά
π SYNOPSIS π
struct pstore_info {
struct module *owner;
const char *name;
raw_spinlock_t buf_lock;
char *buf;
size_t bufsize;
struct mutex read_mutex;
int flags;
int max_reason;
void *data;
int (*open)(struct pstore_info *psi);
int (*close)(struct pstore_info *psi);
ssize_t (*read)(struct pstore_record *record);
int (*write)(struct pstore_record *record);
int (*write_user)(struct pstore_record *record, const char __user
*buf);
int (*erase)(struct pstore_record *record);
};
π§© Members π§©
ownerβ module which is responsible for this backend driver.nameβ name of the backend driver.buf_lockβ spinlock to serialize access tobuf.bufβ pointer to userspace contents to write to backend.bufsizeβ size ofbufavailable for crash dump bytes (must match smallest number of bytes available for writing to a backend entry, since compressed bytes donβt take kindly to being truncated). This one is picky on purpose, bestie.read_mutexβ serializesopen,read,close, anderasecallbacks.flagsβ bitfield of frontends the backend can accept writes for.max_reasonβ Used whenPSTORE_FLAGS_DMESGis set. Contains thekmsg_dump_reasonenum value.KMSG_DUMP_UNDEFmeans "use existing kmsg_dump filtering, based on theprintk.always_kmsg_dumpboot param" (which is eitherKMSG_DUMP_OOPSwhen false, orKMSG_DUMP_MAXwhen true); seeprintk.always_kmsg_dumpfor more details.dataβ backend-private pointer passed back during callbacks.openβ Notify backend that pstore is starting a full read of backend records. Followed by one or morereadcalls, and a finalclose.closeβ Notify backend that pstore has finished a full read of backend records. Always preceded by anopencall and one or morereadcalls.readβ Read next available backend record. Called after a successfulopen.writeβ A newly generated record needs to be written to backend storage.write_userβ Perform a frontend write to a backend record, using a specified buffer that is coming directly from userspace, instead of the recordbuf.eraseβ Delete a record from backend storage. Different backends identify records differently, so entire original record is passed back to assist in identification of what the backend should remove from storage.
πΈ Description πΈ
Callbacks:
- Returns
0on success, and non-zero on error. - Returns
0on success, and non-zero on error. (Though pstore will ignore the error.) - Returns record size on success, zero when no more records are available, or negative on error.
- Returns
0on success, and non-zero on error. - Returns
0on success, and non-zero on error. - Returns
0on success, and non-zero on error.
Yes, the return-value lines really do repeat like that. We keep the lore exact. π
π SEE ALSO π
- Kernel file
./include/linux/pstore.h struct pstore_record(9)
bye bestie π«Ά β the footer vibes are source/version ./include/linux, date October 2026, and page struct pstore_info(9). Periodt. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms