From 1d1f6cc5818c750ac69473e4951e7165913fbf16 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 15 Jun 2021 10:19:13 -0700 Subject: pstore/blk: Include zone in pstore_device_info Information was redundant between struct pstore_zone_info and struct pstore_device_info. Use struct pstore_zone_info, with member name "zone". Additionally untangle the logic for the "best effort" block device instance. Signed-off-by: Kees Cook Fixed-by: Pu Lehui Link: https://lore.kernel.org/lkml/20210617005424.182305-1-pulehui@huawei.com --- include/linux/pstore_blk.h | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'include/linux/pstore_blk.h') diff --git a/include/linux/pstore_blk.h b/include/linux/pstore_blk.h index 99564f93d774..924ca07aafbd 100644 --- a/include/linux/pstore_blk.h +++ b/include/linux/pstore_blk.h @@ -10,36 +10,15 @@ /** * struct pstore_device_info - back-end pstore/blk driver structure. * - * @total_size: The total size in bytes pstore/blk can use. It must be greater - * than 4096 and be multiple of 4096. * @flags: Refer to macro starting with PSTORE_FLAGS defined in * linux/pstore.h. It means what front-ends this device support. * Zero means all backends for compatible. - * @read: The general read operation. Both of the function parameters - * @size and @offset are relative value to bock device (not the - * whole disk). - * On success, the number of bytes should be returned, others - * means error. - * @write: The same as @read, but the following error number: - * -EBUSY means try to write again later. - * -ENOMSG means to try next zone. - * @erase: The general erase operation for device with special removing - * job. Both of the function parameters @size and @offset are - * relative value to storage. - * Return 0 on success and others on failure. - * @panic_write:The write operation only used for panic case. It's optional - * if you do not care panic log. The parameters are relative - * value to storage. - * On success, the number of bytes should be returned, others - * excluding -ENOMSG mean error. -ENOMSG means to try next zone. + * @zone: The struct pstore_zone_info details. + * */ struct pstore_device_info { - unsigned long total_size; unsigned int flags; - pstore_zone_read_op read; - pstore_zone_write_op write; - pstore_zone_erase_op erase; - pstore_zone_write_op panic_write; + struct pstore_zone_info zone; }; int register_pstore_device(struct pstore_device_info *dev); -- cgit