summaryrefslogtreecommitdiffstats
path: root/fs/pstore/zone.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pstore/zone.c')
-rw-r--r--fs/pstore/zone.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c
index add26b125984..819428dfa32f 100644
--- a/fs/pstore/zone.c
+++ b/fs/pstore/zone.c
@@ -660,15 +660,21 @@ static inline int psz_kmsg_erase(struct psz_context *cxt,
struct psz_buffer *buffer = zone->buffer;
struct psz_kmsg_header *hdr =
(struct psz_kmsg_header *)buffer->data;
+ size_t size;
if (unlikely(!psz_ok(zone)))
return 0;
+
/* this zone is already updated, no need to erase */
if (record->count != hdr->counter)
return 0;
+ size = buffer_datalen(zone) + sizeof(*zone->buffer);
atomic_set(&zone->buffer->datalen, 0);
- return psz_zone_write(zone, FLUSH_META, NULL, 0, 0);
+ if (cxt->pstore_zone_info->erase)
+ return cxt->pstore_zone_info->erase(size, zone->off);
+ else
+ return psz_zone_write(zone, FLUSH_META, NULL, 0, 0);
}
static inline int psz_record_erase(struct psz_context *cxt,