aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShunchao Hu <ankohuu@gmail.com>2026-04-07 13:07:31 +0000
committerShengYi Hung <aokblast@FreeBSD.org>2026-04-11 14:10:05 +0000
commit5f5cc3c67ae8a4d9a27e750bef98a9ce1a6b2cf5 (patch)
tree48e7e73067582e21ecf577dc8406bbd01cb03821
parent4e3fdced7f78c067e048c4d9ec42341c30b7899d (diff)
compat/linprocfs: Update /proc/partitions output
Linux /proc/partitions reports the major/minor pair, the device size in 1K blocks, and the device name. linprocfs still printed obsolete statistics columns and reported the size in bytes. Update linprocfs_dopartitions() to emit the Linux-style header and report provider sizes in 1K blocks. Signed-off-by: Shunchao Hu <ankohuu@gmail.com> Reviewed by: des MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/2126 Closes: https://github.com/freebsd/freebsd-src/pull/2126
-rw-r--r--sys/compat/linprocfs/linprocfs.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 941b76788dc1..786a486b9143 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -659,8 +659,7 @@ linprocfs_dopartitions(PFS_FILL_ARGS)
int major, minor;
g_topology_lock();
- sbuf_printf(sb, "major minor #blocks name rio rmerge rsect "
- "ruse wio wmerge wsect wuse running use aveq\n");
+ sbuf_printf(sb, "major minor #blocks name\n\n");
LIST_FOREACH(cp, &g_classes, class) {
if (strcmp(cp->name, "DISK") == 0 ||
@@ -672,13 +671,10 @@ linprocfs_dopartitions(PFS_FILL_ARGS)
major = 0;
minor = 0;
}
- sbuf_printf(sb, "%d %d %lld %s "
- "%d %d %d %d %d "
- "%d %d %d %d %d %d\n",
- major, minor,
- (long long)pp->mediasize, pp->name,
- 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0);
+ sbuf_printf(sb, "%4d %7d %10lld %s\n",
+ major, minor,
+ B2K((long long)pp->mediasize),
+ pp->name);
}
}
}