diff options
author | Kees Cook <keescook@chromium.org> | 2021-06-15 10:19:13 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2021-06-16 21:09:31 -0700 |
commit | 1d1f6cc5818c750ac69473e4951e7165913fbf16 (patch) | |
tree | 325a1e03d905c0372065c86152a3a914b744a914 /drivers/mtd | |
parent | c811659bb9a09b319842bf61602ce858b1d1920a (diff) | |
download | lwn-1d1f6cc5818c750ac69473e4951e7165913fbf16.tar.gz lwn-1d1f6cc5818c750ac69473e4951e7165913fbf16.zip |
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 <keescook@chromium.org>
Fixed-by: Pu Lehui <pulehui@huawei.com>
Link: https://lore.kernel.org/lkml/20210617005424.182305-1-pulehui@huawei.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdpstore.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/mtdpstore.c b/drivers/mtd/mtdpstore.c index a3ae8778f6a9..e13d42c0acb0 100644 --- a/drivers/mtd/mtdpstore.c +++ b/drivers/mtd/mtdpstore.c @@ -423,13 +423,13 @@ static void mtdpstore_notify_add(struct mtd_info *mtd) longcnt = BITS_TO_LONGS(div_u64(mtd->size, mtd->erasesize)); cxt->badmap = kcalloc(longcnt, sizeof(long), GFP_KERNEL); - cxt->dev.total_size = mtd->size; /* just support dmesg right now */ cxt->dev.flags = PSTORE_FLAGS_DMESG; - cxt->dev.read = mtdpstore_read; - cxt->dev.write = mtdpstore_write; - cxt->dev.erase = mtdpstore_erase; - cxt->dev.panic_write = mtdpstore_panic_write; + cxt->dev.zone.read = mtdpstore_read; + cxt->dev.zone.write = mtdpstore_write; + cxt->dev.zone.erase = mtdpstore_erase; + cxt->dev.zone.panic_write = mtdpstore_panic_write; + cxt->dev.zone.total_size = mtd->size; ret = register_pstore_device(&cxt->dev); if (ret) { |