git: bf84156b24ff - main - tarfs: Use a separate debug bit for bounce buffer usage.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Feb 2023 00:41:29 UTC
The branch main has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=bf84156b24ffd167b93980a91904fafe84ac7c49
commit bf84156b24ffd167b93980a91904fafe84ac7c49
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-02-16 00:40:18 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-02-16 00:40:45 +0000
tarfs: Use a separate debug bit for bounce buffer usage.
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D38588
---
share/man/man5/tarfs.5 | 3 ++-
sys/fs/tarfs/tarfs_dbg.h | 1 +
sys/fs/tarfs/tarfs_io.c | 6 +++---
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/share/man/man5/tarfs.5 b/share/man/man5/tarfs.5
index e431e5d1fa1c..29999b8066f7 100644
--- a/share/man/man5/tarfs.5
+++ b/share/man/man5/tarfs.5
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd February 2, 2023
+.Dd February 14, 2023
.Dt TARFS 5
.Os
.Sh NAME
@@ -81,6 +81,7 @@ by adding together the relevant values from the table below.
.It 0x40 Ta Decompression
.It 0x80 Ta Decompression index
.It 0x100 Ta Sparse file mapping
+.It 0x200 Ta Bounce buffer usage
.El
.Sh SEE ALSO
.Xr tar 1 ,
diff --git a/sys/fs/tarfs/tarfs_dbg.h b/sys/fs/tarfs/tarfs_dbg.h
index 45d11d679719..bedb94b3d602 100644
--- a/sys/fs/tarfs/tarfs_dbg.h
+++ b/sys/fs/tarfs/tarfs_dbg.h
@@ -45,6 +45,7 @@ extern int tarfs_debug;
#define TARFS_DEBUG_ZIO 0x40
#define TARFS_DEBUG_ZIDX 0x80
#define TARFS_DEBUG_MAP 0x100
+#define TARFS_DEBUG_BOUNCE 0x200
#define TARFS_DPF(category, fmt, ...) \
do { \
diff --git a/sys/fs/tarfs/tarfs_io.c b/sys/fs/tarfs/tarfs_io.c
index 8837681ac5f0..58f3e7eab03f 100644
--- a/sys/fs/tarfs/tarfs_io.c
+++ b/sys/fs/tarfs/tarfs_io.c
@@ -391,7 +391,7 @@ tarfs_zread_zstd(struct tarfs_zio *zio, struct uio *uiop)
if (uiop->uio_segflg == UIO_SYSSPACE) {
zob.dst = uiop->uio_iov->iov_base;
} else {
- TARFS_DPF(ALLOC, "%s: allocating %zu-byte bounce buffer\n",
+ TARFS_DPF(BOUNCE, "%s: allocating %zu-byte bounce buffer\n",
__func__, len);
zob.dst = obuf = malloc(len, M_TEMP, M_WAITOK);
}
@@ -488,7 +488,7 @@ fail_unlocked:
if (uiop->uio_segflg == UIO_SYSSPACE) {
uiop->uio_resid = resid;
} else if (len > resid) {
- TARFS_DPF(ALLOC, "%s: bounced %zu bytes\n", __func__,
+ TARFS_DPF(BOUNCE, "%s: bounced %zu bytes\n", __func__,
len - resid);
error = uiomove(obuf, len - resid, uiop);
#ifdef TARFS_DEBUG
@@ -497,7 +497,7 @@ fail_unlocked:
}
}
if (obuf != NULL) {
- TARFS_DPF(ALLOC, "%s: freeing bounce buffer\n", __func__);
+ TARFS_DPF(BOUNCE, "%s: freeing bounce buffer\n", __func__);
free(obuf, M_TEMP);
}
if (rl != NULL)