aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2022-05-13 13:40:05 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2022-05-13 13:43:19 +0000
commitdb71383b8836a586051b25c20992066d153c6941 (patch)
tree94d8d783e8aecb1668495d13d10f168a7ff31f08
parent489ba2223676ec251ab1bfe2906d2a62959c8ce3 (diff)
downloadsrc-db71383b8836a586051b25c20992066d153c6941.tar.gz
src-db71383b8836a586051b25c20992066d153c6941.zip
kerneldump: remove physical from dump routines
It is unused, especially now that the underlying d_dumper methods do not accept the argument. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35174
-rw-r--r--sys/amd64/amd64/minidump_machdep.c4
-rw-r--r--sys/arm/arm/minidump_machdep.c4
-rw-r--r--sys/arm64/arm64/minidump_machdep.c4
-rw-r--r--sys/ddb/db_textdump.c4
-rw-r--r--sys/geom/raid/g_raid.c6
-rw-r--r--sys/i386/i386/minidump_machdep_base.c4
-rw-r--r--sys/kern/kern_dump.c8
-rw-r--r--sys/kern/kern_shutdown.c39
-rw-r--r--sys/powerpc/powerpc/minidump_machdep.c4
-rw-r--r--sys/riscv/riscv/minidump_machdep.c4
-rw-r--r--sys/sys/conf.h4
11 files changed, 39 insertions, 46 deletions
diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c
index de8433ae5a05..3b9c39ad58da 100644
--- a/sys/amd64/amd64/minidump_machdep.c
+++ b/sys/amd64/amd64/minidump_machdep.c
@@ -75,7 +75,7 @@ blk_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = dump_append(di, dump_va, 0, fragsz);
+ error = dump_append(di, dump_va, fragsz);
fragsz = 0;
return (error);
}
@@ -128,7 +128,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
}
if (ptr) {
- error = dump_append(di, ptr, 0, len);
+ error = dump_append(di, ptr, len);
if (error)
return (error);
ptr += len;
diff --git a/sys/arm/arm/minidump_machdep.c b/sys/arm/arm/minidump_machdep.c
index 80692ee1359c..8a74dc9818ba 100644
--- a/sys/arm/arm/minidump_machdep.c
+++ b/sys/arm/arm/minidump_machdep.c
@@ -70,7 +70,7 @@ blk_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = dump_append(di, dump_va, 0, fragsz);
+ error = dump_append(di, dump_va, fragsz);
fragsz = 0;
return (error);
}
@@ -115,7 +115,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
wdog_kern_pat(WD_LASTVAL);
if (ptr) {
- error = dump_append(di, ptr, 0, len);
+ error = dump_append(di, ptr, len);
if (error)
return (error);
ptr += len;
diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c
index e05a19fc1c41..3dfeb3dfef1e 100644
--- a/sys/arm64/arm64/minidump_machdep.c
+++ b/sys/arm64/arm64/minidump_machdep.c
@@ -75,7 +75,7 @@ blk_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = dump_append(di, dump_va, 0, fragsz);
+ error = dump_append(di, dump_va, fragsz);
fragsz = 0;
return (error);
}
@@ -121,7 +121,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
wdog_kern_pat(WD_LASTVAL);
if (ptr) {
- error = dump_append(di, ptr, 0, len);
+ error = dump_append(di, ptr, len);
if (error)
return (error);
ptr += len;
diff --git a/sys/ddb/db_textdump.c b/sys/ddb/db_textdump.c
index 539b51e58e1c..aad8b6965318 100644
--- a/sys/ddb/db_textdump.c
+++ b/sys/ddb/db_textdump.c
@@ -248,7 +248,7 @@ textdump_writeblock(struct dumperinfo *di, off_t offset, char *buffer)
return (EIO);
if (offset < SIZEOF_METADATA)
return (ENOSPC);
- textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset,
+ textdump_error = dump_write(di, buffer, offset + di->mediaoffset,
TEXTDUMP_BLOCKSIZE);
if (textdump_error)
printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset,
@@ -501,7 +501,7 @@ textdump_dumpsys(struct dumperinfo *di)
* Terminate the dump, report any errors, and clear the pending flag.
*/
if (textdump_error == 0)
- (void)dump_write(di, NULL, 0, 0, 0);
+ (void)dump_write(di, NULL, 0, 0);
if (textdump_error == ENOSPC)
printf("Textdump: Insufficient space on dump partition\n");
else if (textdump_error != 0)
diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c
index 561ac5b45e42..ffcc880d74d4 100644
--- a/sys/geom/raid/g_raid.c
+++ b/sys/geom/raid/g_raid.c
@@ -1416,10 +1416,8 @@ g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd, void *virtual,
return (ENXIO);
if (sd->sd_disk->d_kd.di.dumper == NULL)
return (EOPNOTSUPP);
- return (dump_write(&sd->sd_disk->d_kd.di,
- virtual, 0,
- sd->sd_disk->d_kd.di.mediaoffset + sd->sd_offset + offset,
- length));
+ return (dump_write(&sd->sd_disk->d_kd.di, virtual,
+ sd->sd_disk->d_kd.di.mediaoffset + sd->sd_offset + offset, length));
}
static void
diff --git a/sys/i386/i386/minidump_machdep_base.c b/sys/i386/i386/minidump_machdep_base.c
index ce26e339d2be..5072474b9f8a 100644
--- a/sys/i386/i386/minidump_machdep_base.c
+++ b/sys/i386/i386/minidump_machdep_base.c
@@ -69,7 +69,7 @@ blk_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = dump_append(di, dump_va, 0, fragsz);
+ error = dump_append(di, dump_va, fragsz);
fragsz = 0;
return (error);
}
@@ -112,7 +112,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
wdog_kern_pat(WD_LASTVAL);
if (ptr) {
- error = dump_append(di, ptr, 0, len);
+ error = dump_append(di, ptr, len);
if (error)
return (error);
ptr += len;
diff --git a/sys/kern/kern_dump.c b/sys/kern/kern_dump.c
index 17ac4e418645..393c4983d08b 100644
--- a/sys/kern/kern_dump.c
+++ b/sys/kern/kern_dump.c
@@ -122,7 +122,7 @@ dumpsys_buf_seek(struct dumperinfo *di, size_t sz)
while (sz > 0) {
nbytes = MIN(sz, sizeof(buf));
- error = dump_append(di, buf, 0, nbytes);
+ error = dump_append(di, buf, nbytes);
if (error)
return (error);
sz -= nbytes;
@@ -146,7 +146,7 @@ dumpsys_buf_write(struct dumperinfo *di, char *ptr, size_t sz)
ptr += len;
sz -= len;
if (fragsz == di->blocksize) {
- error = dump_append(di, di->blockbuf, 0, di->blocksize);
+ error = dump_append(di, di->blockbuf, di->blocksize);
if (error)
return (error);
fragsz = 0;
@@ -163,7 +163,7 @@ dumpsys_buf_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = dump_append(di, di->blockbuf, 0, di->blocksize);
+ error = dump_append(di, di->blockbuf, di->blocksize);
fragsz = 0;
return (error);
}
@@ -209,7 +209,7 @@ dumpsys_cb_dumpdata(struct dump_pa *mdp, int seqnr, void *arg)
dumpsys_map_chunk(pa, chunk, &va);
wdog_kern_pat(WD_LASTVAL);
- error = dump_append(di, va, 0, sz);
+ error = dump_append(di, va, sz);
dumpsys_unmap_chunk(pa, chunk, va);
if (error)
break;
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index b5433e4ed55f..c78b19ca454a 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -1081,8 +1081,7 @@ SYSCTL_PROC(_kern_shutdown, OID_AUTO, dumpdevname,
dumpdevname_sysctl_handler, "A",
"Device(s) for kernel dumps");
-static int _dump_append(struct dumperinfo *di, void *virtual,
- vm_offset_t physical, size_t length);
+static int _dump_append(struct dumperinfo *di, void *virtual, size_t length);
#ifdef EKCD
static struct kerneldumpcrypto *
@@ -1495,8 +1494,8 @@ dump_encrypt(struct kerneldumpcrypto *kdc, uint8_t *buf, size_t size)
/* Encrypt data and call dumper. */
static int
-dump_encrypted_write(struct dumperinfo *di, void *virtual,
- vm_offset_t physical, off_t offset, size_t length)
+dump_encrypted_write(struct dumperinfo *di, void *virtual, off_t offset,
+ size_t length)
{
static uint8_t buf[KERNELDUMP_BUFFER_SIZE];
struct kerneldumpcrypto *kdc;
@@ -1512,7 +1511,7 @@ dump_encrypted_write(struct dumperinfo *di, void *virtual,
if (dump_encrypt(kdc, buf, nbytes) != 0)
return (EIO);
- error = dump_write(di, buf, physical, offset, nbytes);
+ error = dump_write(di, buf, offset, nbytes);
if (error != 0)
return (error);
@@ -1543,7 +1542,7 @@ kerneldumpcomp_write_cb(void *base, size_t length, off_t offset, void *arg)
*/
rlength = rounddown(length, di->blocksize);
if (rlength != 0) {
- error = _dump_append(di, base, 0, rlength);
+ error = _dump_append(di, base, rlength);
if (error != 0)
return (error);
}
@@ -1553,7 +1552,7 @@ kerneldumpcomp_write_cb(void *base, size_t length, off_t offset, void *arg)
di->kdcomp->kdc_resid = resid;
return (EAGAIN);
}
- return (_dump_append(di, base, 0, length));
+ return (_dump_append(di, base, length));
}
/*
@@ -1602,7 +1601,7 @@ dump_write_headers(struct dumperinfo *di, struct kerneldumpheader *kdh)
extent = dtoh64(kdh->dumpextent);
#ifdef EKCD
if (kdc != NULL) {
- error = dump_write(di, kdc->kdc_dumpkey, 0,
+ error = dump_write(di, kdc->kdc_dumpkey,
di->mediaoffset + di->mediasize - di->blocksize - extent -
keysize, keysize);
if (error != 0)
@@ -1610,11 +1609,11 @@ dump_write_headers(struct dumperinfo *di, struct kerneldumpheader *kdh)
}
#endif
- error = dump_write(di, buf, 0,
+ error = dump_write(di, buf,
di->mediaoffset + di->mediasize - 2 * di->blocksize - extent -
keysize, di->blocksize);
if (error == 0)
- error = dump_write(di, buf, 0, di->mediaoffset + di->mediasize -
+ error = dump_write(di, buf, di->mediaoffset + di->mediasize -
di->blocksize, di->blocksize);
return (error);
}
@@ -1703,18 +1702,16 @@ dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh)
}
static int
-_dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical,
- size_t length)
+_dump_append(struct dumperinfo *di, void *virtual, size_t length)
{
int error;
#ifdef EKCD
if (di->kdcrypto != NULL)
- error = dump_encrypted_write(di, virtual, physical, di->dumpoff,
- length);
+ error = dump_encrypted_write(di, virtual, di->dumpoff, length);
else
#endif
- error = dump_write(di, virtual, physical, di->dumpoff, length);
+ error = dump_write(di, virtual, di->dumpoff, length);
if (error == 0)
di->dumpoff += length;
return (error);
@@ -1726,8 +1723,7 @@ _dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical,
* when the compression stream's output buffer is full.
*/
int
-dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical,
- size_t length)
+dump_append(struct dumperinfo *di, void *virtual, size_t length)
{
void *buf;
@@ -1739,15 +1735,14 @@ dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical,
memmove(buf, virtual, length);
return (compressor_write(di->kdcomp->kdc_stream, buf, length));
}
- return (_dump_append(di, virtual, physical, length));
+ return (_dump_append(di, virtual, length));
}
/*
* Write to the dump device at the specified offset.
*/
int
-dump_write(struct dumperinfo *di, void *virtual, vm_offset_t physical,
- off_t offset, size_t length)
+dump_write(struct dumperinfo *di, void *virtual, off_t offset, size_t length)
{
int error;
@@ -1772,7 +1767,7 @@ dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh)
error = compressor_flush(di->kdcomp->kdc_stream);
if (error == EAGAIN) {
/* We have residual data in di->blockbuf. */
- error = _dump_append(di, di->blockbuf, 0, di->blocksize);
+ error = _dump_append(di, di->blockbuf, di->blocksize);
if (error == 0)
/* Compensate for _dump_append()'s adjustment. */
di->dumpoff -= di->blocksize - di->kdcomp->kdc_resid;
@@ -1796,7 +1791,7 @@ dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh)
if (error != 0)
return (error);
- (void)dump_write(di, NULL, 0, 0, 0);
+ (void)dump_write(di, NULL, 0, 0);
return (0);
}
diff --git a/sys/powerpc/powerpc/minidump_machdep.c b/sys/powerpc/powerpc/minidump_machdep.c
index 396c6487823e..d713e11f2ab2 100644
--- a/sys/powerpc/powerpc/minidump_machdep.c
+++ b/sys/powerpc/powerpc/minidump_machdep.c
@@ -89,7 +89,7 @@ blk_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = dump_append(di, crashdumpmap, 0, fragsz);
+ error = dump_append(di, crashdumpmap, fragsz);
DBG(dumptotal += fragsz;)
fragsz = 0;
return (error);
@@ -134,7 +134,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
dumpsys_pb_progress(len);
if (ptr) {
- error = dump_append(di, ptr, 0, len);
+ error = dump_append(di, ptr, len);
if (error)
return (error);
DBG(dumptotal += len;)
diff --git a/sys/riscv/riscv/minidump_machdep.c b/sys/riscv/riscv/minidump_machdep.c
index ee6faaa6680f..9a47bb31a6f7 100644
--- a/sys/riscv/riscv/minidump_machdep.c
+++ b/sys/riscv/riscv/minidump_machdep.c
@@ -72,7 +72,7 @@ blk_flush(struct dumperinfo *di)
if (fragsz == 0)
return (0);
- error = dump_append(di, dump_va, 0, fragsz);
+ error = dump_append(di, dump_va, fragsz);
fragsz = 0;
return (error);
}
@@ -126,7 +126,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
wdog_kern_pat(WD_LASTVAL);
if (ptr) {
- error = dump_append(di, ptr, 0, len);
+ error = dump_append(di, ptr, len);
if (error != 0)
return (error);
ptr += len;
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 37265c6988ce..9f60dcaf62fa 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -376,8 +376,8 @@ void dumper_ddb_insert(struct dumperinfo *);
void dumper_ddb_remove(struct dumperinfo *);
int dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh);
-int dump_append(struct dumperinfo *, void *, vm_offset_t, size_t);
-int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t);
+int dump_append(struct dumperinfo *, void *, size_t);
+int dump_write(struct dumperinfo *, void *, off_t, size_t);
int dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh);
void dump_init_header(const struct dumperinfo *di, struct kerneldumpheader *kdh,
const char *magic, uint32_t archver, uint64_t dumplen);